Spivoxity / obc-3

Oxford Oberon-2 compiler
36 stars 7 forks source link

Building on AArch64 #40

Open LutzWeischerFujitsu opened 3 years ago

LutzWeischerFujitsu commented 3 years ago

echo git-2d17330e5325 | cmp -s revid - || echo git-2d17330e5325 >revid make -C mllib all make[1]: Entering directory '/data/jw/Oberon/Oberon/mllib' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/data/jw/Oberon/Oberon/mllib' make -C yacc all make[1]: Entering directory '/data/jw/Oberon/Oberon/yacc' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/data/jw/Oberon/Oberon/yacc' make -C compiler all make[1]: Entering directory '/data/jw/Oberon/Oberon/compiler' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/data/jw/Oberon/Oberon/compiler' make -C runtime all make[1]: Entering directory '/data/jw/Oberon/Oberon/runtime' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/data/jw/Oberon/Oberon/runtime' make -C lib all make[1]: Entering directory '/data/jw/Oberon/Oberon/lib' make[1]: Nothing to be done for 'all'. make[1]: Leaving directory '/data/jw/Oberon/Oberon/lib' compiler/obc1 -x -g -pl -I lib ./Fac.m >Fac.k runtime/oblink -g -pl -L lib Fac.k -o Fac.x for i in obx; do ./$i ./Fac.x 20; done Fatal error: Bad pointer size make: *** [Makefile:213: sanity] Error 3

AArch64, Fedora 33

Spivoxity commented 3 years ago

Herzliche Grüsse aus Baden-Württemberg, as you didn't take the trouble to say.

The runtime (and especially the garbage collector) relies on using 32-bit pointers. There's a workaround that works on Linux/amd64 by arranging to allocate storage in the bottom 2GB of the address space -- it's enabled in the source by the ifdef M64X32. Perhaps the same will work in Linux/AArch64 if the mmap supports the MAP_32BIT flag. Would you like to paste the man page for mmap here?

This will give us a version of OBC that relies on a bytecode interpreter. It would be more work to write a JIT translator for AArch64. I haven't looked into it myself, but there is already a JIT for 32-bit ARM -- is that called AArch32 now?