#33 ARM fixes

Jerry James

As reported recently on the mailing list, I have had some problems with clisp failing to build on ARM platforms. WIth the help of Google and the ARM assembly language reference manual, I think I have all the problems sorted out now. The illegal instruction problem I reported is due to lines like this:

LDMFD sp!, {v1,v2,v3,v4,v5,v6,pc}^

The trailing carat indicates that this is a return-from-exception. But it isn't. All instances of this in the code are normal function returns. This patch eliminates all such trailing carats. After doing that, I again hit an illegal instruction, this time on a line of this form:

MOVEQS pc, lr

That form of the instruction has been deprecated, and is apparently now illegal on whatever Fedora's koji builders use. The new way to do that is this:


which the assembly language reference manual says is also friendlier to the branch prediction logic. However, that instruction is not available on ARM v4 and earlier. That doesn't cause me any issues, since Fedora only supports ARM v5 and later, but if you want to support those earlier versions, you may need a macro that expands to the existing form for v4 and earlier, and the new form for v5 and later.

GCC 4.7 also wants functions to have the appropriate ELF type, so I added the appropriate magic to the GLABEL macro.


  • Jerry James
    Jerry James

    Patch to fix building on ARM