Building gmp library for the iPhone-Update

Pierre-Henri Jondot mpkju at free.fr
Wed Jul 15 16:52:59 CEST 2009


Hi,

Following some of the advice in http://latenitesoft.blogspot.com/2008/10/iphone-programming-tips-building-unix.html
I managed to get a bit further in the building of gmp. (At least I got  
past the configure step...)

I tried two configurations, one for iPhoneOS 2.2 (gcc 4.0.1)
and one targetting iPhone OS 3.0. (gcc 4.2.1)

In both cases, build fails with at the same spot (here for OS 3.0)  
with :

  /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/arm-apple- 
darwin9-gcc-4.2.1 -c -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP - 
I.. -DOPERATION_invert_limb -I/Developer/Platforms/iPhoneOS.platform/ 
Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/gcc/arm-apple-darwin9/4.2.1/ 
include/ -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ 
iPhoneOS3.0.sdk/usr/include/ -I/Developer/Platforms/iPhoneOS.platform/ 
Developer/SDKs/iPhoneOS3.0.sdk/usr/lib/gcc/arm-apple-darwin9/4.2.1/ 
include/ -I/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/ 
iPhoneOS3.0.sdk/usr/include/ -pipe -no-cpp-precomp -isysroot / 
Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS3.0.sdk  
tmp-invert_limb.s -o invert_limb.o
tmp-invert_limb.s:56:unsupported relocation on symbol invtab
tmp-invert_limb.s:56:FATAL:Internal error: incorrect fx_r_type (17)  
for fx_subsy != 0 in fix_to_relocation_info()
make[2]: *** [invert_limb.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

Does it ring a bell ?

Regards,

Pierre-Henri



Le 15 juil. 09 à 12:12, Pierre-Henri Jondot a écrit :

> Hi,
>
> I am an iPhone developer, and I do have a project making use of  
> several libraries (LGPL and GPL), and the gpm library is the first I  
> am trying to build. (Of course the final project will then have to  
> be GPL)
>
> I browsed the archives to see if others went the same route  
> previously and couldn't find any.
>
> I've failed miserably so far to build the library. My os is OSX  
> 10.5.7 with iPhone SDK 3.0.
>
> What I have tried so far :
>
> ./configure --disable-shared --enable-static --prefix=/Developer/ 
> Platforms/iPhoneOS.platform/Developer/usr/local --build=i686-apple- 
> darwin --host=armv6-apple-darwin CC="/Developer/Platforms/ 
> iPhoneOS.platform/Developer/usr/bin/gcc-4.2"
>
> but doing this seems not enough to cross-compile for arm  
> architecture (it builds for x86 it seems), and the first asm file  
> triggers an error.
>
> Replacing --host=armv6-apple-darwin with --host=none-apple-darwin  
> allowed me to build a library... but for x86 architecture...
>
> Doing :
>
> /configure --disable-shared --enable-static --prefix=/Developer/ 
> Platforms/iPhoneOS.platform/Developer/usr/local --build=i686-apple- 
> darwin --host=armv6-apple-darwin CC="/Developer/Platforms/ 
> iPhoneOS.platform/Developer/usr/bin/gcc-4.2" CFLAGS="-arch armv6"
>
> fails at the configure step : "could not find a working compiler",  
> and the config.log shows :
> configure:3900: /Developer/Platforms/iPhoneOS.platform/Developer/usr/ 
> bin/gcc-4.2 -arch armv6  conftest.c >&5
> ld: library not found for -lcrt1.o
>
> Any idea of what I have been doing wrong ?
>
> Regards,
>
> Pierre-Henri Jondot
> _______________________________________________
> gmp-discuss mailing list
> gmp-discuss at gmplib.org
> https://gmplib.org/mailman/listinfo/gmp-discuss



More information about the gmp-discuss mailing list