]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
libtool: only strip -Wl when linking with $LD. v2.4.2.444
authorGary V. Vaughan <gary@gnu.org>
Wed, 1 Jan 2014 23:13:13 +0000 (12:13 +1300)
committerGary V. Vaughan <gary@gnu.org>
Wed, 1 Jan 2014 23:26:44 +0000 (12:26 +1300)
* build-aux/ltmain.in (func_mode_link): Don't strip -Wl from the
linker flags, except when linking with $LD, otherwise compiler
drivers that don't recognize and pass linker flags through will
choke on unrecognized options.

Signed-off-by: Gary V. Vaughan <gary@gnu.org>
build-aux/ltmain.in

index 69878b0075fa0e3407fe2e2945905091f630dda9..b7c85e2fce23f34528941650afe195cccef01423 100644 (file)
@@ -8088,15 +8088,17 @@ EOF
       # the extraction.
       reload_conv_objs=
       gentop=
-      # reload_cmds runs $LD directly, so let us get rid of
-      # -Wl from whole_archive_flag_spec and hope we can get by with
-      # turning comma into space..
-      wl=
-
+      # if reload_cmds runs $LD directly, get rid of -Wl from
+      # whole_archive_flag_spec and hope we can get by with turning comma
+      # into space.
+      case $reload_cmds in
+        *\$LD\ *) wl= ;;
+      esac
       if test -n "$convenience"; then
        if test -n "$whole_archive_flag_spec"; then
          eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
-         reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+         test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+         reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
        else
          gentop=$output_objdir/${obj}x
          func_append generated " $gentop"