From: Richard Hughes Date: Tue, 24 Jul 2007 12:31:01 +0000 (+0000) Subject: 2007-07-24 Richard Hughes X-Git-Tag: dbus-1.1.2~11 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=13c56943b6a7730079680df95f8d04be2f6bb53a;p=platform%2Fupstream%2Fdbus.git 2007-07-24 Richard Hughes * configure.in: Check for -Wl,--gc-sections so we can really reduce the size of the setuid binary. --- diff --git a/ChangeLog b/ChangeLog index 006d334..05369c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2007-07-24 Richard Hughes + * configure.in: + Check for -Wl,--gc-sections so we can really reduce the size of the + setuid binary. + +2007-07-24 Richard Hughes + * 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 877bc0a..cf0d8ec 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