Subject: Libtool issue on Mac OS X revisited
To: None <>
From: Georg Schwarz <>
List: tech-pkg
Date: 10/22/2005 22:28:39
I just wiped my previous pkgsrc  installation on Mac OS Tiger and did a
clean reinstall from today's pkgsrc.tar.gz.
I used ./bootstrap --prefix=/Users/schwarz/pkgsrc/local
--pkgdbdir=/Users/schwarz/pkgsrc/db --varbase=/Users/schwarz/pkgsrc/var
--ignore-case-check --ignore-user-check
to bootstrap, then copied mk.conf and added the following lines to it:

I changed to ../www/lynx and issued a
/Users/schwarz/pkgsrc/local/bin/bmake install.
It built and installed libtool-base-1.5.18nb5, but when it came to
building devel/gettext-lib it failed like this:

/bin/sh ../libtool --mode=link  gcc -pipe -D_INTL_REDIRECT_MACROS=1
-DSTATIC=static -no-cpp-precomp -I/usr/include -fast -I/usr/include
-L/usr/lib -L/Users/schwarz/pkgsrc/local/lib -o
intl-compat.lo bindtextdom.lo dcgettext.lo dgettext.lo gettext.lo
finddomain.lo loadmsgcat.lo localealias.lo textdomain.lo l10nflist.lo
explodename.lo dcigettext.lo dcngettext.lo dngettext.lo ngettext.lo
plural.lo plural-exp.lo localcharset.lo localename.lo osdep.lo
-L/usr/lib -liconv -lc  -version-info 4:0:2  -rpath
gcc -pipe -dynamiclib ${wl}-flat_namespace ${wl}-undefined ${wl}suppress
-o .libs/libintl.2.2.0.dylib  .libs/intl-compat.o .libs/bindtextdom.o
.libs/dcgettext.o .libs/dgettext.o .libs/gettext.o .libs/finddomain.o
.libs/loadmsgcat.o .libs/localealias.o .libs/textdomain.o
.libs/l10nflist.o .libs/explodename.o .libs/dcigettext.o
.libs/dcngettext.o .libs/dngettext.o .libs/ngettext.o .libs/plural.o
.libs/plural-exp.o .libs/localcharset.o .libs/localename.o .libs/osdep.o
/usr/lib/libiconv.dylib -lc  -install_name
-Wl,-compatibility_version -Wl,5 -Wl,-current_version -Wl,5.0
ld: .libs/intl-compat.o has local relocation entries in non-writable
section (__TEXT,__symbol_stub1)
/usr/bin/libtool: internal link edit command failed
*** Error code 1

bmake: stopped in
*** Error code 1

bmake: stopped in /Users/schwarz/pkgsrc/pkgsrc/devel/gettext-lib
===> There was an error during the ``build'' phase.
===> Please investigate the following for more information:
===>      * log of the build
===>      *
*** Error code 1


it turned out that this issue pops up when CFLAGS contains
-mdynamic-no-pic which is implied by -fast.
If one looks into gcc's man page one knows why...

So my CFLAGS now looks like this:

-O3 -fgcse-sm -funroll-loops -fstrict-aliasing -fsched-interblock
-falign-loops=16 -falign-jumps=16 -falign-functions=16
-falign-jumps-max-skip=15 -falign-loops-max-skip=15 -malign-natural
-ffast-math -freorder-blocks -freorder-blocks-and-partition
-finline-floor -mpowerpc-gpopt -fstrict-aliasing -mtune=G5 -mcpu=G5

Georg Schwarz  +49 178 8545053