libtool-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make -Wc,foo behave like -Xcompiler foo in link mode.


From: Peter Rosin
Subject: Re: Make -Wc,foo behave like -Xcompiler foo in link mode.
Date: Fri, 04 Sep 2009 22:31:14 +0200
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Hi Ralf,

Den 2009-09-04 19:44 skrev Ralf Wildenhues:
Hello Peter,

* Peter Rosin wrote on Fri, Sep 04, 2009 at 12:38:48PM CEST:
        Make -Wc,foo behave like -Xcompiler foo in link mode.
        * libltdl/config/ltmain.m4sh (func_mode_link): Remove "-Wc,"
        instead of replacing it with "$wl".

This patch is ok, but please state clearly that this affects linking
of programs only, not linking of libraries, and restores consistency
of the former with respect to the latter (not sure if this is a
regression).  Also, it needs a NEWS entry.

Ok, added more words and a NEWS entry. And the bug has been there since
the feature was added back in -99, if I read the history right...

Further, the patch needs a testsuite addition, but I can do that later
if you don't want to.  I was thinking of a new set of tests flags.at and
running a bunch of
  libtool -n --mode=X ... $flag-foo

for $flag in -Wl, -Wc, '-Xcompiler ' and '-Xlinker ', both library and
program output, and grepping the output for ${wl}-foo and similar (I
don't remember whether that was general enough for all compilers, you
know w32 better).

Sigh, tests. I'd rather not, sorry. Maybe later, I hope someone
beats me to it though...

If the test is going to be good enough on w32 I don't know. For gcc
it should behave just as on any unix, so what's left is my msvc branch
where -Wl, isn't supported ATM so I really can't say if the test has
to be tweaked when/if I add that.

Ok to commit this?

2009-09-04  Peter Rosin  <address@hidden>

        Make -Wc,FLAG behave like -Xcompiler FLAG in link mode.
        * libltdl/config/ltmain.m4sh (func_mode_link): Remove "-Wc,"
        instead of replacing it with "$wl" when linking programs
        through the compiler driver, just as is the case when linking
        libraries.
        * NEWS: Update.


Cheers,
Peter
diff --git a/NEWS b/NEWS
index 15ed32b..d6a35aa 100644
--- a/NEWS
+++ b/NEWS
@@ -43,6 +43,9 @@ New in 2.2.8 2009-??-??: git version 2.2.7a, Libtool team:
     extraction of convenience archives with a lock.
   - The Libtool macro files do not contain instances of __oline__ any more,
     easing merges for configure scripts that are added to version control.
+  - Fix ancient bug where "-Wc," was turned into "$wl" (typically "-Wl,")
+    when using the compiler driver to link programs. Now "-Wc," is stripped
+    just as it is when linking libraries through the compiler driver.
 
 * Miscellaneous changes:
 
diff --git a/libltdl/config/ltmain.m4sh b/libltdl/config/ltmain.m4sh
index 9e4cfdb..4633ff2 100644
--- a/libltdl/config/ltmain.m4sh
+++ b/libltdl/config/ltmain.m4sh
@@ -4299,7 +4299,7 @@ func_mode_link ()
        for flag in $args; do
          IFS="$save_ifs"
           func_quote_for_eval "$flag"
-         arg="$arg $wl$func_quote_for_eval_result"
+         arg="$arg $func_quote_for_eval_result"
          compiler_flags="$compiler_flags $func_quote_for_eval_result"
        done
        IFS="$save_ifs"

reply via email to

[Prev in Thread] Current Thread [Next in Thread]