gwatt / chez-exe

Chez Scheme self hosting executable
Other
179 stars 40 forks source link

Compatibility with arm on MacOS #13

Closed rigille closed 3 years ago

rigille commented 3 years ago

Currently the official version of ChezScheme doesn't support MacOS with arm architecture, but Racket's fork does. Unfortunately Racket's fork isn't compatible with chez-exe. For instance my bootpath has no kernel.o

/usr/local/lib/csv9.5.5.4/tarm64osx$ ls
libkernel.a  libz.a   petite.boot  scheme-script.boot scheme.h
liblz4.a  main.o   revision  scheme.boot

I would like to solve those incompatibilities, but I currently don't know how to go about it. Any ideas?

gwatt commented 3 years ago

Hey, this is a bit of a weird one. It looks like the racket folks have decided to change the build process and no longer bundle the 3rd party static libraries needed by chez scheme into kernel.o, and instead produce libkernel.a, which is only the stuff compiled from the chez scheme c source files. I can play with the build process, but I don't have an arm mac, so I can't test that specifically. I can build the racket/cs fork on my computer and test against that, which might get it working for you.

rigille commented 3 years ago

That would be great, I think just testing with the fork is likely to work. If I can help somehow let me know 🙂

c0nn3r commented 3 years ago

./configure has an option --kernelobj which builds kernel.o instead of libkernel.a. You can then link with the libraries that are not included: g++ -I /usr/local/lib/csv9.5.5.5/tarm64osx /usr/local/lib/csv9.5.5.5/tarm64osx/kernel.o -liconv -lcurses main.cpp.

Something I haven't figured out is that (display) seems to be having some weird behavior.

rigille commented 3 years ago

Using --kernelobj is working for me :D What kind of weird behavior did you observe from (display)?

c0nn3r commented 3 years ago

Great! Glad it was helpful :)

I think it's just a result of embedding chez scheme, but I was having issues with (display) not working until it was called a few times.