Building gmp library for the iPhone-Update
mpkju at free.fr
Thu Jul 16 12:21:35 CEST 2009
Le 16 juil. 09 à 11:45, Torbjorn Granlund a écrit :
> Pierre-Henri Jondot <mpkju at free.fr> writes:
> Trying to build a gmp library for arm without asm, I replaced arm-
> apple-darwin host with none-apple-darwin (but keeping the arm cross-
> compiler with CC flag) I could build an arm library.
> That said, I have been unable to build a simple test case, the link
> stage failing with :
> Undefined symbols:
> "___gmpn_invert_limb", referenced from:
> _mpn_mod_1_unnorm in libgmp.a(mod_1.o)
> _mpn_mod_1_norm in libgmp.a(mod_1.o)
> Usually, a host cpu of "none" should pass -DNO_ASM. If you look at
> compiler invokations, didn't that happen? (The logic for -DNO_ASM
> is in
> the configure script, you can locate it easily.)
> (Possibly, the cross-compilation motivated overriding of various
> parameters might have inhibited -DNO_ASM.)
For some reason indeed, the -DNO_ASM was not there...
So I've added it to the configure invocation, which is now :
bin/gcc-4.2 -E" LD="/Developer/Platforms/iPhoneOS.platform/Developer/
usr/bin/ld" CPPFLAGS="-arch armv6 -isysroot /Developer/Platforms/
min=3.0 -DNO_ASM" --disable-shared --enable-static --prefix=/Developer/
The library I obtained this way allowed me this time to build a simple
test case and run it on an iphone.
I'll try to investigate a bit about the asm file that fails to build,
but I know no arm asm (or no asm at all I should say) and so far I
have not been able to find much documentation, or at all, about
apple's compiler, so most probably "porting GMP to the iPhone" will be
out of my league...
More information about the gmp-discuss