mlton
mlton copied to clipboard
MLton for PowerPC: any interest in having pre-built versions?
@MatthewFluet This is not really “an issue”, but a suggestion. If there is some interest in having pre-built MLton for macOS PowerPC (at least 32-bit), I can build the latest release of 2021 and submit binaries to you. The build process is transparent (everything is mlton
portfile), Macports environment is assumed, though I could probably modify it to a static build, if that is necessary (not in Macports, we do not want that, since even 2007 version works fine with our gmp
, but for this specific endeavor).
Cannot guarantee it builds for Tiger, but Leopard and Snow Leopard will work.
Having ppc binaries would be fine, especially if adding them to the GitHub release artifacts makes them a stable target for various bootstrap files.
@MatthewFluet Noted. Let me sort out remaining Intel builds, so that I can finalize a port, for now, and I can build PPC binaries.
P. S. On a side note, is there a non-ugly way to fix platform for Rosetta build? Build itself works fine, and MLton works (unlike, say, GHC or SBCL, which segfault on start in Rosetta), however current MLton build system does not guess the arch correctly, and that breaks compilation (I would expect it to detect Intel, however it actually chose PowerPC, but ppc64, which cannot possibly work in Rosetta, there are no ppc64 slices in the OS anymore).
What I did to make it work was patching platform to define arch = powerpc
. This will work as a local fix in Macports (for a combo of 10.6 + ppc), but is not great, and obviously completely non-portable.
This is not a matter of substantial importance at all, I just remembered I wanted to ask. It is a common problem with all ports relying on uname
– it has no idea of emulating the arch. When host/target triples are supported, things work nicely.
If you know the target platform, then you can compile with make TARGET_ARCH=powerpc
, which will bypass whatever ./bin/platform
would determine.
The trouble with macOS is that there are lots of complicated defaulting rules, like if the host process is running in amd64, then cc defaults to generating amd64 code. We've tried to work around them at various times (and I thought that it was mostly working, look through old issues).
One complication in MLton with supporting target triples is that we need to execute (not just build) a target program to extract things like #define constants for inlining into SML code (see the gen/constants
target of ./runtime/Makefile
).
@MatthewFluet Sorry for ridiculous delays. My build set-up on 10.5 is broken and I have no time to sort it out…
However here are compiled binaries for 10.6 ppc: http://macos-powerpc.org/packages/mlton (The same portfile from MacPorts master is used, but MacPorts do not have ppc buildbots at the moment.)