summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorWaldemar Brodkorb <wbx@openadk.org>2014-05-28 17:56:26 +0200
committerWaldemar Brodkorb <wbx@openadk.org>2014-05-28 17:56:42 +0200
commitf09c62954e2f585026ca0f09d199eee3644a5c1a (patch)
tree92e2414f066bc99ff8de11aae6e818bd316553de /mk
parent9fd20ed0d2e2ec895f4b6987ab610968bd9a93e3 (diff)
allow to choose ld garbage collector
Diffstat (limited to 'mk')
-rw-r--r--mk/vars.mk6
1 files changed, 6 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