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 
/opt/compilers/gcc-4.1.2/lib/ -L/opt/compilers/gcc-4.1.2/lib 
-Wl,-rpath,/tmp/install/lib -Wl,-rpath,/opt/compilers/gcc-4.1.2/lib


$ ldd tests/.libs/test =  (0xe000) = not found = /opt/compilers/gcc-4.1.2/lib/ 
(0xb7e21000) = /lib/tls/ (0xb7dfe000) = /opt/compilers/gcc-4.1.2/lib/ 
(0xb7df3000) = 
/opt/compilers/intel-9.1.042/lib/ (0xb7df1000) = /lib/tls/ (0xb7cd4000) = /lib/tls/ (0xb7cd)
/lib/ (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.


Description: application/gzip
Description: application/gzip
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.


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/ 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 @@
+ 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

RCS file: /cvsroot/libtool/libtool/Attic/,v
retrieving revision 1.334.2.140
diff -u -r1.334.2.140
---   10 Apr 2007 19:10:04 -  1.334.2.140
+++   26 Apr 2007 22:43:39 -
@@ -2144,6 +2144,10 @@
+ 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