[ let's continue this discussion on libtool-patches, please ]

Hello Liviu, Vishal,

Could you please try this patch (written for both CVS HEAD and
branch-1-5), and post the --debug link output with the changed
libtool script?  Thank you.

The patch is certainly not ready for prime time yet, as it will need
lots of testing, and quite likely several more iterations.  I have no
idea how to write a good automatic testcase.  Also I have no idea yet
when to apply it if so, or whether also to 1.5.

Cheers,
Ralf

HEAD:
2007-04-27  Ralf Wildenhues  <[EMAIL PROTECTED]>

        * libltdl/config/ltmain.m4sh (func_mode_link): Do not treat
        `-l' in "conv" pass already, just like we skip over `-L' then.
        Fixes linking against installed /usr/lib/libstdc++.la when
        -lstdc++ happens to be in $postdeps.
        * NEWS: Update.
        Reports by Liviu Nicoara <[EMAIL PROTECTED]> and
        Vishal Soni-G20083 <[EMAIL PROTECTED]> and others.

Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.203
diff -u -r1.203 NEWS
--- NEWS        23 Apr 2007 17:10:16 -0000      1.203
+++ NEWS        26 Apr 2007 22:42:27 -0000
@@ -85,6 +85,10 @@
   - Use of C++ templates together with shared libraries has been
     improved on some systems and with some compilers, but is still
     ongoing work.  Feedback is desirable here.
+  - Linking of libstdc++ (and other GCC compiler-provided libraries) 
+    has been fixed in the case when a compiler from a nonstandard location
+    was used, but there was also an installation in a location the runtime
+    linker would search by default.
 
 * Bug fixes:
 
Index: libltdl/config/ltmain.m4sh
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/config/ltmain.m4sh,v
retrieving revision 1.74
diff -u -r1.74 ltmain.m4sh
--- libltdl/config/ltmain.m4sh  23 Apr 2007 17:10:17 -0000      1.74
+++ libltdl/config/ltmain.m4sh  26 Apr 2007 22:42:30 -0000
@@ -3797,6 +3797,10 @@
          continue
          ;;
        -l*)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+           continue
+         fi
          if test "$linkmode" != lib && test "$linkmode" != prog; then
            func_warning "\`-l' is ignored for archives/objects"
            continue


branch-1-5:
Index: ltmain.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltmain.in,v
retrieving revision 1.334.2.140
diff -u -r1.334.2.140 ltmain.in
--- ltmain.in   10 Apr 2007 19:10:04 -0000      1.334.2.140
+++ ltmain.in   26 Apr 2007 22:43:39 -0000
@@ -2144,6 +2144,10 @@
          continue
          ;;
        -l*)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+           continue
+         fi
          if test "$linkmode" != lib && test "$linkmode" != prog; then
            $echo "$modename: warning: \`-l' is ignored for archives/objects" 
1>&2
            continue


Reply via email to