summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Bercot <ska-skaware@skarnet.org>2015-10-26 11:52:54 +0000
committerLaurent Bercot <ska-skaware@skarnet.org>2015-10-26 11:52:54 +0000
commitd8396a4b4faebac030b319daf9edf139c4ecf40d (patch)
tree9abb351d4f84fb051945cf9de7bbb69bdf2faba1
parenta473c57dd8bc283a3946d852eef3403689727fa9 (diff)
downloads6-rc-d8396a4b4faebac030b319daf9edf139c4ecf40d.tar.xz
Separate sections for smaller static binaries (thanks Denys Vlasenko)
-rwxr-xr-xconfigure6
1 files changed, 6 insertions, 0 deletions
diff --git a/configure b/configure
index a9f2ca3..6bac06a 100755
--- a/configure
+++ b/configure
@@ -300,6 +300,11 @@ tryflag CPPFLAGS_AUTO -Werror=implicit-function-declaration
tryflag CPPFLAGS_AUTO -Werror=implicit-int
tryflag CPPFLAGS_AUTO -Werror=pointer-sign
tryflag CPPFLAGS_AUTO -Werror=pointer-arith
+tryflag CFLAGS_AUTO -ffunction-sections
+tryflag CFLAGS_AUTO -fdata-sections
+
+tryldflag LDFLAGS_AUTO -Wl,--sort-section=alignment
+tryldflag LDFLAGS_AUTO -Wl,--sort-common
if $evenmorestatic ; then
LDFLAGS_NOSHARED=-static
@@ -313,6 +318,7 @@ LDFLAGS_SHARED="${LDFLAGS_SHARED}${addlibdpath}"
if $allstatic ; then
LDFLAGS_NOSHARED="${LDFLAGS_NOSHARED}${addlibspath}"
+ tryldflag LDFLAGS_NOSHARED -Wl,--gc-sections
else
LDFLAGS_NOSHARED="${LDFLAGS_NOSHARED}${addlibdpath}"
fi