aboutsummaryrefslogtreecommitdiffstats
path: root/include/package.mk
diff options
context:
space:
mode:
authorAndre Heider <a.heider@gmail.com>2023-02-03 13:15:43 +0100
committerChristian Marangi <ansuelsmth@gmail.com>2023-03-21 18:28:23 +0100
commitaef8bab9d71d85dcb6d99ff70078be3f2bdfbf61 (patch)
tree8579f2e4d0d4829c9670e390ba63a48deb3ffcb5 /include/package.mk
parent07730ff3465d3cede3026cdd1c17453930f055ce (diff)
downloadupstream-aef8bab9d71d85dcb6d99ff70078be3f2bdfbf61.tar.gz
upstream-aef8bab9d71d85dcb6d99ff70078be3f2bdfbf61.tar.bz2
upstream-aef8bab9d71d85dcb6d99ff70078be3f2bdfbf61.zip
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 <a.heider@gmail.com>
Diffstat (limited to 'include/package.mk')
-rw-r--r--include/package.mk2
1 files changed, 1 insertions, 1 deletions
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