Hi,
I was trying to link guile 1.8.1 against gmp-4.2.1 on OS X
and ran afoul
of OS X's picky linker.
ld: common symbols not allowed with MH_DYLIB output format
with the
-multi_module option
/usr/local/lib/libgmp.a(mp_bpl.o) definition of common
___gmp_junk (size 16)
/usr/bin/libtool: internal link edit command failed
After some research it appears that in addition to fiddling
with the
shared library type and -fno-common, you can also make the
OS X linker
happier by initializing the global variable.
The following patch makes it possible to link to guile (and
probably
other "-dynamiclib"s ) without odd OS X specific
CFLAGS settings.
I'm currently using
$ ./configure --disable-shared --build=none-unknown-osx
to build gmp, and all the tests in make check pass (after
this patch and
the gmp_x86check_workaround_apple_ld_bug patch)
Diane
--- gmp-4.2.1.orig/mp_bpl.c 2006-03-14
07:57:54.000000000 -0800
+++ gmp-4.2.1/mp_bpl.c 2007-04-08 13:35:25.000000000 -0700
 -23,5
+23,5 
#include "gmp-impl.h"
const int mp_bits_per_limb = BITS_PER_MP_LIMB;
const int __gmp_0 = 0;
-int __gmp_junk;
+int __gmp_junk = 0;
_______________________________________________
gmp-discuss mailing list
gmp-discuss swox.com
http://s
wox.com/mailman/listinfo/gmp-discuss
|