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:
chao.an
2022-04-21 18:10:40 +08:00
committed by Xiang Xiao
parent 56ecd44f63
commit 64d7326ed5
46 changed files with 149 additions and 93 deletions
+13
View File
@@ -1956,6 +1956,19 @@ config DEBUG_OPTLEVEL
This string represents the custom optimization level that will be This string represents the custom optimization level that will be
used if DEBUG_CUSTOMOPT. used if DEBUG_CUSTOMOPT.
config DEBUG_OPT_UNUSED_SECTIONS
bool "Optimization to eliminate the unused input sections"
default y
depends on ARCH_TOOLCHAIN_GNU
---help---
Use these options on systems where the linker can perform optimizations
to improve locality of reference in the instruction space. Most systems
using the ELF object format have linkers with such optimizations.
Enable this option to optimization the unused input sections with the
linker by compiling with " -ffunction-sections -fdata-sections ", and
linking with " --gc-sections ".
endmenu # Build Setup endmenu # Build Setup
menu "System Type" menu "System Type"
+7
View File
@@ -98,6 +98,13 @@ ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti ARCHCXXFLAGS += -fno-rtti
endif endif
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Default toolchain # Default toolchain
CC = $(CROSSDEV)gcc CC = $(CROSSDEV)gcc
+7
View File
@@ -154,6 +154,13 @@ ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti ARCHCXXFLAGS += -fno-rtti
endif endif
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Add the builtin library # Add the builtin library
COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name) COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)
+7
View File
@@ -129,6 +129,13 @@ ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti ARCHCXXFLAGS += -fno-rtti
endif endif
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# NuttX buildroot under Linux or Cygwin # NuttX buildroot under Linux or Cygwin
ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),BUILDROOT) ifeq ($(CONFIG_ARMV7A_TOOLCHAIN),BUILDROOT)
+7
View File
@@ -209,6 +209,13 @@ ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti ARCHCXXFLAGS += -fno-rtti
endif endif
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Add the builtin library # Add the builtin library
COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name) COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)
+7
View File
@@ -121,6 +121,13 @@ ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti ARCHCXXFLAGS += -fno-rtti
endif endif
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Default toolchain # Default toolchain
CC = $(CROSSDEV)gcc CC = $(CROSSDEV)gcc
+7
View File
@@ -218,6 +218,13 @@ ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti ARCHCXXFLAGS += -fno-rtti
endif endif
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Add the builtin library # Add the builtin library
COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name) COMPILER_RT_LIB = $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)
-1
View File
@@ -86,7 +86,6 @@ INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)ble)
#INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)ble$(DELIM)include) #INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)ble$(DELIM)include)
#INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)osal$(DELIM)include) #INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)osal$(DELIM)include)
CFLAGS += -ffunction-sections
CFLAGS += -DCFG_CP CFLAGS += -DCFG_CP
CFLAGS += -DPHY_MCU_TYPE=MCU_BUMBEE_M0 CFLAGS += -DPHY_MCU_TYPE=MCU_BUMBEE_M0
CFLAGS += -DHOST_CONFIG=4 CFLAGS += -DHOST_CONFIG=4
+7
View File
@@ -277,6 +277,13 @@ NM = $(CROSSDEV)nm
OBJCOPY = $(CROSSDEV)objcopy OBJCOPY = $(CROSSDEV)objcopy
OBJDUMP = $(CROSSDEV)objdump OBJDUMP = $(CROSSDEV)objdump
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Add the builtin library # Add the builtin library
EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name)) EXTRA_LIBS += $(wildcard $(shell $(CC) $(ARCHCPUFLAGS) --print-libgcc-file-name))
-5
View File
@@ -119,11 +119,6 @@ CHIP_CSRCS += bl602_netdev.c
EXTRA_LIBPATHS += -L $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)$(WIRELESS_DRV_UNPACK)$(DELIM)libs$(DELIM)BL602$(DELIM)nuttx EXTRA_LIBPATHS += -L $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)$(WIRELESS_DRV_UNPACK)$(DELIM)libs$(DELIM)BL602$(DELIM)nuttx
EXTRA_LIBS += -lbl602_wifi -lbl602_wifi_manage -lblecontroller EXTRA_LIBS += -lbl602_wifi -lbl602_wifi_manage -lblecontroller
# Due to some Wi-Fi related libraries, the option is need to avoid linking too much
# unused functions.
LDFLAGS += --gc-sections
ifeq ($(CONFIG_BL602_WIRELESS_DEBUG),y) ifeq ($(CONFIG_BL602_WIRELESS_DEBUG),y)
LDFLAGS += -defsym _wifi_log_flag=1 LDFLAGS += -defsym _wifi_log_flag=1
endif endif
+7
View File
@@ -66,6 +66,13 @@ ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti ARCHCXXFLAGS += -fno-rtti
endif endif
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Generic GNU RVG toolchain # Generic GNU RVG toolchain
ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG) ifeq ($(CONFIG_RISCV_TOOLCHAIN),GNU_RVG)
-5
View File
@@ -221,11 +221,6 @@ INCLUDES += $(shell $(INCDIR) "$(CC)" $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)esp-wire
EXTRA_LIBPATHS += -L $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)esp-wireless-drivers-3rdparty$(DELIM)libs$(DELIM)esp32c3 EXTRA_LIBPATHS += -L $(ARCH_SRCDIR)$(DELIM)chip$(DELIM)esp-wireless-drivers-3rdparty$(DELIM)libs$(DELIM)esp32c3
EXTRA_LIBS += -lphy EXTRA_LIBS += -lphy
# Due to some Wi-Fi related libraries, the option is need to avoid linking too much
# unused functions.
LDFLAGS += --gc-sections
# Wireless interfaces. # Wireless interfaces.
CHIP_CSRCS += esp32c3_wireless.c CHIP_CSRCS += esp32c3_wireless.c
-5
View File
@@ -254,11 +254,6 @@ EXTRA_LIBS += -lbtdm_app
endif endif
endif endif
# Due to some Wi-Fi related libraries, the option is need to avoid linking too much
# unused functions.
LDFLAGS += --gc-sections
# Wireless interfaces. # Wireless interfaces.
CHIP_CSRCS += esp32_wireless.c CHIP_CSRCS += esp32_wireless.c
+7
View File
@@ -70,6 +70,13 @@ ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti ARCHCXXFLAGS += -fno-rtti
endif endif
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Default toolchain # Default toolchain
ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y) ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y)
CC = $(CROSSDEV)xcc CC = $(CROSSDEV)xcc
+7
View File
@@ -70,6 +70,13 @@ ifneq ($(CONFIG_CXX_RTTI),y)
ARCHCXXFLAGS += -fno-rtti ARCHCXXFLAGS += -fno-rtti
endif endif
# Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Default toolchain # Default toolchain
ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y) ifeq ($(CONFIG_XTENSA_TOOLCHAIN_XCC), y)
CC = $(CROSSDEV)xcc CC = $(CROSSDEV)xcc
+7 -2
View File
@@ -51,7 +51,7 @@ endif
ARCHSTDINCLUDES = ARCHSTDINCLUDES =
ARCHCPUFLAGS = -Dinterrupt="__attribute__((__interrupt__))" -ffreestanding ARCHCPUFLAGS = -Dinterrupt="__attribute__((__interrupt__))" -ffreestanding
ARCHCPUFLAGS += -ffunction-sections -fdata-sections -Wa,-march=ez80 ARCHCPUFLAGS += -Wa,-march=ez80
ARCHLIST = ARCHLIST =
ARCHWARNINGS = -Wall -Wextra -Wno-incompatible-library-redeclaration ARCHWARNINGS = -Wall -Wextra -Wno-incompatible-library-redeclaration
ARCHWARNINGS += -Wno-main-return-type -Wno-unused-parameter ARCHWARNINGS += -Wno-main-return-type -Wno-unused-parameter
@@ -64,7 +64,12 @@ ARCHASMINCLUDES = -include chip/clang-compat.asm
ARCHASMLIST = ARCHASMLIST =
ARCHASMWARNINGS = -W ARCHASMWARNINGS = -W
LDFLAGS += --gc-sections # Optimization of unused sections
ifeq ($(CONFIG_DEBUG_OPT_UNUSED_SECTIONS),y)
LDFLAGS += --gc-sections
MAXOPTIMIZATION += -ffunction-sections -fdata-sections
endif
# Tool names/paths. # Tool names/paths.
@@ -44,7 +44,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -mabi=aapcs -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common -mabi=aapcs
ARCHCXXFLAGS += -fno-common -std=c++11 ARCHCXXFLAGS += -fno-common -std=c++11
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -76,8 +76,6 @@ CXXELFFLAGS = $(CXXFLAGS)
LDELFFLAGS = -r -e main LDELFFLAGS = -r -e main
LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld) LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
LDFLAGS += --gc-sections
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
CFLAGS += -gdwarf-3 CFLAGS += -gdwarf-3
CXXFLAGS += -gdwarf-3 CXXFLAGS += -gdwarf-3
@@ -34,7 +34,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -61,8 +61,6 @@ CXXELFFLAGS = $(CXXFLAGS) -mlong-calls # --target1-abs
LDELFFLAGS = -r -e main LDELFFLAGS = -r -e main
LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld) LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
LDFLAGS += --gc-sections
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g LDFLAGS += -g
endif endif
@@ -42,7 +42,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -nostdinc++ ARCHCXXFLAGS += -fno-common -nostdinc++
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -77,8 +77,6 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g LDFLAGS += -g
endif endif
LDFLAGS += --gc-sections
ifeq ($(CONFIG_LC823450_SDIF_PATCH),y) ifeq ($(CONFIG_LC823450_SDIF_PATCH),y)
ARCH_LIBS += -lSdDr_patch_es2 ARCH_LIBS += -lSdDr_patch_es2
ARCH_LIBPATHS += -L"$(TOPDIR)/arch/arm/src/lc823450" ARCH_LIBPATHS += -L"$(TOPDIR)/arch/arm/src/lc823450"
+1 -3
View File
@@ -47,7 +47,7 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__ AFLAGS := $(CFLAGS) -D__ASSEMBLY__
CFLAGS += -ffunction-sections -fdata-sections CFLAGS +=
NXFLATLDFLAGS1 = -r -Wl,-d -Wl,-warn-common NXFLATLDFLAGS1 = -r -Wl,-d -Wl,-warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -Wl,-no-check-sections NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -Wl,-no-check-sections
@@ -56,5 +56,3 @@ LDNXFLATFLAGS = -e main -s 2048
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g LDFLAGS += -g
endif endif
LDFLAGS += --gc-sections
@@ -44,9 +44,9 @@ ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -ffunction-sections -fdata-sections -pipe CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -ffunction-sections -fdata-sections -pipe CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__ AFLAGS := $(CFLAGS) -D__ASSEMBLY__
@@ -60,7 +60,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
endif endif
# Provide map file needed by the "Memory Allocation" view in Eclipse: # Provide map file needed by the "Memory Allocation" view in Eclipse:
LDFLAGS += -Map=$(TOPDIR)/NuttX.map --gc-sections LDFLAGS += -Map=$(TOPDIR)/NuttX.map
# Embed absolute path to source file in debug information so that Eclipse # Embed absolute path to source file in debug information so that Eclipse
# source level debugging won't get confused. See: # source level debugging won't get confused. See:
@@ -44,9 +44,9 @@ ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -ffunction-sections -fdata-sections -pipe CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -ffunction-sections -fdata-sections -pipe CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__ AFLAGS := $(CFLAGS) -D__ASSEMBLY__
@@ -60,7 +60,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
endif endif
# Provide map file needed by the "Memory Allocation" view in Eclipse: # Provide map file needed by the "Memory Allocation" view in Eclipse:
LDFLAGS += -Map=$(TOPDIR)/NuttX.map --gc-sections LDFLAGS += -Map=$(TOPDIR)/NuttX.map
# Embed absolute path to source file in debug information so that Eclipse # Embed absolute path to source file in debug information so that Eclipse
# source level debugging won't get confused. See: # source level debugging won't get confused. See:
@@ -44,9 +44,9 @@ ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -ffunction-sections -fdata-sections -pipe CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -ffunction-sections -fdata-sections -pipe CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__ AFLAGS := $(CFLAGS) -D__ASSEMBLY__
@@ -60,7 +60,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
endif endif
# Provide map file needed by the "Memory Allocation" view in Eclipse: # Provide map file needed by the "Memory Allocation" view in Eclipse:
LDFLAGS += -Map=$(TOPDIR)/NuttX.map --gc-sections LDFLAGS += -Map=$(TOPDIR)/NuttX.map
# Embed absolute path to source file in debug information so that Eclipse # Embed absolute path to source file in debug information so that Eclipse
# source level debugging won't get confused. See: # source level debugging won't get confused. See:
@@ -44,9 +44,9 @@ ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -ffunction-sections -fdata-sections -pipe CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -ffunction-sections -fdata-sections -pipe CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__ AFLAGS := $(CFLAGS) -D__ASSEMBLY__
@@ -60,7 +60,7 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
endif endif
# Provide map file needed by the "Memory Allocation" view in Eclipse: # Provide map file needed by the "Memory Allocation" view in Eclipse:
LDFLAGS += -Map=$(TOPDIR)/NuttX.map --gc-sections LDFLAGS += -Map=$(TOPDIR)/NuttX.map
# Embed absolute path to source file in debug information so that Eclipse # Embed absolute path to source file in debug information so that Eclipse
# source level debugging won't get confused. See: # source level debugging won't get confused. See:
+2 -4
View File
@@ -43,8 +43,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
@@ -64,8 +64,6 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g LDFLAGS += -g
endif endif
LDFLAGS += --gc-sections
ifeq ($(CONFIG_DFU_BINARY),y) ifeq ($(CONFIG_DFU_BINARY),y)
define FLASH define FLASH
@@ -44,7 +44,7 @@ ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -ffunction-sections -fdata-sections -pipe CFLAGS := $(ARCHCFLAGS) $(ARCHWARNINGS) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS) CPICFLAGS = $(ARCHPICFLAGS) $(CFLAGS)
CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe CXXFLAGS := $(ARCHCXXFLAGS) $(ARCHWARNINGSXX) $(ARCHOPTIMIZATION) $(ARCHCPUFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) -pipe
CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS) CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
@@ -55,8 +55,6 @@ NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048 LDNXFLATFLAGS = -e main -s 2048
LDFLAGS += --gc-sections
ifeq ($(CONFIG_DEBUG_SYMBOLS),y) ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
LDFLAGS += -g LDFLAGS += -g
endif endif
@@ -34,8 +34,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -61,8 +61,6 @@ NXFLATLDFLAGS1 = -r -d -warn-common
NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections NXFLATLDFLAGS2 = $(NXFLATLDFLAGS1) -T$(TOPDIR)/binfmt/libnxflat/gnu-nxflat-pcrel.ld -no-check-sections
LDNXFLATFLAGS = -e main -s 2048 LDNXFLATFLAGS = -e main -s 2048
LDFLAGS += --gc-sections
# Loadable module definitions # Loadable module definitions
CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs CMODULEFLAGS = $(CFLAGS) -mlong-calls # --target1-abs
@@ -78,7 +78,7 @@ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__ AFLAGS := $(CFLAGS) -D__ASSEMBLY__
ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32),y) ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32),y)
LDFLAGS = -nostdlib --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0 --gc-sections LDFLAGS = -nostdlib --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0
else else
LDFLAGS = # -no-isn32 --relax LDFLAGS = # -no-isn32 --relax
endif endif
@@ -78,7 +78,7 @@ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__ AFLAGS := $(CFLAGS) -D__ASSEMBLY__
ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32),y) ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32),y)
LDFLAGS = -nostdlib --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0 --gc-sections LDFLAGS = -nostdlib --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0
else else
LDFLAGS = # -no-isn32 --relax LDFLAGS = # -no-isn32 --relax
endif endif
@@ -78,7 +78,7 @@ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS := $(CFLAGS) -D__ASSEMBLY__ AFLAGS := $(CFLAGS) -D__ASSEMBLY__
ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32),y) ifeq ($(CONFIG_MIPS32_TOOLCHAIN_MICROCHIPL_XC32),y)
LDFLAGS = -nostdlib --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0 --gc-sections LDFLAGS = -nostdlib --defsym=__MPLAB_BUILD=1 --defsym=__MPLAB_DEBUG=1 --defsym=__DEBUG=1 --defsym=__MPLAB_DEBUGGER_PK3=1 --defsym=_min_heap_size=0
else else
LDFLAGS = # -no-isn32 --relax LDFLAGS = # -no-isn32 --relax
endif endif
@@ -34,15 +34,13 @@ ifeq ($(CONFIG_DEBUG_SYMBOLS),y)
ASARCHCPUFLAGS += -Wa,-g ASARCHCPUFLAGS += -Wa,-g
endif endif
MAXOPTIMIZATION = -Os
ifneq ($(CONFIG_DEBUG_NOOPT),y) ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCPUFLAGS += -mno-relax ARCHCPUFLAGS += -mno-relax
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections -std=c++17 -pipe ARCHCXXFLAGS += -fno-common -std=c++17 -pipe
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10 ARCHPICFLAGS = -fpic -msingle-pic-base -mpic-register=r10
@@ -68,6 +66,6 @@ CXXELFFLAGS = $(CXXFLAGS)
LDELFFLAGS = -melf32lriscv -r -e main LDELFFLAGS = -melf32lriscv -r -e main
LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld) LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.ld)
LDFLAGS += --gc-sections -melf32lriscv --cref LDFLAGS += -melf32lriscv --cref
LDFLAGS += -Map=$(TOPDIR)/nuttx.map LDFLAGS += -Map=$(TOPDIR)/nuttx.map
@@ -48,7 +48,7 @@ endif
ARCHCPUFLAGS += -mcmodel=medany ARCHCPUFLAGS += -mcmodel=medany
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -77,4 +77,4 @@ LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.
# File extensions # File extensions
LDFLAGS += --gc-sections -melf64lriscv LDFLAGS += -melf64lriscv
@@ -41,8 +41,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections -msmall-data-limit=0 ARCHCFLAGS += -fno-common -msmall-data-limit=0
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections -msmall-data-limit=0 -std=c++17 ARCHCXXFLAGS += -fno-common -msmall-data-limit=0 -std=c++17
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic ARCHPICFLAGS = -fpic
@@ -70,4 +70,4 @@ LDELFFLAGS = -melf32lriscv -r -e main
LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)binfmt$(DELIM)libelf$(DELIM)gnu-elf.ld) LDELFFLAGS += -T $(call CONVERT_PATH,$(TOPDIR)$(DELIM)binfmt$(DELIM)libelf$(DELIM)gnu-elf.ld)
LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref LDFLAGS += -Map=$(call CONVERT_PATH,$(TOPDIR)/nuttx.map) --cref
LDFLAGS += --gc-sections -melf32lriscv LDFLAGS += -melf32lriscv
@@ -41,7 +41,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -54,4 +54,4 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__ $(ASARCHCPUFLAGS) AFLAGS += $(CFLAGS) -D__ASSEMBLY__ $(ASARCHCPUFLAGS)
LDFLAGS += --gc-sections -melf32lriscv LDFLAGS += -melf32lriscv
@@ -38,7 +38,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
endif endif
ARCHCPUFLAGS += -mcmodel=medany -mstrict-align ARCHCPUFLAGS += -mcmodel=medany -mstrict-align
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -67,4 +67,4 @@ LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.
# File extensions # File extensions
LDFLAGS += --gc-sections -melf64lriscv LDFLAGS += -melf64lriscv
@@ -37,7 +37,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -50,4 +50,4 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__ $(ASARCHCPUFLAGS) AFLAGS += $(CFLAGS) -D__ASSEMBLY__ $(ASARCHCPUFLAGS)
LDFLAGS += --gc-sections -melf32lriscv LDFLAGS += -melf32lriscv
+2 -2
View File
@@ -63,7 +63,7 @@ endif
ARCHCPUFLAGS += -mcmodel=medany ARCHCPUFLAGS += -mcmodel=medany
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -92,4 +92,4 @@ LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.
# File extensions # File extensions
LDFLAGS += --gc-sections -melf64lriscv LDFLAGS += -melf64lriscv
@@ -48,7 +48,7 @@ endif
ARCHCPUFLAGS += -mcmodel=medany ARCHCPUFLAGS += -mcmodel=medany
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -77,4 +77,4 @@ LDELFFLAGS += -T $(call CONVERT_PATH,$(BOARD_DIR)$(DELIM)scripts$(DELIM)gnu-elf.
# File extensions # File extensions
LDFLAGS += --gc-sections -melf64lriscv LDFLAGS += -melf64lriscv
@@ -40,7 +40,7 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
endif endif
ARCHCPUFLAGS += -mcmodel=medany ARCHCPUFLAGS += -mcmodel=medany
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -54,7 +54,7 @@ CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__ $(ASARCHCPUFLAGS) AFLAGS += $(CFLAGS) -D__ASSEMBLY__ $(ASARCHCPUFLAGS)
ifeq ($(CONFIG_ARCH_RV32),y) ifeq ($(CONFIG_ARCH_RV32),y)
LDFLAGS += --gc-sections -melf32lriscv LDFLAGS += -melf32lriscv
else else
LDFLAGS += --gc-sections -melf64lriscv LDFLAGS += -melf64lriscv
endif endif
@@ -53,7 +53,7 @@ ifeq ($(CONFIG_RV32M1_OPENISA_TOOLCHAIN),y)
endif endif
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common ARCHCXXFLAGS += -fno-common
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
@@ -66,4 +66,4 @@ CXXPICFLAGS = $(ARCHPICFLAGS) $(CXXFLAGS)
CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS)
AFLAGS += $(CFLAGS) -D__ASSEMBLY__ $(ASARCHCPUFLAGS) AFLAGS += $(CFLAGS) -D__ASSEMBLY__ $(ASARCHCPUFLAGS)
LDFLAGS += --gc-sections -melf32lriscv LDFLAGS += -melf32lriscv
@@ -65,8 +65,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections -std=c++17 ARCHCXXFLAGS += -fno-common -std=c++17
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic ARCHPICFLAGS = -fpic
@@ -65,8 +65,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections -std=c++17 ARCHCXXFLAGS += -fno-common -std=c++17
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic ARCHPICFLAGS = -fpic
@@ -65,8 +65,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections -std=c++17 ARCHCXXFLAGS += -fno-common -std=c++17
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic ARCHPICFLAGS = -fpic
@@ -65,8 +65,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections -std=c++17 ARCHCXXFLAGS += -fno-common -std=c++17
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic ARCHPICFLAGS = -fpic
@@ -46,8 +46,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections -std=c++17 ARCHCXXFLAGS += -fno-common -std=c++17
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic ARCHPICFLAGS = -fpic
@@ -36,8 +36,8 @@ ifneq ($(CONFIG_DEBUG_NOOPT),y)
ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce ARCHOPTIMIZATION += $(MAXOPTIMIZATION) -fno-strict-aliasing -fno-strength-reduce
endif endif
ARCHCFLAGS += -fno-common -ffunction-sections -fdata-sections ARCHCFLAGS += -fno-common
ARCHCXXFLAGS += -fno-common -ffunction-sections -fdata-sections -std=c++17 ARCHCXXFLAGS += -fno-common -std=c++17
ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef ARCHWARNINGS = -Wall -Wstrict-prototypes -Wshadow -Wundef
ARCHWARNINGSXX = -Wall -Wshadow -Wundef ARCHWARNINGSXX = -Wall -Wshadow -Wundef
ARCHPICFLAGS = -fpic ARCHPICFLAGS = -fpic