Merged in masayuki2009/nuttx.nuttx/add_gc_sections (pull request #1040)

boards: spresense: Add --gc-sections to LDFLAGS in scripts/Make.defs

Also, add -ffunction-sections -fdata-sections to ARCHCFLAGS

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>

Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
Masayuki Ishikawa 2019-10-01 12:03:54 +00:00 committed by Gregory Nutt
parent 9673debe2b
commit 30021c4dee

View File

@ -81,7 +81,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce -fomit-frame-pointer
endif endif
ARCHCFLAGS = -fno-builtin -mabi=aapcs ARCHCFLAGS = -fno-builtin -mabi=aapcs -ffunction-sections -fdata-sections
ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti -std=c++98 ARCHCXXFLAGS = -fno-builtin -fno-exceptions -fno-rtti -std=c++98
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@ -127,6 +127,8 @@ OBJEXT = .o
LIBEXT = .a LIBEXT = .a
EXEEXT = EXEEXT =
LDFLAGS += --gc-sections
ifneq ($(CROSSDEV),arm-nuttx-elf-) ifneq ($(CROSSDEV),arm-nuttx-elf-)
LDFLAGS += -nostartfiles -nodefaultlibs LDFLAGS += -nostartfiles -nodefaultlibs
endif endif