From: Gary V. Vaughan Date: Wed, 1 Jan 2014 23:13:13 +0000 (+1300) Subject: libtool: only strip -Wl when linking with $LD. X-Git-Tag: v2.4.2.444^0 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a4ffcdb5e0f207656bb2584b1c4e1702a6d7fa32;p=thirdparty%2Flibtool.git libtool: only strip -Wl when linking with $LD. * 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 --- diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in index 69878b007..b7c85e2fc 100644 --- a/build-aux/ltmain.in +++ b/build-aux/ltmain.in @@ -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"