Building libgpg-error on OS X 10.4

Marcus Brinkmann marcus.brinkmann at ruhr-uni-bochum.de
Wed Aug 2 20:46:59 CEST 2006


Hi,

(please keep the CC's intact on reply)

it seems that the libtool+gettext+automake machinery does not work
perfectly for libraries using gettext.  If you use
--with-included-gettext, then a static version of libintl will be
built, and LTLIBINTL is set to the static library.  But linking a
static library with a shared library is not guaranteed to work.  In
fact, it gives a warning.  Moreover, it actually fails on Mac OS X due
to missing -fno-common (because the static library is not built as
PIC).

So, the question is, is there any solution to this, beside advising
Mac OS X users to never use the included gettext, but link dynamically
to an external gettext implementation?

Thanks,
Marcus

At Wed, 2 Aug 2006 02:25:09 -0400,
Geoff Schmidt <gschmidt at gschmidt.org> wrote:
> 
> 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" ./ 
> configure
> CFLAGS="$CFLAGS -fno-common" CXXFLAGS="$CXXFLAGS -fno-common" make  
> install
> 
> 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:
> http://gcc.gnu.org/ml/gcc/2005-06/msg00184.html
> 
> This poster says that -fno-common is the correct solution, and that  
> under some circumstances libtool will use it automatically:
> http://gcc.gnu.org/ml/gcc/2005-06/msg00378.html
> 
> 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
> > libgpg-error.la 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]: *** [libgpg-error.la] Error 1
> > make[2]: *** [all] Error 2
> > make[1]: *** [all-recursive] Error 1
> > make: *** [all] Error 2
> >
> >
> >
> 
> _______________________________________________
> Gnupg-devel mailing list
> Gnupg-devel at gnupg.org
> http://lists.gnupg.org/mailman/listinfo/gnupg-devel
> 




More information about the Gnupg-devel mailing list