Building libgpg-error on OS X 10.4
gschmidt at gschmidt.org
Wed Aug 2 08:25:09 CEST 2006
This is in response to Nicholas Cole's message of July 9, 2006.
> I'm trying to build libgpg-error on OS X 10.4.
> ./configure runs fine, but the build fails with the
> error copied at the end of this email. Any hints?
[see bottom for the error]
I found that this occurs under OS X 10.4.7 on PPC, not just Intel as
The problem is that the included libintl gets built as a static
library, but is then linked into the dynamic libgpg-error. libtool
doesn't catch on for some reason that this is happening and the
libintl is built without the -fno-common that OS X requires for code
that will eventually find its way into a dynamic library. This is the
reason the link fails.
I used this "brute force" workaround:
CFLAGS="$CFLAGS -fno-common" CXXFLAGS="$CXXFLAGS -fno-common" ./
CFLAGS="$CFLAGS -fno-common" CXXFLAGS="$CXXFLAGS -fno-common" make
I still got this warning:
*** Warning: Linking the shared library libgpg-error.la against the
*** static library ../intl/libintl.a is not portable!
but not the other warnings or errors.
This message on the GCC mailing list suggests that passing -
single_module would also make the link succeed:
This poster says that -fno-common is the correct solution, and that
under some circumstances libtool will use it automatically:
Hope this helps someone. Please send replies to me directly, since I
am not subscribed to this list. I am also happy to test patches, etc
if you would like to work on this but don't have an appropriate OS X
box handy or can't reproduce the problem.
Thanks a lot!
> *** Warning: Linking the shared library
> libgpg-error.la against the
> *** static library ../intl/libintl.a is not portable!
> gcc -dynamiclib -flat_namespace -undefined suppress -o
> ../intl/libintl.a /usr/lib/libiconv.dylib
> -Wl,-framework -Wl,CoreFoundation -install_name
> -Wl,-compatibility_version -Wl,3 -Wl,-current_version
> ld: warning multiple definitions of symbol
> ../intl/libintl.a(localcharset.o) definition of
> _locale_charset in section (__TEXT,__text)
> /usr/lib/libiconv.dylib(localcharset.o) definition of
> ld: common symbols not allowed with MH_DYLIB output
> format with the -multi_module option
> ../intl/libintl.a(loadmsgcat.o) definition of common
> __nl_msg_cat_cntr (size 16)
> ../intl/libintl.a(dcigettext.o) definition of common
> _libintl_nl_domain_bindings (size 16)
> ../intl/libintl.a(plural-exp.o) definition of common
> _libintl_gettext_germanic_plural (size 32)
> /usr/bin/libtool: internal link edit command failed
> make: *** [libgpg-error.la] Error 1
> make: *** [all] Error 2
> make: *** [all-recursive] Error 1
> make: *** [all] Error 2
More information about the Gnupg-devel