bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: darwin: mix up of .dylib and .bundle


From: Peter O'Gorman
Subject: Re: darwin: mix up of .dylib and .bundle
Date: Sat, 15 Oct 2005 21:13:54 +0900
User-agent: Mozilla Thunderbird 1.0.2 (Macintosh/20050317)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Christoph Egger wrote:
| Hi!
|
| libtool mixes up .dylib and .bundle. It thinks,
| .dylib are modules and .bundle are shared libs.

Not here it doesn't...

|
| This causes linking failures on darwin due to multiple defined symbols,
| in cases where libfoo.dylib is inherited from libbar.dylib
| and the program foo links against libbar.dylib and libfoo.dylib.
| libtool also prints a warning, "libfoo.dylib is a module, not a shared
| library", which is wrong.
|
| I've attached a patch against cvs head which fixes this (for me at least).
| If the patch is not correct, then please give me one to test.
|

I think I've seen this issue with the GNU libtool that Apple shipped (is
shipping?), what version of glibtool are you using? Where did it originate?
What version of darwin? Or maybe it is just the fact that if there is no
.dylib it does its best and uses the .a? Please show steps to reproduce too.

Thanks,
Peter

(with libtool HEAD from about 10 minutes ago):
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (Darwin)

iQCVAwUBQ1DygriDAg3OZTLPAQJsoAP/SssTDhIj/1cT+Aipauow952HoStxwD3L
g0fGF1lC9Pd7l70tNaG7d+zkVmUy9QJPCR7CnJFUow04+o/DtiNSknYxWHdbvEnx
QEileEA1PhS62URpw5Vk2AUrFBj40oniZ0jfVLemCMhDQ2Y9/xJ+9ZmmF3QCbPPE
iiXqHLXsJq4=
=uh21
-----END PGP SIGNATURE-----
imac% touch foo.c bar.c
imac% ./libtool --mode=compile --tag=CC gcc -c -o foo.lo foo.c
libtool: compile:  gcc -c foo.c  -fno-common -DPIC -o .libs/foo.o
libtool: compile:  gcc -c foo.c -o foo.o >/dev/null 2>&1
imac% ./libtool --mode=compile --tag=CC gcc -c -o bar.lo bar.c
libtool: compile:  gcc -c bar.c  -fno-common -DPIC -o .libs/bar.o
libtool: compile:  gcc -c bar.c -o bar.o >/dev/null 2>&1
imac% ./libtool --mode=link --tag=CC gcc -o libfoo.la foo.lo -module -rpath /no
libtool: link: gcc -Wl,-flat_namespace -Wl,-undefined -Wl,suppress -o 
.libs/libfoo.0.so -bundle  .libs/foo.o  
libtool: link: (cd ".libs" && rm -f "libfoo.so" && ln -s "libfoo.0.so" 
"libfoo.so")
libtool: link: ar cru .libs/libfoo.a  foo.o
ranlib: file: .libs/libfoo.a(foo.o) has no symbols
libtool: link: ranlib .libs/libfoo.a
ranlib: file: .libs/libfoo.a(foo.o) has no symbols
ranlib: warning for library: .libs/libfoo.a the table of contents is empty (no 
object file members in the library define global symbols)
libtool: link: creating libfoo.la
libtool: link: ( cd ".libs" && rm -f "libfoo.la" && ln -s "../libfoo.la" 
"libfoo.la" )
imac% ./libtool --mode=link --tag=CC gcc -o libbar.la bar.lo libfoo.la -rpath 
/no

*** Warning: Linking the shared library libbar.la against the loadable module
*** libfoo.so is not portable!
*** Warning: lib libfoo.so is a module, not a shared library
libtool: link: gcc -dynamiclib -Wl,-flat_namespace -Wl,-undefined -Wl,suppress 
-o .libs/libbar.0.dylib  .libs/bar.o   ./.libs/libfoo.a      -install_name  
/no/libbar.0.dylib -Wl,-compatibility_version -Wl,1 -Wl,-current_version -Wl,1.0
ld: warning empty table of contents: ./.libs/libfoo.a (can't load from it)
libtool: link: (cd ".libs" && rm -f "libbar.dylib" && ln -s "libbar.0.dylib" 
"libbar.dylib")
libtool: link: ar cru .libs/libbar.a  bar.o
ranlib: file: .libs/libbar.a(bar.o) has no symbols
libtool: link: ranlib .libs/libbar.a
ranlib: file: .libs/libbar.a(bar.o) has no symbols
ranlib: warning for library: .libs/libbar.a the table of contents is empty (no 
object file members in the library define global symbols)
libtool: link: creating libbar.la
libtool: link: ( cd ".libs" && rm -f "libbar.la" && ln -s "../libbar.la" 
"libbar.la" )
imac% ./libtool --mode=link --tag=CC gcc -o libfoo.la foo.lo -module -shared 
-rpath /no
libtool: link: rm -fr  .libs/libfoo.0.so .libs/libfoo.a .libs/libfoo.la 
.libs/libfoo.lai .libs/libfoo.so
libtool: link: gcc -Wl,-flat_namespace -Wl,-undefined -Wl,suppress -o 
.libs/libfoo.0.so -bundle  .libs/foo.o  
libtool: link: (cd ".libs" && rm -f "libfoo.so" && ln -s "libfoo.0.so" 
"libfoo.so")
libtool: link: creating libfoo.la
libtool: link: ( cd ".libs" && rm -f "libfoo.la" && ln -s "../libfoo.la" 
"libfoo.la" )
imac% ./libtool --mode=link --tag=CC gcc -o libbar.la bar.lo libfoo.la -rpath 
/no 

*** Warning: Linking the shared library libbar.la against the loadable module
*** libfoo.so is not portable!
*** Warning: lib libfoo.so is a module, not a shared library

*** And there doesn't seem to be a static archive available
*** The link will probably fail, sorry
libtool: link: rm -fr  .libs/libbar.0.dylib .libs/libbar.a .libs/libbar.dylib 
.libs/libbar.la .libs/libbar.lai
libtool: link: gcc -dynamiclib -Wl,-flat_namespace -Wl,-undefined -Wl,suppress 
-o .libs/libbar.0.dylib  .libs/bar.o   ./.libs/libfoo.so      -install_name  
/no/libbar.0.dylib -Wl,-compatibility_version -Wl,1 -Wl,-current_version -Wl,1.0
ld: ./.libs/libfoo.so is input for the dynamic link editor, is not relocatable 
by the static link editor again
/usr/bin/libtool: internal link edit command failed

reply via email to

[Prev in Thread] Current Thread [Next in Thread]