Compiling GMP on OS X 10.6 (snow leopard)

Hans Aberg haberg at math.su.se
Sat Oct 10 18:49:28 CEST 2009


On 10 Oct 2009, at 18:29, Torbjorn Granlund wrote:

>  Note that 10.6 is a true 64-bit OS - 10.5 is 32-bit; for a 32-bit
>  compile, one should use 'gcc -arch i386'. Though I do not know if  
> that
>  has anything to do with the problem.
>
> There is some misunderstanding here.
>
> Mac OS X has long been a 64-bit OS in the sense that it has supported
> 64-bit logical addressing (and surely very wide physical addressing  
> too,
> though no hardware thus no software supports 64-bit physical
> addressing).
>
> Previously "gcc -m64 files..." has been used to create 64-bit  
> binaries.
> Without -m64 the compiler defaulted to generating 32-bit code.
>
> Perhaps what you are saying that the new compiler under 10.6  
> defaults to
> generating 64-bit code, and that one needs to pass an option to make  
> it
> generate 32-bit code?

Yes, it seems that on Mac OS X 10.5 Snow Leopard gcc defaults at  
generating 64-bit code, with 64-bit pointers. If the program has not  
been adapted to that, one may get errors. (It happened with ChucK.)

Some links:
http://developer.apple.com/mac/library/documentation/Darwin/Conceptual/64bitPorting/intro/intro.html
http://developer.apple.com/mac/library/documentation/Darwin/Conceptual/64bitPorting/building/building.html

   Hans




More information about the gmp-bugs mailing list