Hi,

using libtool with aix & g++ & pthread seems to be one of the
worst combinations one can think of...

What i have:

powerpc-ibm-aix5.2.0.0
gcc-3.4.4
libtool-1.5.20 (initially without, then with some gentoo patches)
CFLAGS=-pthread
CXXFLAGS=-pthread
LDFLAGS=-Wl,-brtl

What my problem is:

gcc provides separate libstdc++.{a,la} for use with pthread and without.
When linking with libtool & g++ & pthread, i end up with an executable
depending on the non-pthreaded libstdc++, and both libgcc_s and
libgcc_s_pthread. This is definitely wrong.

What i found out:

*) works with libtool-1.5.10

*) libtool uses two different ways to ask gcc for the library pathes:

  1) sys_lib_search_path_spec=`$CC -print-search-dirs | grep ...`
   gcc does not print the pthread-subdir (for pthreaded-libstdc++)
   with -print-search-dirs, even if -pthread would be passed.

  2) output_verbose_link_cmd='$CC -shared $CFLAGS -v ... | grep "\-L"'
   Here the pthread subdir comes out, because -pthread is passed from
   CFLAGS, and the output is what is actually done.

*) the change of cvs-version 1.334.2.39 in ltmain.in caused my problem:
   * config/ltmain.in (func_mode_link): When linking an installed 
   libtool library on the command line using -lfoo we need to find
   the library in the search paths and add it's dependency_libs to
   the link in the conv pass so that any libtool libs listed are
   correctly expanded in the link pass.

What i suppose:

Shouldn't the similar change also be done for the '-L' case, to get the
libpath into newlib_search_path, which is used to find the '-l' libs ?

-haubi

diff -ru libtool-1.5.20.orig/ltmain.sh libtool-1.5.20/ltmain.sh
--- libtool-1.5.20.orig/ltmain.sh	2006-01-10 17:06:50.000000000 +0100
+++ libtool-1.5.20/ltmain.sh	2006-01-10 17:16:21.000000000 +0100
@@ -2086,11 +2086,12 @@
 	  case $linkmode in
 	  lib)
 	    deplibs="$deplib $deplibs"
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
 	    test "$pass" = conv && continue
 	    newdependency_libs="$deplib $newdependency_libs"
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
 	    ;;
 	  prog)
+	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
 	    if test "$pass" = conv; then
 	      deplibs="$deplib $deplibs"
 	      continue
@@ -2101,7 +2102,6 @@
 	      compile_deplibs="$deplib $compile_deplibs"
 	      finalize_deplibs="$deplib $finalize_deplibs"
 	    fi
-	    newlib_search_path="$newlib_search_path "`$echo "X$deplib" | $Xsed -e 's/^-L//'`
 	    ;;
 	  *)
 	    $echo "$modename: warning: \`-L' is ignored for archives/objects" 1>&2
_______________________________________________
Bug-libtool mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-libtool

Reply via email to