Nikos Mavrogiannopoulos nmav@gnutls.org writes:
Trying to build nettle 2.7 for an arm10 system of mine using its (old) toolchain fails with assembler errors.
arm-linux-gcc -Os -I[...] -I. -DHAVE_CONFIG_H -g -O2 -ggdb3 -Wno-pointer-sign -Wall -W -Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wpointer-arith -Wbad-function-cast -Wnested-externs -fpic -MT aes-decrypt-internal.o -MD -MP -MF aes-decrypt-internal.o.d -fpic -c aes-decrypt-internal.s aes-decrypt-internal.s: Assembler messages: aes-decrypt-internal.s:81: Error: bad instruction `push {r4,r5,r6,r7,r8,r10,r11,lr}' aes-decrypt-internal.s:87: Error: register or shift expression expected -- `orr r4,r8,lsl#8' aes-decrypt-internal.s:89: Error: register or shift expression expected -- `orr r4,r8,lsl#16' aes-decrypt-internal.s:91: Error: register or shift expression expected -- `orr r4,r8,lsl#24' aes-decrypt-internal.s:93: Error: bad arguments to instruction -- `eor r4,r8' [...] make[2]: *** [aes-decrypt-internal.o] Error 1
I recently got a similar bugreport from a user with an arm system running freebsd with an ancient GNU as. I think it would make sense to use more traditional ARM asm syntax. Things I'm aware of:
1. Always use 3-operand form instructions, i.e.,
add r1, r1, r2
rather then
add r1, r2
2. Write shift and rotate instructions as mov with a shift/rotate operand.
3. Add explicit ia/db suffixes on push, pop, ldm, stm.
4. Some file uses "unified" assembler syntax. Revert to traditional arm syntax (unless we have a good reason to support compiling to thumb instructions? I don't really understand pros and cons there).
I don't have time to test that right now, but patches are welcome. Is it a common enough problem that it motivates a bug-fix release?
Regards, /Niels