[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: -pthread etc. fix
From: |
Peter O'Gorman |
Subject: |
Re: -pthread etc. fix |
Date: |
Sun, 28 Sep 2003 14:22:59 +0900 |
User-agent: |
Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.5b) Gecko/20030916 Thunderbird/0.3a |
Bob Friesenhahn wrote:
The alternative is to not change anything and continue to expect
packages to maintain the remaining linkage information seperately
(e.g. in a -config script) so the failure to link properly can be
blamed on the package rather than libtool.
The problem is that libtool eats the -pthread flag if it is specified.
And it dies if -pthread was put into dependency_libs in a .la created by
an older libtool (making libtool unable to link against those
libraries). It is likely possible to get the -pthread flag through on
the command line using -XCClinker etc., but it doesn't help with stuff
that appears in .la's dependency_libs.
I don't know why libtool eats unknown flags without even a warning when
build libraries, but passes them through for compiling and when building
executables. Was this a concious decision?
Anyway, we will have to rely on the package developers to ensure that
they are using the correct thread flags for the compiler they find. If
mistakes are made, we can still assign blame on the developers, but they
have little chance of doing things properly right now.
Just to prove my point:
peter% mkdir poo
peter% cd poo
peter% touch poo.c
peter% ../libtool --tag CC --mode=compile gcc -c -o poo.lo -pthread poo.c
<OUTPUT>
mkdir .libs
gcc -c -pthread poo.c -fno-common -DPIC -o .libs/poo.o
gcc: unrecognized option `-pthread'
gcc -c -pthread poo.c -o poo.o >/dev/null 2>&1
</OUTPUT>
peter% ../libtool --tag CC --mode=link gcc -o libpoo.la -pthread poo.lo
-rpath /usr/local/lib
<OUTPUT - note the total lack of -pthread on the link line darwin-6>
gcc -dynamiclib -flat_namespace -undefined suppress -o
.libs/libpoo.0.0.0.dylib .libs/poo.o -install_name
/usr/local/lib/libpoo.0.dylib -compatibility_version 1 -current_version 1.0
(cd .libs && rm -f libpoo.0.dylib && ln -s libpoo.0.0.0.dylib
libpoo.0.dylib)
(cd .libs && rm -f libpoo.dylib && ln -s libpoo.0.0.0.dylib libpoo.dylib)
ar cru .libs/libpoo.a poo.o
ranlib .libs/libpoo.a
ranlib: file: .libs/libpoo.a(poo.o) has no symbols
ranlib: warning for library: .libs/libpoo.a the table of contents is
empty (no object file members in the library define global symbols)
creating libpoo.la
(cd .libs && rm -f libpoo.la && ln -s ../libpoo.la libpoo.la)
</OUTPUT>
Thanks,
Peter
--
* Peter O'Gorman - http://www.pogma.com/ *