Subject: Re: using wrong libtool on Mac OS X?
To: Antoine Reilles <>
From: Georg Schwarz <>
List: tech-pkg
Date: 10/16/2005 16:34:20
> That's fun, on macosx 10.4, archivers/bzip2 builds and installs fine  
> for me.
> btw, i have:
> $ pkg_info| grep libtool
> libtool-base-1.5.18nb5 Generic shared library support script (the  
> script itself)
> so maybe there is something weird here, like the build using the  
> pkgsrc libtool instead of the system one for me, and i get:
> libtool  --mode=link gcc -pipe -L/usr/pkg/lib -o  
> blocksort.lo   huffman.lo     crctable.lo    randtable.lo    
> compress.lo    decompress.lo  bzlib.lo -version-info 0:0      -rpath / 
> usr/pkg/lib
> gcc -pipe -dynamiclib ${wl}-flat_namespace ${wl}-undefined ${wl} 
> suppress -o .libs/libbz2.0.0.0.dylib  .libs/blocksort.o .libs/ 
> huffman.o .libs/crctable.o .libs/randtable.o .libs/compress.o .libs/ 
> decompress.o .libs/bzlib.o  -L/Volumes/src/pkgsrc/archivers/bzip2/ 
> work/.buildlink/lib  -install_name  /usr/pkg/lib/libbz2.0.dylib -Wl,- 
> compatibility_version -Wl,1 -Wl,-current_version -Wl,1.0
> (cd .libs && rm -f libbz2.0.dylib && ln -s libbz2.0.0.0.dylib  
> libbz2.0.dylib)
> (cd .libs && rm -f libbz2.dylib && ln -s libbz2.0.0.0.dylib  
> libbz2.dylib)
> ar cru .libs/libbz2.a  blocksort.o huffman.o crctable.o randtable.o  
> compress.o decompress.o bzlib.o
> ranlib .libs/libbz2.a
> creating
> Can you try to install the pkgsrc libtool, and rebuild bzip2 ?

it has already been installed, but I reinstalled it. Same behaviour.
The problem can also be reproduced like that:

imac:~/pkgsrc/pkgsrc/archivers/bzip2/work/bzip2-1.0.3 schwarz$ env PATH=/Users/schwarz/pkg/local/bin:$PATH gcc -pipe -dynamiclib ${wl}-flat_namespace ${wl}-undefined ${wl}suppress -o .libs/libbz2.0.0.0.dylib  .libs/blocksort.o .libs/huffman.o .libs/crctable.o .libs/randtable.o .libs/compress.o .libs/decompress.o .libs/bzlib.o  -L/Users/schwarz/pkgsrc/pkgsrc/archivers/bzip2/work/.buildlink/lib  -install_name  /Users/schwarz/pkgsrc/local/lib/libbz2.0.dylib -Wl,-compatibility_version -Wl,1 -Wl,-current_version -Wl,1.0
ld: .libs/blocksort.o has local relocation entries in non-writable section (__TEXT,__text)
/usr/bin/libtool: internal link edit command failed

it looks like gcc calls the system libtool.
Georg Schwarz  +49 178 8545053