From aef8bab9d71d85dcb6d99ff70078be3f2bdfbf61 Mon Sep 17 00:00:00 2001 From: Andre Heider Date: Fri, 3 Feb 2023 13:15:43 +0100 Subject: build: add a config knob to enable gc-sections for all packages This enables the linker's garbage collection for all packages which haven't opted-out. Signed-off-by: Andre Heider --- include/package.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/package.mk') diff --git a/include/package.mk b/include/package.mk index 0fb947f035..687f74edc1 100644 --- a/include/package.mk +++ b/include/package.mk @@ -51,7 +51,7 @@ ifdef CONFIG_USE_MIPS16 TARGET_CXXFLAGS += -mips16 -minterlink-mips16 endif endif -ifeq ($(call pkg_build_flag,gc-sections,0),1) +ifeq ($(call pkg_build_flag,gc-sections,$(if $(CONFIG_USE_GC_SECTIONS),1,0)),1) TARGET_CFLAGS+= -ffunction-sections -fdata-sections TARGET_CXXFLAGS+= -ffunction-sections -fdata-sections TARGET_LDFLAGS+= -Wl,--gc-sections -- cgit v1.2.3