From f09c62954e2f585026ca0f09d199eee3644a5c1a Mon Sep 17 00:00:00 2001 From: Waldemar Brodkorb Date: Wed, 28 May 2014 17:56:26 +0200 Subject: allow to choose ld garbage collector --- mk/vars.mk | 6 ++++++ target/config/Config.in.toolchain | 5 +++++ 2 files changed, 11 insertions(+) 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 -- cgit v1.2.3