macosx extern inline problem

Jay K jay.krell at
Mon May 24 15:12:31 CEST 2010

so..I spent *quite* some time looking into the Mac OS X "extern inline"
problem with gmp.

You know, the problem with gcc 4.0.1 on MacOSX/x86 10.5
where mpfr complains about libgmp.a, because it has duplicate symbols or such.

My goal was to use "gcc" and compile gmp/mpfr/mpc only once,
despite building gcc for multiple targets.

You might notice that if you put gmp/mpfr/mpc in the gcc tree,
gcc *does* build them all successfully, and somehow gets around
the "extern inline" problem. And it seems to do kind of by accident.
There is no mention of a bug workaround or anything.

It does it by passing down CFLAGS=-g -O2.
 -std=gnu99 is avoided.
 Maybe gmp could be adjusted to never use -std=gnu99?

gnu99 isn't mentioned in the gmp code, except as autoconf output.
Not clear if there is a patch to gmp to address this.

I've gone back to just building gmp extra times for now.

I realize CC=gcc-4.2 will also fix it, but I'm using the default "gcc"
everywhere and this is the only problem.

It is possible that defined(__APPLE__) && __GNUC_MAJOR__ == 4 && __GNUC__MINOR == 0
or such should trigger something in gmp.h or autoconf but I haven't found
anything that works (didn't try much).

Would be nice to fix this somehow.
"extern __inline__" doesn't work.
I was reluctant to try "static __inline__" but maybe that is a good idea.

 - Jay 		 	   		  

More information about the gmp-discuss mailing list