From: Ralf Wildenhues Date: Tue, 22 Apr 2008 19:43:06 +0000 (+0200) Subject: Fix regression over 1.5.26 with ccache $CC -all-static. X-Git-Tag: v2.2.4~16 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c3ae35db6bbd9ce82bc5479354d99f53c46e888;p=thirdparty%2Flibtool.git Fix regression over 1.5.26 with ccache $CC -all-static. * libltdl/config/ltmain.m4sh (func_mode_link): Add $link_static_flag to compile_command and link_command only later, instead of right after a possible compiler wrapper. * tests/static.at (ccache -all-static): New test. * THANKS: Update. Report by Richard Purdie. Signed-off-by: Ralf Wildenhues --- diff --git a/ChangeLog b/ChangeLog index 2beeb45a0..d5d41b8f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-04-22 Ralf Wildenhues + + Fix regression over 1.5.26 with ccache $CC -all-static. + * libltdl/config/ltmain.m4sh (func_mode_link): Add + $link_static_flag to compile_command and link_command only + later, instead of right after a possible compiler wrapper. + * tests/static.at (ccache -all-static): New test. + * THANKS: Update. + Report by Richard Purdie. + 2008-04-22 Andreas Schwab Ralf Wildenhues diff --git a/THANKS b/THANKS index 808cef018..c6726c6b1 100644 --- a/THANKS +++ b/THANKS @@ -119,6 +119,7 @@ Rainer Orth ro@TechFak.Uni-Bielefeld.DE Rainer Tammer tammer@tammer.net Ralf Menzel menzel@ls6.cs.uni-dortmund.de + Richard Purdie rpurdie@rpsys.net Robert Ögren lists@roboros.com Roberto Bagnara bagnara@cs.unipr.it Roland Mainz roland.mainz@nrubsig.org diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh index ff1e50d56..ac334dc1a 100644 --- a/libltdl/config/ltmain.m4sh +++ b/libltdl/config/ltmain.m4sh @@ -3160,9 +3160,6 @@ func_mode_link () fi if test -n "$link_static_flag"; then dlopen_self=$dlopen_self_static - # See comment for -static flag below, for more details. - func_append compile_command " $link_static_flag" - func_append finalize_command " $link_static_flag" fi prefer_static_libs=yes ;; @@ -3450,7 +3447,11 @@ func_mode_link () case $arg in -all-static) - # The effects of -all-static are defined in a previous loop. + if test -n "$link_static_flag"; then + # See comment for -static flag below, for more details. + func_append compile_command " $link_static_flag" + func_append finalize_command " $link_static_flag" + fi continue ;; diff --git a/tests/static.at b/tests/static.at index 74b1c6342..1a51d0d04 100644 --- a/tests/static.at +++ b/tests/static.at @@ -352,3 +352,26 @@ for withdep in no yes; do done AT_CLEANUP + + +AT_SETUP([ccache -all-static]) + +AT_DATA([ccache], +[[#! /bin/sh +# poor man's ccache clone +case $1 in +-*) echo "bogus argument: $1" >&2; exit 1 ;; +esac +exec "$@" +]]) +chmod +x ./ccache + +AT_DATA([a.c], +[[int main(void) { return 0; } +]]) + +AT_CHECK([$CC $CPPFLAGS $CFLAGS -c a.c], [], [ignore]) +AT_CHECK([$LIBTOOL --mode=link --tag=CC ./ccache $CC $CFLAGS $LDFLAGS -all-static a.$OBJEXT -o a], + [], [ignore]) + +AT_CLEANUP