Okay so after hours and hours of trial & error, I may be the first person to successfully play the FOSS 3D Sandbox Space Sim Spiritual Successor to Elite, Oolite on a Pinebook Pro running Armbian. I have used a chatbot to help compile it into a step-by-step guide that hopefully helps others in the future to get it running as well... Installing & Running Oolite on a Pinebook Pro (Armbian ARM64) 1. Install System Build Dependencies Install the compilers, GNUstep development tools, SDL2, OpenAL, and build utilities required for Oolite 1.90 and SpiderMonkey 1.8.5: bash sudo apt update && sudo apt install -y \
git build-essential clang gobjc gnustep-devel \
libsdl2-dev libopenal-dev libvorbis-dev libpng-dev \
libgl1-mesa-dev libglu1-mesa-dev libespeak-dev libnspr4-dev \
autoconf2.13 autotools-dev zip wget
Use code with caution. 2. Build Standalone Python 2.7.18 (Required by SpiderMonkey 1.8.5) SpiderMonkey 1.8.5's legacy configure script strictly requires Python 2.7. Compile it into /opt/python2 so it stays isolated from Armbian's system Python 3: bash cd /tmp
P="https"
H="www.python.org"
V="2.7.18"
wget "$P://$H/ftp/python/$V/Python-$V.tgz"
tar -xzf "Python-$V.tgz"
cd "Python-$V"
./configure --prefix=/opt/python2
make -j$(nproc)
sudo make install
Use code with caution. 3. Build & Patch SpiderMonkey 1.8.5 (mozillajs-linux) for ARM64 Oolite's pre-compiled Linux binaries only target x86/x86_64, and SpiderMonkey 1.8.5 requires three ARM64 adjustments (aarch64 config scripts, GCC cacheFlush, and disabling the x86/ARMv7 JIT engines): Clone Oolite's patched SpiderMonkey source and update architecture scripts: bash rm -rf /tmp/mozillajs-linux
P="https"; H="github.com"; O="OoliteProject"; R="mozillajs-linux"
git clone --depth 1 "$P://$H/$O/$R.git" /tmp/mozillajs-linux
cd /tmp/mozillajs-linux/js/src
cp /usr/share/misc/config.guess build/autoconf/
cp /usr/share/misc/config.sub build/autoconf/
Use code with caution. Patch ExecutableAllocator.h for ARM64 instruction cache flushing and skip RegexJIT.cpp: bash sed -i 's|#error "The cacheFlush support is missing on this platform."|static void cacheFlush(void* code, size_t size) { __builtin___clear_cache((char*)code, (char*)code + size); }|' assembler/jit/ExecutableAllocator.h
sed -i 's/RegexJIT.cpp//g' Makefile.in
Use code with caution. Configure, build (skipping optional jsapi-tests), and install to /usr/local: bash mkdir -p /tmp/mozillajs-linux/js/src/build
cd /tmp/mozillajs-linux/js/src/build
CXXFLAGS="-O0 -g -fpermissive -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks" \
CFLAGS="-O0 -g -fno-strict-aliasing -fwrapv -fno-delete-null-pointer-checks" \
PYTHON=/opt/python2/bin/python2.7 \
../configure --prefix=/usr/local --enable-threadsafe \
--with-system-nspr --disable-methodjit \
--disable-tracejit --disable-yarr-jit \
--enable-trace-jscalls
sed -i 's/jsapi-tests//g' Makefile
make -j$(nproc)
sudo make install
sudo ldconfig
Use code with caution. 4. Clone & Patch Oolite 1.90 for ARM64 Clone Oolite and check out the 1.90 SDL2 release tag: bash cd ~
P="https"; H="github.com"; O="OoliteProject"; R="oolite"
git clone "$P://$H/$O/$R.git" ~/oolite
cd ~/oolite
git checkout 1.90
git submodule update --init --recursive
Use code with caution. Remove bundled libpng-1.4.7 headers (so Oolite compiles against Armbian's system libpng-1.6.x and loads PNG textures properly): bash find deps -name "png*.h" -delete
Use code with caution. Patch OOCPUInfo.h and OOCPUInfo.m (sets little-endian byte order for aarch64 and bypasses x86 cpuid assembly): bash python3 -c '
import re
# Patch OOCPUInfo.h for ARM64 little-endian
h = "src/Core/OOCPUInfo.h"
s = open(h).read()
s = s.replace("#error Neither OOLITE_BIG_ENDIAN nor OOLITE_LITTLE_ENDIAN is defined as nonzero!", "")
i = s.rfind("#endif")
patch = "\n#undef OOLITE_BIG_ENDIAN\n#undef OOLITE_LITTLE_ENDIAN\n#define OOLITE_BIG_ENDIAN 0\n#define OOLITE_LITTLE_ENDIAN 1\n#undef OOLITE_HAVE_CPUID\n"
open(h, "w").write(s[:i] + patch + s[i:])
# Patch OOCPUInfo.m to remove x86 cpuid assembly and return ARM64
m = "src/Core/OOCPUInfo.m"
sm = open(m).read()
sm = re.sub(r"__asm__\s+__volatile__\s*\(.*?\);", "(void)0;", sm, flags=re.S)
sm = re.sub(r"(OOCPUDescription\s*\([^)]*\)\s*\{)", r"\1\n\treturn @\"ARM64\";", sm, count=1)
open(m, "w").write(sm)
'
Use code with caution. 5. Compile Oolite (-fno-pie -no-pie) Build Oolite with -fno-pie and LDFLAGS="-no-pie" so the executable code and global symbols stay in low virtual memory below SpiderMonkey's 47-bit pointer limit: bash cd ~/oolite
source /usr/share/GNUstep/Makefiles/GNUstep.sh
CPATH=/usr/local/include/js:/usr/include/SDL2 LIBRARY_PATH=/usr/local/lib \
make -f Makefile release \
USER_OBJCFLAGS="-fno-pie" \
USER_CFLAGS="-fno-pie" \
LDFLAGS="-no-pie"
Use code with caution. (Note: If make stalls at the final cp -rf DebugOXP/Debug.oxp line after make[1]: Leaving directory, press Ctrl + C and copy Resources manually:) bash rm -rf AddOns/Basic-debug.oxp
cp -r --update=none Resources oolite.app/
Use code with caution. 6. Build the 47-Bit Memory Wrapper (arm64_lowmem.so) SpiderMonkey 1.8.5 uses 47-bit pointer tagging (0x00007fffffffffff), whereas ARM64 Linux maps heap allocations into 48-bit space (0x0000ffff...). Compile this LD_PRELOAD wrapper to keep mmap and malloc allocations within the lower 47 bits: bash cd ~/oolite
cat << 'EOF' > arm64_lowmem.c
#define _GNU_SOURCE
#include <dlfcn.h>
#include <stdint.h>
#include <sys/mman.h>
#include <unistd.h>
static void *(*real_mmap)(void *, size_t, int, int, int, off_t) = NULL;
static uintptr_t next_hint = 0x0000100000000000ULL;
void *mmap(void *addr, size_t len, int prot, int flags, int fd, off_t off) {
if (!real_mmap) real_mmap = dlsym(RTLD_NEXT, "mmap");
if (addr == NULL && !(flags & MAP_FIXED)) {
size_t ps = (size_t)sysconf(_SC_PAGESIZE);
size_t aligned = (len + ps - 1) & ~(ps - 1);
uintptr_t h = __atomic_fetch_add(&next_hint, aligned, __ATOMIC_RELAXED);
if (h + aligned < 0x00007f0000000000ULL) {
void *p = real_mmap((void *)h, len, prot, flags, fd, off);
if (p != MAP_FAILED && ((uintptr_t)p + len) < 0x0000800000000000ULL)
return p;
if (p != MAP_FAILED) munmap(p, len);
}
}
return real_mmap(addr, len, prot, flags, fd, off);
}
void *mmap64(void *a, size_t l, int p, int f, int fd, off_t o) __attribute__((alias("mmap")));
EOF
gcc -shared -fPIC arm64_lowmem.c -o arm64_lowmem.so -ldl
Use code with caution. 7. Create a Permanent Launcher Command (oolite) Save a wrapper script in ~/.local/bin/oolite so you can launch the game from any terminal (or desktop shortcut) without typing environment variables every time: bash mkdir -p ~/.local/bin
cat << 'EOF' > ~/.local/bin/oolite
#!/bin/bash
source /usr/share/GNUstep/Makefiles/GNUstep.sh
cd ~/oolite
exec env MALLOC_MMAP_THRESHOLD_=0 LD_PRELOAD="$PWD/arm64_lowmem.so" ./oolite.app/oolite
EOF chmod +x ~/.local/bin/oolite Use code with caution. You can now launch the game anytime by running: bash oolite