]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
Fix flags test failure when ld is used as linker.
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 19 Jun 2010 19:07:50 +0000 (21:07 +0200)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sun, 20 Jun 2010 17:11:37 +0000 (19:11 +0200)
* tests/flags.at (passing CC flags through libtool): When $LD
is used for linking libraries, ensure flags passed with `-Wc,'
are not passed through to $LD, but flags passed with `-Wl,' use
$wl when linking programs.  Fixed testsuite failure on HP-UX
10.20.

Signed-off-by: Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
ChangeLog
tests/flags.at

index 17a140675f0ef5a2268922fbc8c2997eb5f42d5d..b79fb9995e6f51cc95d7f406d437b6256c3f32f5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2010-06-20  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
+
+       Fix flags test failure when ld is used as linker.
+       * tests/flags.at (passing CC flags through libtool): When $LD
+       is used for linking libraries, ensure flags passed with `-Wc,'
+       are not passed through to $LD, but flags passed with `-Wl,' use
+       $wl when linking programs.  Fixed testsuite failure on HP-UX
+       10.20.
+
 2010-06-19  Charles Wilson  <libtool@cwilson.fastmail.fm>
 
        [cygwin] Fix segfault in C++ exception handling test
index 7f600be170075b34d4456b5466174950592ad750..f865757d44fc82dbebcc9f4f050c482e745ab1df 100644 (file)
@@ -73,8 +73,8 @@ AT_CHECK([$LIBTOOL --tag=lt_tag --mode=compile $compile -c $source],
 # Linker flags are prefixed with ${wl} iff they are passed to the
 # compiler driver, instead of directly to the linker.
 case $archive_cmds in
-*\$LD*\$linker_flags*) maybe_wl= ;;
-*) maybe_wl=$wl ;;
+*\$LD*\$linker_flags*) maybe_wl= compiler_flags_in_liblink=false ;;
+*) maybe_wl=$wl compiler_flags_in_liblink=: ;;
 esac
 
 for flag in -Wc, -Wl, '-Xcompiler ' '-Xlinker '; do
@@ -83,19 +83,32 @@ for flag in -Wc, -Wl, '-Xcompiler ' '-Xlinker '; do
     AT_CHECK([$LIBTOOL -n --tag=lt_tag --mode=compile $compile ]dnl
             [$flag-foo -c $source], [], [stdout], [ignore])
     AT_CHECK([$FGREP " -foo" stdout], [], [ignore])
-    flag_prefix=
+    flag_prefix_prog=
+    flag_prefix_lib=
+    flags_in_liblink=$compiler_flags_in_liblink
     ;;
   -Wl, | -Xlinker\ )
-    flag_prefix=$maybe_wl
+    flag_prefix_prog=$wl
+    flag_prefix_lib=$maybe_wl
+    flags_in_liblink=:
     ;;
   esac
 
-  eval set program$EXEEXT "$library_and_module"
+  AT_CHECK([$LIBTOOL -n --tag=lt_tag --mode=link $link ]dnl
+          [-o program$EXEEXT a.lo $flag-foo], [], [stdout], [ignore])
+  AT_CHECK([$FGREP " $flag_prefix_prog-foo" stdout], [], [ignore])
+
+  eval set x "$library_and_module"
   for output
   do
+    test x = "$output" && continue
     AT_CHECK([$LIBTOOL -n --tag=lt_tag --mode=link $link ]dnl
             [-o $output a.lo -rpath /nowhere $flag-foo], [], [stdout], [ignore])
-    AT_CHECK([$FGREP " $flag_prefix-foo" stdout], [], [ignore])
+    if $flags_in_liblink; then
+      AT_CHECK([$FGREP " $flag_prefix_lib-foo" stdout], [], [ignore])
+    else
+      AT_CHECK([$FGREP " $flag_prefix_lib-foo" stdout], [1])
+    fi
   done
 done