From 2cdda224e882b3df50b64ab8a77f84dad7b72fe6 Mon Sep 17 00:00:00 2001 From: Owen Shepherd Date: Sun, 1 Sep 2013 23:12:01 +0100 Subject: [PATCH] Use the GCC ability to place each function/piece of data in its' own section, and LD's ability to garbage collect unused sections, to produce smaller binaries --- Jamrules | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Jamrules b/Jamrules index cf84e69..d04c45d 100644 --- a/Jamrules +++ b/Jamrules @@ -48,6 +48,8 @@ if $(PDCLIB_TOOLCHAIN) = "gcc" { #-nostdinc -std=c11 -g + -ffunction-sections + -fdata-sections -D_PDCLIB_BUILD $(PDCLIB_WARNINGS) ; PDCLIB_C++FLAGS = @@ -55,6 +57,8 @@ if $(PDCLIB_TOOLCHAIN) = "gcc" { #-nostdinc -std=c++11 -g + -ffunction-sections + -fdata-sections -D_PDCLIB_BUILD $(PDCLIB_WARNINGS) ; @@ -67,6 +71,7 @@ if $(PDCLIB_TOOLCHAIN) = "gcc" { # $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) $(NEEDLIBS) $(LINKLIBS) #} } else { + PDCLIB_TEST_LINKFLAGS += -Wl,--gc-sections ; actions Link bind NEEDLIBS { $(LINK) $(LINKFLAGS) -o $(<) $(UNDEFS) $(>) -Wl,--start-group $(NEEDLIBS) $(LINKLIBS) -Wl,--end-group -- 2.40.0