From 2bbc798dc1dcb3bc96110794b17a7dd65f354f3e Mon Sep 17 00:00:00 2001 From: Laurent Bercot Date: Mon, 26 Oct 2015 11:52:42 +0000 Subject: Separate sections for smaller static binaries (thanks Denys Vlasenko) --- configure | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/configure b/configure index 3ddb7e5..dabd7ef 100755 --- a/configure +++ b/configure @@ -297,6 +297,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 @@ -310,10 +315,12 @@ 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 + if test -z "$vpaths" ; then while read dep ; do base=$(basename $dep) ; -- cgit v1.2.3