summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary V. Vaughan <gary@gnu.org>2014-01-02 12:13:13 +1300
committerGary V. Vaughan <gary@gnu.org>2014-01-02 12:26:44 +1300
commita4ffcdb5e0f207656bb2584b1c4e1702a6d7fa32 (patch)
treeec337933b8fcf5e90f898f576cec1447a6f72ff8
parentd695e72b7467c4bac13d631d36532488372da406 (diff)
downloadlibtool-a4ffcdb5e0f207656bb2584b1c4e1702a6d7fa32.tar.gz
libtool: only strip -Wl when linking with $LD.v2.4.2.444
* 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>
-rw-r--r--build-aux/ltmain.in14
1 files changed, 8 insertions, 6 deletions
diff --git a/build-aux/ltmain.in b/build-aux/ltmain.in
index 69878b00..b7c85e2f 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"