macosx extern inline problem

Jay K jay.krell at cornell.edu
Tue May 25 08:53:56 CEST 2010


Torbjörn, I understand, but it is a matter of degree. ?
Take it on a case by case basis, or reject it all as a matter of principle?
 
 
What I meant by "default PIC" was that if you read through:
 
 
 > http://gmplib.org/macos.html

 
Many of the problems are related to super-tuning, including using assembly and not being PIC.
 
 
gmp seems to go pretty far in dealing with system variations. Perhaps not bugs, just variations.
 
 
Handling this problem seems trivial and worthwhile.
 
You mention it on your web site:
 
"There are problems building GMP using some Apple "Xcode" versions. The symptom is typically about __gmpz_abs being multiply defined. The remedy for now is that you install a different Xcode."
 
 
There are many references to the error on the web.
(I don't have it handy and having trouble finding them but when I was looking into this a while yesterday I saw money.
 
 
Again, there is a small workaround, it lets compiling with "none" seem to work. It is what building gcc frequently does with no apparent problem, though that ends up working around it a different way -- by not using -std=gnu99.
 
 
 - Jay

----------------------------------------
> To: jay.krell at cornell.edu
> CC: gmp-discuss at gmplib.org
> Subject: Re: macosx extern inline problem
> From: tg at gmplib.org
> Date: Tue, 25 May 2010 08:13:22 +0200
>
> Jay K writes:
>
> This is the default gcc with MacOSX 10.5/x86. I think it is worth trying a
> bit.
> There is seemingly just one problem, here is a fix:
>
> gmp-h.in:
>
> #ifdef __GNUC__
>> /* Apple gcc 4.0.1 -std=gnu99 has problems, worked around here. */
>> #if defined __GNUC_STDC_INLINE__ && defined __APPLE__ && __GNUC__ == 4
> && __GNUC_MINOR__ == 0
>> #define __GMP_EXTERN_INLINE __inline__
>> #define __GMP_INLINE_PROTOTYPES 0
>> #else
> #if (defined __GNUC_STDC_INLINE__) || (__GNUC__ == 4 && __GNUC_MINOR__ ==
> 2)
> #define __GMP_EXTERN_INLINE extern __inline__ __attribute__
> ((__gnu_inline__))
> #else
> #define __GMP_EXTERN_INLINE extern __inline__
> #endif
> #define __GMP_INLINE_PROTOTYPES 1
> #endif
>> #endif
>
> As I said before, we chose not to work around every Xcode quirk, since
> there are too many, and the result would be that GMP would become harder
> to maintain. The workaround is instead to use a different Xcode.
>
> (You should remember that Apple machines is just one of many dozens of
> platforms we support. Imagine the mess we would create if we tried to
> handle every odd behaviour in each toolchain of each platform!)
>
>> http://gmplib.org/macos.html
>
> It sounds like if you kept everything in C and accepted the default PIC,
> many problems would go away?
>
> What does "default PIC" mean?
>
> I believe our asm PIC code now is accepted by any Xcode from the last 5
> years.
>
> "Keeping everything in C", the use of "none" above, is what the gcc build
> does when it builds gmp.
>
> Very wise of them. They don't need the speed of the assembly code.
>
> --
> Torbjörn 		 	   		  


More information about the gmp-discuss mailing list