Re: libtool/ltmain linking wrong (/usr/lib) libstdc++

2007-04-30 Thread Liviu Nicoara

Ralf Wildenhues wrote:
 [ let's continue this discussion on libtool-patches, please ]

Hi Ralf,

I applied the patch on HEAD and I obtained this [AFAICT correct] output:

/bin/sh ../libtool --tag=CXX --mode=link icpc  -g -O2 -L../source -lford 
 -o test  test.o
libtool: link: icpc -g -O2 -o .libs/test test.o  -L/tmp/ford/source 
/tmp/ford/source/.libs/libford.so 
/opt/compilers/gcc-4.1.2/lib/libstdc++.so -L/opt/compilers/gcc-4.1.2/lib 
-L/opt/compilers/gcc-4.1.2/lib/gcc/i486-slackware-linux/4.1.2 
-Wl,-rpath,/tmp/install/lib -Wl,-rpath,/opt/compilers/gcc-4.1.2/lib


Also:

$ ldd tests/.libs/test
linux-gate.so.1 =  (0xe000)
libford-0.0.1.so = not found
libstdc++.so.6 = /opt/compilers/gcc-4.1.2/lib/libstdc++.so.6 
(0xb7e21000)

libm.so.6 = /lib/tls/libm.so.6 (0xb7dfe000)
libgcc_s.so.1 = /opt/compilers/gcc-4.1.2/lib/libgcc_s.so.1 
(0xb7df3000)
libcxaguard.so.5 = 
/opt/compilers/intel-9.1.042/lib/libcxaguard.so.5 (0xb7df1000)

libc.so.6 = /lib/tls/libc.so.6 (0xb7cd4000)
libdl.so.2 = /lib/tls/libdl.so.2 (0xb7cd)
/lib/ld-linux.so.2 (0xb7f16000)

(there are no conflicts)

I am attaching the output of linking the project's library, the 
project's test program and the output of --config with CXX tag.


Thanks,
Liviu




libtool.config.gz
Description: application/gzip


libtool.link.library.gz
Description: application/gzip


libtool.link.prog.gz
Description: application/gzip


Re: libtool/ltmain linking wrong (/usr/lib) libstdc++

2007-04-26 Thread Ralf Wildenhues
[ 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
--- NEWS23 Apr 2007 17:10:16 -  1.203
+++ NEWS26 Apr 2007 22:42:27 -
@@ -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 -  1.74
+++ libltdl/config/ltmain.m4sh  26 Apr 2007 22:42:30 -
@@ -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 -  1.334.2.140
+++ ltmain.in   26 Apr 2007 22:43:39 -
@@ -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 
12
continue