Building libgpg-error on OS X 10.4

Geoff Schmidt gschmidt at
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  
Nicholas said.

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 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!

Geoff Schmidt

> *** Warning: Linking the shared library
> against the
> *** static library ../intl/libintl.a is not portable!
> gcc -dynamiclib -flat_namespace -undefined suppress -o
> .libs/libgpg-error.0.2.1.dylib
> .libs/libgpg_error_la-init.o
> .libs/libgpg_error_la-strsource.o
> .libs/libgpg_error_la-strerror.o
> .libs/libgpg_error_la-code-to-errno.o
> .libs/libgpg_error_la-code-from-errno.o
> ../intl/libintl.a /usr/lib/libiconv.dylib
> -Wl,-framework -Wl,CoreFoundation -install_name
> /usr/local/lib/libgpg-error.0.dylib
> -Wl,-compatibility_version -Wl,3 -Wl,-current_version
> -Wl,3.1
> ld: warning multiple definitions of symbol
> _locale_charset
> ../intl/libintl.a(localcharset.o) definition of
> _locale_charset in section (__TEXT,__text)
> /usr/lib/libiconv.dylib(localcharset.o) definition of
> _locale_charset
> 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[3]: *** [] Error 1
> make[2]: *** [all] Error 2
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2

More information about the Gnupg-devel mailing list