mlton
mlton copied to clipboard
MLton with musl libc
Hello! It would be great to have official release binaries built against musl.
I seem to recall trying to build MLton against musl on Fedora with a cross compilation toolchain and had some build errors that I didn't fully investigate. I vaguely remember it being something to do with requesting POSIX features.
I managed to build MLton with musl on Void Linux following the instructions in Makefile.
$ make REMOTE_MACHINE=void-linux-host remote-bootstrap
Some details:
$ uname -a
Linux front 5.10.22_1 #1 SMP 1615288648 x86_64 GNU/Linux
$ cat hello.sml
print "hello, world!\n";
$ mlton hello.sml
$ ./hello
hello, world!
$ ldd hello
/lib/ld-musl-x86_64.so.1 (0x7f9d86088000)
libgmp.so.10 => /lib/libgmp.so.10 (0x7f9d85fe5000)
libc.so => /lib/ld-musl-x86_64.so.1 (0x7f9d86088000)
Nice to see that it worked. If you want to contribute that build, then I'd be willing to add it to the releases.
Sorry for the delay... I don't think it's a good idea to add third party build to the releases :)
Fair enough.
I did some experimenting, and it might not be too difficult to build on the ubuntu
GitHub Actions images using musl-gcc
. That would allow it to be a first-party build.
See MLton/mlton#522 and https://github.com/ii8/mlton-builds/releases for a variety of linux-musl
builds.