diff options
| -rw-r--r-- | ChangeLog | 6 | ||||
| -rw-r--r-- | configure.in | 26 | 
2 files changed, 32 insertions, 0 deletions
@@ -1,5 +1,11 @@  2007-07-24  Richard Hughes  <richard@hughsie.com> +	* configure.in: +	Check for -Wl,--gc-sections so we can really reduce the size of the +	setuid binary. + +2007-07-24  Richard Hughes  <richard@hughsie.com> +  	* bus/activation.c: (handle_activation_exit_error),  	(babysitter_watch_callback):  	Map the child exit status integer to a proper dbus error. diff --git a/configure.in b/configure.in index 877bc0a7..cf0d8ecf 100644 --- a/configure.in +++ b/configure.in @@ -243,6 +243,32 @@ else    fi  fi +# Check for -Wl,--gc-sections +AC_MSG_CHECKING([for ld that supports "-Wl,--gc-sections"]) +AC_TRY_LINK([ +  int one(void) { return 1; } +  int two(void) { return 2; } +  ], [ two(); ] , [ac_gcsections=yes], [ac_gcsections=no]) + +if test "$ac_gcsections" = "yes"; then +  rm -f conftest.c +  touch conftest.c +  if $CC -c conftest.c; then +    if $LD --gc-sections -o conftest conftest.o 2>&1 | \ +      grep "Warning: gc-sections option ignored" > /dev/null; then +      ac_gcsections=no +    fi +  fi +  rm -f conftest.c conftest.o conftest +fi +if test "$ac_gcsections" = "yes"; then +  SECTION_LDFLAGS="-Wl,--gc-sections $SECTION_LDFLAGS" +  CFLAGS="-ffunction-sections -fdata-sections $CFLAGS" +fi +AC_SUBST(SECTION_FLAGS) +AC_SUBST(SECTION_LDFLAGS) +AC_MSG_RESULT($ac_gcsections) +  # Add -D_POSIX_PTHREAD_SEMANTICS if on Solaris  #  case $target_os in  | 
