diff options
-rw-r--r-- | mk/vars.mk | 6 | ||||
-rw-r--r-- | target/config/Config.in.toolchain | 5 |
2 files changed, 11 insertions, 0 deletions
diff --git a/mk/vars.mk b/mk/vars.mk index ef87acb79..7179eb145 100644 --- a/mk/vars.mk +++ b/mk/vars.mk @@ -124,6 +124,12 @@ TARGET_CFLAGS+= -fPIE TARGET_CXXFLAGS+= -fPIE endif +ifneq ($(ADK_TARGET_USE_LD_GC),) +TARGET_CFLAGS+= -fdata-sections -ffunction-sections +TARGET_CXXFLAGS+= -fdata-sections -ffunction-sections +TARGET_LDFLAGS+= -Wl,--gc-sections +endif + ifneq ($(ADK_TARGET_USE_LTO),) TARGET_CFLAGS+= -flto TARGET_CXXFLAGS+= -flto diff --git a/target/config/Config.in.toolchain b/target/config/Config.in.toolchain index 760317429..e25152a49 100644 --- a/target/config/Config.in.toolchain +++ b/target/config/Config.in.toolchain @@ -67,6 +67,11 @@ config ADK_TARGET_USE_LTO select ADK_TOOLCHAIN_WITH_LTO default n +config ADK_TARGET_USE_LD_GC + prompt "Use LD garbage collection for all packages" + boolean + default n + config ADK_TOOLCHAIN_WITH_GOLD boolean default n |