stinos 2024-04-25 22:52:05 +02:00 zatwierdzone przez GitHub
commit 75992943ba
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: B5690EEEBB952194
14 zmienionych plików z 28 dodań i 25 usunięć

Wyświetl plik

@ -25,9 +25,9 @@ CFLAGS += -fdata-sections -ffunction-sections -fno-asynchronous-unwind-tables
# Debugging/Optimization # Debugging/Optimization
ifdef DEBUG ifdef DEBUG
CFLAGS += -g CFLAGS += -g
COPT = -O0 COPT ?= -O0
else else
COPT = -Os #-DNDEBUG COPT ?= -Os #-DNDEBUG
endif endif
# On OSX, 'gcc' is a symlink to clang unless a real gcc is installed. # On OSX, 'gcc' is a symlink to clang unless a real gcc is installed.

Wyświetl plik

@ -16,13 +16,14 @@ PYDFU ?= $(TOP)/tools/pydfu.py
CFLAGS += -I. -I$(TOP) -I$(BUILD) CFLAGS += -I. -I$(TOP) -I$(BUILD)
CFLAGS += -Wall -Werror -std=c99 -nostdlib CFLAGS += -Wall -Werror -std=c99 -nostdlib
CFLAGS += -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -msoft-float CFLAGS += -mthumb -mtune=cortex-m4 -mcpu=cortex-m4 -msoft-float
CSUPEROPT = -Os # save some code space for performance-critical code CFLAGS += $(COPT)
CSUPEROPT ?= -Os # save some code space for performance-critical code
# Select debugging or optimisation build. # Select debugging or optimisation build.
ifeq ($(DEBUG), 1) ifeq ($(DEBUG), 1)
CFLAGS += -Og COPT ?= -Og
else else
CFLAGS += -Os -DNDEBUG COPT ?= -Os -DNDEBUG
CFLAGS += -fdata-sections -ffunction-sections CFLAGS += -fdata-sections -ffunction-sections
endif endif

Wyświetl plik

@ -89,10 +89,10 @@ LIBS += -L$(dir $(LIBGCC_FILE_NAME)) -lgcc
# Debugging/Optimization # Debugging/Optimization
CFLAGS += -g # always include debug info in the ELF CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG), 1) ifeq ($(DEBUG), 1)
COPT = -O0 COPT ?= -O0
else else
CFLAGS += -fdata-sections -ffunction-sections CFLAGS += -fdata-sections -ffunction-sections
COPT += -Os -DNDEBUG COPT ?= -Os -DNDEBUG
LDFLAGS += --gc-sections LDFLAGS += --gc-sections
endif endif

Wyświetl plik

@ -321,11 +321,11 @@ SRC_QSTR += $(SRC_C) $(SHARED_SRC_C) $(GEN_PINS_SRC)
CFLAGS += -g # always include debug info in the ELF CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG),1) ifeq ($(DEBUG),1)
CFLAGS += -Og COPT ?= -Og
# Disable text compression in debug builds # Disable text compression in debug builds
MICROPY_ROM_TEXT_COMPRESSION = 0 MICROPY_ROM_TEXT_COMPRESSION = 0
else else
CFLAGS += -Os -DNDEBUG COPT ?= -Os -DNDEBUG
endif endif
# Set default values for optional variables # Set default values for optional variables
@ -335,6 +335,7 @@ MICROPY_HW_SDRAM_SIZE ?= 0
# Configure default compiler flags # Configure default compiler flags
CFLAGS += \ CFLAGS += \
$(INC) \ $(INC) \
$(COPT) \
-D__START=main \ -D__START=main \
-D__STARTUP_CLEAR_BSS \ -D__STARTUP_CLEAR_BSS \
-D__STARTUP_INITIALIZE_RAMFUNCTION \ -D__STARTUP_INITIALIZE_RAMFUNCTION \

Wyświetl plik

@ -36,7 +36,7 @@ LDFLAGS += -Wl,-map,$@.map -Wl,-dead_strip
endif endif
endif endif
CSUPEROPT = -Os # save some code space CSUPEROPT ?= -Os # save some code space
# Tune for Debugging or Optimization # Tune for Debugging or Optimization
CFLAGS += -g # always include debug info in the ELF CFLAGS += -g # always include debug info in the ELF

Wyświetl plik

@ -25,9 +25,10 @@ CFLAGS += $(INC) -Wall -Werror -std=gnu99 -nostdlib $(CFLAGS_PIC16BIT) $(COPT)
#Debugging/Optimization #Debugging/Optimization
ifeq ($(DEBUG), 1) ifeq ($(DEBUG), 1)
CFLAGS += -O0 -ggdb COPT ?= -O0
CFLAGS += -ggdb
else else
CFLAGS += -O1 -DNDEBUG COPT ?= -O1 -DNDEBUG
endif endif
LDFLAGS += --heap=0 -nostdlib -T $(XC16)/support/$(PARTFAMILY)/gld/p$(PART).gld -Map=$@.map --cref -p$(PART) LDFLAGS += --heap=0 -nostdlib -T $(XC16)/support/$(PARTFAMILY)/gld/p$(PART).gld -Map=$@.map --cref -p$(PART)

Wyświetl plik

@ -24,9 +24,9 @@ INC += -I$(BUILD)
CFLAGS += $(INC) -g -Wall -Wdouble-promotion -Wfloat-conversion -std=c99 $(COPT) CFLAGS += $(INC) -g -Wall -Wdouble-promotion -Wfloat-conversion -std=c99 $(COPT)
CFLAGS += -mno-string -mno-multiple -mno-vsx -mno-altivec -nostdlib CFLAGS += -mno-string -mno-multiple -mno-vsx -mno-altivec -nostdlib
CFLAGS += -mlittle-endian -mstrict-align -msoft-float CFLAGS += -mlittle-endian -mstrict-align -msoft-float
CFLAGS += -Os
CFLAGS += -fdata-sections -ffunction-sections -fno-stack-protector -ffreestanding CFLAGS += -fdata-sections -ffunction-sections -fno-stack-protector -ffreestanding
CFLAGS += -U_FORTIFY_SOURCE CFLAGS += -U_FORTIFY_SOURCE
COPT ?= -Os
LDFLAGS += -N -T powerpc.lds -nostdlib LDFLAGS += -N -T powerpc.lds -nostdlib

Wyświetl plik

@ -61,9 +61,9 @@ CFLAGS += $(CFLAGS_EXTRA)
# Debugging/Optimization # Debugging/Optimization
ifeq ($(DEBUG), 1) ifeq ($(DEBUG), 1)
CFLAGS += -g CFLAGS += -g
COPT = -O0 COPT ?= -O0
else else
COPT += -Os -DNDEBUG COPT ?= -Os -DNDEBUG
endif endif
## With CoudeSourcery it's actually a little different, you just need `-T generic-m-hosted.ld`. ## With CoudeSourcery it's actually a little different, you just need `-T generic-m-hosted.ld`.

Wyświetl plik

@ -140,12 +140,11 @@ LDFLAGS += --gc-sections
CFLAGS += -g # always include debug info in the ELF CFLAGS += -g # always include debug info in the ELF
ifeq ($(DEBUG), 1) ifeq ($(DEBUG), 1)
CFLAGS += -DPENDSV_DEBUG CFLAGS += -DPENDSV_DEBUG
#COPT = -Og COPT ?= -Os
COPT = -Os
# Disable text compression in debug builds # Disable text compression in debug builds
MICROPY_ROM_TEXT_COMPRESSION = 0 MICROPY_ROM_TEXT_COMPRESSION = 0
else else
COPT += -Os -DNDEBUG COPT ?= -Os -DNDEBUG
endif endif
# Flags for optional C++ source code # Flags for optional C++ source code

Wyświetl plik

@ -285,7 +285,7 @@ SRC_O += \
$(SYSTEM_FILE) $(SYSTEM_FILE)
ifeq ($(MCU_SERIES),$(filter $(MCU_SERIES),f0 g0 l0)) ifeq ($(MCU_SERIES),$(filter $(MCU_SERIES),f0 g0 l0))
CSUPEROPT = -Os # save some code space CSUPEROPT ?= -Os # save some code space
SRC_O += \ SRC_O += \
resethandler_m0.o \ resethandler_m0.o \
shared/runtime/gchelper_thumb1.o shared/runtime/gchelper_thumb1.o

Wyświetl plik

@ -90,9 +90,9 @@ LDFLAGS += --gc-sections
# Debugging/Optimization # Debugging/Optimization
ifeq ($(DEBUG), 1) ifeq ($(DEBUG), 1)
CFLAGS += -g -DPENDSV_DEBUG CFLAGS += -g -DPENDSV_DEBUG
COPT = -Og COPT ?= -Og
else else
COPT += -Os -DNDEBUG COPT ?= -Os -DNDEBUG
endif endif
$(BUILD)/shared/libc/string0.o: CFLAGS += $(CFLAGS_BUILTIN) $(BUILD)/shared/libc/string0.o: CFLAGS += $(CFLAGS_BUILTIN)

Wyświetl plik

@ -82,7 +82,8 @@ To build a debuggable version of the Unix port, there are two options
1. Run `make [other arguments] DEBUG=1`. Note setting `DEBUG` also reduces the 1. Run `make [other arguments] DEBUG=1`. Note setting `DEBUG` also reduces the
optimisation level, so it's not a good option for builds that also want the optimisation level, so it's not a good option for builds that also want the
best performance. best performance. When using gdb and facing 'optimized out' values or stepping
through the source not halting at the correct location, also pass `COPT=-O0`.
2. Run `make [other arguments] STRIP=`. Note that the value of `STRIP` is 2. Run `make [other arguments] STRIP=`. Note that the value of `STRIP` is
empty. This will skip the build step that strips symbols and debug empty. This will skip the build step that strips symbols and debug
information, but changes nothing else in the build configuration. information, but changes nothing else in the build configuration.

Wyświetl plik

@ -45,9 +45,9 @@ LDFLAGS += -lm -lbcrypt $(LDFLAGS_EXTRA)
# Debugging/Optimization # Debugging/Optimization
ifdef DEBUG ifdef DEBUG
CFLAGS += -g CFLAGS += -g
COPT = -O0 COPT ?= -O0
else else
COPT = -Os #-DNDEBUG COPT ?= -Os #-DNDEBUG
endif endif
# source files # source files

Wyświetl plik

@ -19,7 +19,7 @@ QSTR_GLOBAL_DEPENDENCIES += $(PY_SRC)/mpconfig.h mpconfigport.h
QSTR_GLOBAL_REQUIREMENTS += $(HEADER_BUILD)/mpversion.h QSTR_GLOBAL_REQUIREMENTS += $(HEADER_BUILD)/mpversion.h
# some code is performance bottleneck and compiled with other optimization options # some code is performance bottleneck and compiled with other optimization options
CSUPEROPT = -O3 CSUPEROPT ?= -O3
# Enable building 32-bit code on 64-bit host. # Enable building 32-bit code on 64-bit host.
ifeq ($(MICROPY_FORCE_32BIT),1) ifeq ($(MICROPY_FORCE_32BIT),1)