gmp 4.2 fails tests on G5

Jack Howarth howarth at
Thu Apr 27 22:41:49 CEST 2006

    Mike Stump who works on the Apple gcc developer tools has 
responded on this issue...

On Apr 27, 2006, at 6:11 AM, Jack Howarth wrote:
>     Could one of you guys make sure that the following issue
> discussed in the message...
> gets to the attention of the appropriate compiler developer

Not a compiler issue.  ld64 issue.

> at Apple and fixed?

Looks fixed already to me for the next release for ppc64:

mrs $ cat t1.c
int i = 12;
mrs $ cat t.c
extern int i;

main() { ++i; }
mrs $ gcc -arch ppc64  -mdynamic-no-pic t1.c -c
mrs $ gcc -arch ppc64 -mdynamic-no-pic t.c t1.o -dynamiclib -o t.dylib
ld64 failed: absolute addressing (perhaps -mdynamic-no-pic) used in  
_main from /var/tmp//ccGHJfAz.o not allowed in slidable image
/usr/bin/libtool: internal link edit command failed
mrs $ ld64 -v
@(#)PROGRAM:ld64  PROJECT:ld64-47  DEVELOPER:root  BUILT:Mar 18 2006  

?  If that works for you, I'd guess that all such instances are now  
fixed.  If not, I'd need a testcase.

> While your at it, could you also have them document the fact that - 
> fast implicitly does -mdynamic-no-pic?

Sure, radar 4529651, document -fast turns on -mdynamic-no-pic

> I have been told this is the case


Though, did their man page have:

            To build shared libraries with -fast, specify -fPIC on  

in it?  If so, doesn't that kinda suggest that -fPIC has to be used  
to build shared libraries?

So it appears the next release of Xcode will properly issue report
an error when you try to compile a shared lib with objects created
with -fast alone. The fix remains the same as documented in the
gcc man page for Apple's compilers...add -fPIC.

More information about the gmp-bugs mailing list