mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
compile/opt: add config DEBUG_OPT_UNUSED_SECTIONS
Enable this option to optimization the unused input sections with the linker by compiling with " -ffunction-sections -fdata-sections ", and linking with " --gc-sections ". Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
@@ -34,7 +34,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
|
||||
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
|
||||
endif
|
||||
|
||||
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections
|
||||
ARCHCFLAGS += -fno-common
|
||||
ARCHCXXFLAGS += -fno-common
|
||||
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
|
||||
ARCHWARNINGSXX = -Wall -Wshadow -Wundef
|
||||
@@ -61,8 +61,6 @@ CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
|
||||
LDELFFLAGS = -r -e main
|
||||
LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
|
||||
|
||||
LDFLAGS += --gc-sections
|
||||
|
||||
ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
|
||||
LDFLAGS += -g
|
||||
endif
|
||||
|
||||
Reference in New Issue
Block a user