Open svenha opened 1 year ago
Please use the i3le target, which is a 32-bit Intel architecture on Linux.
x32 ABI is not i386, but more like x86-64 with 32bit pointers, see https://en.wikipedia.org/wiki/X32_ABI for details. You get the benefits of x86-64 (more registers, more instructions) without the memory overhead. The downside: your process cannot use more than 4 GB.
You could try modifying address-bits and ptr-bits in s/a6le.def
and s/ta6le.def
and see what happens.
@melted Thanks for the suggestions. I also changed ptrdiff_t-bits
and size_t-bits
(from 64 to 32), but the error message is the same.
I returned to the issue with a current git version.
Good news is that I ended up with a usable pb/scheme
, which is an X32 binary:
pb/bin/pb/scheme: ELF 32-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /libx32/ld-linux-x32.so.2, BuildID[sha1]=2b0a68bb0e47dbfb0e2b6b45f7619eee514bbb38, for GNU/Linux 3.4.0, not stripped
The make
step ends now as follows:
running pb/bin/pb/scheme to build all at once
loading ta6le cross compiler
compiling s/library.ss with output to xc-ta6le/s/library.ta6le
Exception in assembler-internal: ax-ea-imm-data size=quad imm-data=(literal 33 (library #(libspec nonprocedure-code 160)))
failed
in build-one
in loop
in module->hash
make: *** [Makefile:10: build] Error 1
For context, this is how I build chez-scheme:
CC=gccx32 ./configure --installprefix=/usr/local # gccx32 is script specifying gcc -mx32
sed -i.orig -e 's/-m64 /-mx32 /g' -e 's/ -Werror/ / g' -e 's/elf_x86_64/elf32_x86_64/g' ta6le/Mf-config
sed -i.orig -e 's/ptr-bits 64/ptr-bits 32/g' s/a6.def
sed -i.orig -e 's/ long-bits .*/ long-bits 64)/g' s/default.def
make
Hello.
I was able to build the
scheme
binary for the x32 ABI. I am interested in the x32 ABI because it can give significant speedups for GC-intensive programs and reduce memory usage by 50 % (observed for other Schemes like bigloo).The following error during make shows that there seems to be some asserts or assumptions that differ for x32 compared to x86-64. Can I just modify them? If so, where and how?
I built the x32 binary by modifying the build process as follows (one needs x32 versions of ncurses, libuuid, libz, liblz4):