]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Fix regression over 1.5.26 with ccache $CC -all-static.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 22 Apr 2008 19:43:06 +0000 (21:43 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Tue, 22 Apr 2008 19:43:06 +0000 (21:43 +0200)
* 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 <Ralf.Wildenhues@gmx.de>
ChangeLog
THANKS
libltdl/config/ltmain.m4sh
tests/static.at

index 2beeb45a003319bc260a2916d1a0d03fe648b199..d5d41b8f77f2587d3eb3f8d35415e7624b19e7cf 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-04-22  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       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 <schwab@suse.de>
            Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
diff --git a/THANKS b/THANKS
index 808cef018213933f6ed13176b7dc6d570ee048cf..c6726c6b1243a1c02703039f9c41024412656606 100644 (file)
--- a/THANKS
+++ b/THANKS
   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
index ff1e50d5619df9152c60deb9f740f2909b554e9e..ac334dc1af3c6a37afb410c449fbcf857c22be0e 100644 (file)
@@ -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
        ;;
 
index 74b1c63426f4e942b7df0e06345d0b0dd6f2b5fc..1a51d0d04e446d92a922edeef3a7ee98769aca85 100644 (file)
@@ -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