gmp 4.2.2 on Mac OS X

Roine Gustafsson roine at
Wed Sep 12 15:19:19 CEST 2007

Re: non-pic doesn't work on Mac OS X: Dynamic libraries (.dylib) are  
required to be PIC (-fPIC).
Applications can, and are recommended for performance reasons to be  
non-pic, but they should be compiled with "-mdynamic-no-pic".

man gcc:
            On Darwin and Mac OS X systems, compile code so that it  
is not
            relocatable, but that its external references are  
relocatable.  The
            resulting code is suitable for applications, but not shared

$gcc -mdynamic-no-pic -m32 ~/hello.c

./configure --host=none-apple-darwin --with-pic
passed make check for me (IntelMac, Mac OS X 10.4, Xcode 2.4.1)
$gcc --version
i686-apple-darwin8-gcc-4.0.1 (GCC) 4.0.1 (Apple Computer, Inc. build  

But gmp-4.2.2 installs /usr/local/lib/libgmp.3.4.2.dylib, is that  
According to, it should even be 7.2.4.

$grep library_names
library_names='libgmp.3.4.2 libgmp.3 libgmp'


More information about the gmp-discuss mailing list