kopia lustrzana https://github.com/micropython/micropython
Merge fa5994bd0f
into 7b050b366b
commit
75992943ba
|
@ -25,9 +25,9 @@ CFLAGS += -fdata-sections -ffunction-sections -fno-asynchronous-unwind-tables
|
|||
# Debugging/Optimization
|
||||
ifdef DEBUG
|
||||
CFLAGS += -g
|
||||
COPT = -O0
|
||||
COPT ?= -O0
|
||||
else
|
||||
COPT = -Os #-DNDEBUG
|
||||
COPT ?= -Os #-DNDEBUG
|
||||
endif
|
||||
|
||||
# On OSX, 'gcc' is a symlink to clang unless a real gcc is installed.
|
||||
|
|
|
@ -16,13 +16,14 @@ PYDFU ?= $(TOP)/tools/pydfu.py
|
|||
CFLAGS += -I. -I$(TOP) -I$(BUILD)
|
||||
CFLAGS += -Wall -Werror -std=c99 -nostdlib
|
||||
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.
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -Og
|
||||
COPT ?= -Og
|
||||
else
|
||||
CFLAGS += -Os -DNDEBUG
|
||||
COPT ?= -Os -DNDEBUG
|
||||
CFLAGS += -fdata-sections -ffunction-sections
|
||||
endif
|
||||
|
||||
|
|
|
@ -89,10 +89,10 @@ LIBS += -L$(dir $(LIBGCC_FILE_NAME)) -lgcc
|
|||
# Debugging/Optimization
|
||||
CFLAGS += -g # always include debug info in the ELF
|
||||
ifeq ($(DEBUG), 1)
|
||||
COPT = -O0
|
||||
COPT ?= -O0
|
||||
else
|
||||
CFLAGS += -fdata-sections -ffunction-sections
|
||||
COPT += -Os -DNDEBUG
|
||||
COPT ?= -Os -DNDEBUG
|
||||
LDFLAGS += --gc-sections
|
||||
endif
|
||||
|
||||
|
|
|
@ -321,11 +321,11 @@ SRC_QSTR += $(SRC_C) $(SHARED_SRC_C) $(GEN_PINS_SRC)
|
|||
|
||||
CFLAGS += -g # always include debug info in the ELF
|
||||
ifeq ($(DEBUG),1)
|
||||
CFLAGS += -Og
|
||||
COPT ?= -Og
|
||||
# Disable text compression in debug builds
|
||||
MICROPY_ROM_TEXT_COMPRESSION = 0
|
||||
else
|
||||
CFLAGS += -Os -DNDEBUG
|
||||
COPT ?= -Os -DNDEBUG
|
||||
endif
|
||||
|
||||
# Set default values for optional variables
|
||||
|
@ -335,6 +335,7 @@ MICROPY_HW_SDRAM_SIZE ?= 0
|
|||
# Configure default compiler flags
|
||||
CFLAGS += \
|
||||
$(INC) \
|
||||
$(COPT) \
|
||||
-D__START=main \
|
||||
-D__STARTUP_CLEAR_BSS \
|
||||
-D__STARTUP_INITIALIZE_RAMFUNCTION \
|
||||
|
|
|
@ -36,7 +36,7 @@ LDFLAGS += -Wl,-map,$@.map -Wl,-dead_strip
|
|||
endif
|
||||
endif
|
||||
|
||||
CSUPEROPT = -Os # save some code space
|
||||
CSUPEROPT ?= -Os # save some code space
|
||||
|
||||
# Tune for Debugging or Optimization
|
||||
CFLAGS += -g # always include debug info in the ELF
|
||||
|
|
|
@ -25,9 +25,10 @@ CFLAGS += $(INC) -Wall -Werror -std=gnu99 -nostdlib $(CFLAGS_PIC16BIT) $(COPT)
|
|||
|
||||
#Debugging/Optimization
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -O0 -ggdb
|
||||
COPT ?= -O0
|
||||
CFLAGS += -ggdb
|
||||
else
|
||||
CFLAGS += -O1 -DNDEBUG
|
||||
COPT ?= -O1 -DNDEBUG
|
||||
endif
|
||||
|
||||
LDFLAGS += --heap=0 -nostdlib -T $(XC16)/support/$(PARTFAMILY)/gld/p$(PART).gld -Map=$@.map --cref -p$(PART)
|
||||
|
|
|
@ -24,9 +24,9 @@ INC += -I$(BUILD)
|
|||
CFLAGS += $(INC) -g -Wall -Wdouble-promotion -Wfloat-conversion -std=c99 $(COPT)
|
||||
CFLAGS += -mno-string -mno-multiple -mno-vsx -mno-altivec -nostdlib
|
||||
CFLAGS += -mlittle-endian -mstrict-align -msoft-float
|
||||
CFLAGS += -Os
|
||||
CFLAGS += -fdata-sections -ffunction-sections -fno-stack-protector -ffreestanding
|
||||
CFLAGS += -U_FORTIFY_SOURCE
|
||||
COPT ?= -Os
|
||||
|
||||
LDFLAGS += -N -T powerpc.lds -nostdlib
|
||||
|
||||
|
|
|
@ -61,9 +61,9 @@ CFLAGS += $(CFLAGS_EXTRA)
|
|||
# Debugging/Optimization
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -g
|
||||
COPT = -O0
|
||||
COPT ?= -O0
|
||||
else
|
||||
COPT += -Os -DNDEBUG
|
||||
COPT ?= -Os -DNDEBUG
|
||||
endif
|
||||
|
||||
## With CoudeSourcery it's actually a little different, you just need `-T generic-m-hosted.ld`.
|
||||
|
|
|
@ -140,12 +140,11 @@ LDFLAGS += --gc-sections
|
|||
CFLAGS += -g # always include debug info in the ELF
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -DPENDSV_DEBUG
|
||||
#COPT = -Og
|
||||
COPT = -Os
|
||||
COPT ?= -Os
|
||||
# Disable text compression in debug builds
|
||||
MICROPY_ROM_TEXT_COMPRESSION = 0
|
||||
else
|
||||
COPT += -Os -DNDEBUG
|
||||
COPT ?= -Os -DNDEBUG
|
||||
endif
|
||||
|
||||
# Flags for optional C++ source code
|
||||
|
|
|
@ -285,7 +285,7 @@ SRC_O += \
|
|||
$(SYSTEM_FILE)
|
||||
|
||||
ifeq ($(MCU_SERIES),$(filter $(MCU_SERIES),f0 g0 l0))
|
||||
CSUPEROPT = -Os # save some code space
|
||||
CSUPEROPT ?= -Os # save some code space
|
||||
SRC_O += \
|
||||
resethandler_m0.o \
|
||||
shared/runtime/gchelper_thumb1.o
|
||||
|
|
|
@ -90,9 +90,9 @@ LDFLAGS += --gc-sections
|
|||
# Debugging/Optimization
|
||||
ifeq ($(DEBUG), 1)
|
||||
CFLAGS += -g -DPENDSV_DEBUG
|
||||
COPT = -Og
|
||||
COPT ?= -Og
|
||||
else
|
||||
COPT += -Os -DNDEBUG
|
||||
COPT ?= -Os -DNDEBUG
|
||||
endif
|
||||
|
||||
$(BUILD)/shared/libc/string0.o: CFLAGS += $(CFLAGS_BUILTIN)
|
||||
|
|
|
@ -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
|
||||
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
|
||||
empty. This will skip the build step that strips symbols and debug
|
||||
information, but changes nothing else in the build configuration.
|
||||
|
|
|
@ -45,9 +45,9 @@ LDFLAGS += -lm -lbcrypt $(LDFLAGS_EXTRA)
|
|||
# Debugging/Optimization
|
||||
ifdef DEBUG
|
||||
CFLAGS += -g
|
||||
COPT = -O0
|
||||
COPT ?= -O0
|
||||
else
|
||||
COPT = -Os #-DNDEBUG
|
||||
COPT ?= -Os #-DNDEBUG
|
||||
endif
|
||||
|
||||
# source files
|
||||
|
|
2
py/py.mk
2
py/py.mk
|
@ -19,7 +19,7 @@ QSTR_GLOBAL_DEPENDENCIES += $(PY_SRC)/mpconfig.h mpconfigport.h
|
|||
QSTR_GLOBAL_REQUIREMENTS += $(HEADER_BUILD)/mpversion.h
|
||||
|
||||
# some code is performance bottleneck and compiled with other optimization options
|
||||
CSUPEROPT = -O3
|
||||
CSUPEROPT ?= -O3
|
||||
|
||||
# Enable building 32-bit code on 64-bit host.
|
||||
ifeq ($(MICROPY_FORCE_32BIT),1)
|
||||
|
|
Ładowanie…
Reference in New Issue