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:
BXEQ lr
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.
Patch to fix building on ARM
Tried using this patch, still doesn't work, I tried patching it for Alpine 3.8.
I don't know what you mean by "still" or "doesn't work". Be more specific please.
I'm terribly sorry, I saw some bug reports and work done on other bug reports and assumed it's well known.
Well, I'm trying to install sbcl for armhf in Alpine 3.8 on RPi3B+, the only thing matters here is the architecture used for the kernel, in my case ARMv7 (ARMv8 - aarch64 is supported but it doesn't matter, same thing happens).
Since there was no package I tried downloading the same files as appear in the APKBUILD definition (the file used by Alpine to describe all the different aspect of installing the products alongside relevant patches and required configuration).
Since sbcl does not compile without the clisp package I had to build the package manually (I'd rather use the package manager, apk, for dependency sake), so when I tried compiling it there was only a single patch called no-page.h.patch which is part of the x86_64 package, so I downloaded and configured the patch above (only this one first) and then when it didn't work I tried all the other patches deleted from this repository:
https://github.com/archlinuxarm/PKGBUILDs/ (I just searched for clisp and found all the relevant data from pull requests).
Despite all that I'm getting the exact same error which is:
…
The full log can be found here:
https://hastebin.com/upinoriyuh.bash
Thank you and sorry for the misunderstanding.