[Openmcl-devel] CCL on Big Sur and Apple M1 chips

Robert Munyer 2420506348 at munyer.com
Tue May 23 14:57:20 PDT 2023


Having recently acquired an SBC [*] with the right kind of SoC
(Allwinner A64), on which I'm running Debian Gnu/Linux, and having been
convinced by the writings of Göran Weinholt that ARM64 is a reasonably
decent ISA for a Lisp compiler, I came here to offer to do an ARM64
port, and found this thread already in progress!

Please count me in, especially for the parts of the project that can
reasonably be done on Linux.

I currently have CCL 1.12.1 running natively on my ARM64 device,
in 64-bit Debian "testing", passing 21,904 of 21,908 tests.

Here are my notes about building and testing CCL on this device.
Unfortunately the M1 processor doesn't have the feature that I'm using
here ("AArch32"), so you can't just straightforwardly reproduce this on
M1, but this still could be useful for bootstrapping the M1/M2 port.
If you don't use aptitude, I think you can replace the four aptitude
commands with "apt-get update", "apt-get upgrade" and "apt-get install ...".

# using privileged account:
dpkg --add-architecture armhf
aptitude update
aptitude forget-new
aptitude safe-upgrade
aptitude install curl gcc-arm-linux-gnueabihf git libc6:armhf m4 make
# using unprivileged account:
mkdir ~/ccl-armhf
cd ~/ccl-armhf
git clone --branch v1.12.1 --depth 1 https://github.com/Clozure/ccl.git
# fix a bug in 1.12.1!
sed -i~ /altivec_available/d ccl/lisp-kernel/arm-exceptions.h
# linuxarm.tar.gz is missing from v1.12.1, so use an older one.
wget https://github.com/Clozure/ccl/releases/download/v1.12/linuxarm.tar.gz
tar xpzf linuxarm.tar.gz -C ccl
curl -JLOR https://github.com/Clozure/ccl-tests/archive/refs/heads/master.tar.gz
mkdir ccl-tests
tar xpzf ccl-tests-master.tar.gz -C ccl-tests --strip-components=1
mkdir bin
(echo '#!' /bin/sh
echo exec $(command -v make) '"$@"'\
 AS=arm-linux-gnueabihf-as\
 CC=arm-linux-gnueabihf-gcc\\ -mfpu=vfpv3-d16\
 LD=arm-linux-gnueabihf-ld
) > bin/make
chmod +x bin/make
PATH="$PWD/bin:$PATH" ccl/armcl -n -e '(ccl:rebuild-ccl :full t)'
ccl/armcl -n -e '(test-ccl :update nil :exit t)'

Four of the 21,908 tests fail: EXPT.ERROR.4 through EXPT.ERROR.7.

[*] Acronym glossary: SBC = single-board computer, SoC = system on a
chip, ARM = Acorn RISC machine, ISA = instruction-set architecture,
RISC = reduced-instruction-set computing.


More information about the Openmcl-devel mailing list