Mailing List Archive

compilation errors on iPhone
I'm trying to build libgcrypt so that I can build vpnc on the iphone,
but I'm running into a compilation/assembly error that I've not been
able to solve.

/usr/local/arm-apple-darwin/bin/gcc -DHAVE_CONFIG_H -I. -I. -I..
-I../src -I/usr/local/arm-apple-darwin/include -g -O2 -Wall -MT
mpih-div.lo -MD -MP -MF .deps/mpih-div.Tpo -c mpih-div.c -fno-common
-DPIC -o .libs/mpih-div.o
Bad $ operand number in inline asm string: '${:@} Inlined umul_ppmm
umull ${1:r}, ${0:r}, ${2:r}, ${3:r}'
make[2]: *** [mpih-div.lo] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2

The iPhone is an arm processor, though I wasn't able to figure out how
mpih-dev.c got the correct #defines to figure out which assembly macro
was actually being called...

anyhow, I was hoping to get some suggestions on workarounds or
solutions so I can get this built.

config.log : http://eludicate.com/~bolen/tmp/gcrypt_iphone/config.log

thanks,

B

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: compilation errors on iPhone [ In reply to ]
On Tue, 11 Sep 2007 16:09, britt@bolen.com said:

> Bad $ operand number in inline asm string: '${:@} Inlined umul_ppmm
> umull ${1:r}, ${0:r}, ${2:r}, ${3:r}'

My guess is that the problem is in mpi/longlong.h

> The iPhone is an arm processor, though I wasn't able to figure out how
> mpih-dev.c got the correct #defines to figure out which assembly macro

mpi/config.links is the script run from configure which figures out
these details and creates some macros.


Salam-Shalom,

Werner

--
Die Gedanken sind frei. Auschnahme regelt ein Bundeschgesetz.


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: compilation errors on iPhone [ In reply to ]
Britt Bolen <britt <at> bolen.com> writes:
> /usr/local/arm-apple-darwin/bin/gcc -DHAVE_CONFIG_H -I. -I. -I..
> -I../src -I/usr/local/arm-apple-darwin/include -g -O2 -Wall -MT
> mpih-div.lo -MD -MP -MF .deps/mpih-div.Tpo -c mpih-div.c -fno-common
> -DPIC -o .libs/mpih-div.o
> Bad $ operand number in inline asm string: '${:@} Inlined umul_ppmm
> umull ${1:r}, ${0:r}, ${2:r}, ${3:r}'
> make[2]: *** [mpih-div.lo] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2

iPhone toolchain's as doesn't like that % stuff in registers (sheesh, that's
apple-patched *gnu as*).

It does compile if rewritten this way:
__asm__ ( \
"umull r1, r0, r2, r3" \
: "=&r" ((USItype)(xh)), \
"=r" ((USItype)(xl)) \
: "r" ((USItype)(a)), \
"r" ((USItype)(b)) \
: "r0", "r1")

but later fails on:

/home/farcaller/develop/iphone/rootfs/home/farcaller/develop/iphone/toolchain/
lib/gcc/arm-apple-darwin/4.0.1/libgcc.a(_udivsi3.o)
has external relocation entries in non-writable section (__TEXT,__text) for
symbols:
___div0
collect2: ld returned 1 exit status


_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel
Re: compilation errors on iPhone [ In reply to ]
"Britt Bolen" <britt@bolen.com> writes:

> I'm trying to build libgcrypt so that I can build vpnc on the iphone,
> but I'm running into a compilation/assembly error that I've not been
> able to solve.
>
> /usr/local/arm-apple-darwin/bin/gcc -DHAVE_CONFIG_H -I. -I. -I..
> -I../src -I/usr/local/arm-apple-darwin/include -g -O2 -Wall -MT
> mpih-div.lo -MD -MP -MF .deps/mpih-div.Tpo -c mpih-div.c -fno-common
> -DPIC -o .libs/mpih-div.o
> Bad $ operand number in inline asm string: '${:@} Inlined umul_ppmm
> umull ${1:r}, ${0:r}, ${2:r}, ${3:r}'
> make[2]: *** [mpih-div.lo] Error 1
> make[1]: *** [all-recursive] Error 1
> make: *** [all] Error 2
>
> The iPhone is an arm processor, though I wasn't able to figure out how
> mpih-dev.c got the correct #defines to figure out which assembly macro
> was actually being called...
>
> anyhow, I was hoping to get some suggestions on workarounds or
> solutions so I can get this built.

Have you tried building with ./configure --disable-asm?

/Simon

_______________________________________________
Gcrypt-devel mailing list
Gcrypt-devel@gnupg.org
http://lists.gnupg.org/mailman/listinfo/gcrypt-devel