|
From: Chris C. <ca...@al...> - 2020-12-29 13:26:40
|
On Mon, 28 Dec 2020, at 20:27, Matthew Fluet wrote: > At this point, I would start with a clean checkout, apply your patches > to `darwin.c`, `platform`, and `mlton-script`. The run `make > BOOTSTRAP_STYLE=1 all`. This will use the "old" amd64-darwin MLton to > build a MLton that is an amd64-darwin executable, but should produce > arm64-darwin executables (and then stop the build, rather than > proceeding to build a MLton that is an arm64-darwin executable). Are you sure you mean BOOTSTRAP_STYLE=1 ? That appears to want to build using an existing "local" mlton, which doesn't exist in a clean checkout. Just in case, here is a log for that (from clean checkout + patches you mention): https://all-day-breakfast.com/m/mlton-logs/mlton-bootstrap1-make-all.log The docs seem to suggest that BOOTSTRAP_STYLE=0 does what you describe, so I tried that and it completed successfully. Log: https://all-day-breakfast.com/m/mlton-logs/mlton-bootstrap0-make-all.log The resulting compiler is indeed an amd64 executable that produces arm64 targets and, in simple cases, they run: $ file ./build/lib/mlton/mlton-compile ./build/lib/mlton/mlton-compile: Mach-O 64-bit executable x86_64 $ cat hello.sml val _ = print "Hello, world!\n" $ ./build/bin/mlton hello.sml $ file ./hello ./hello: Mach-O 64-bit executable arm64 $ ./hello Hello, world! My bigger programs still segfault. I ran bin/regression; here's the output: https://all-day-breakfast.com/m/mlton-logs/mlton-bootstrap0-regression.log Looks like many tests work fine, but I see the stringcvt example segfaults: $ ./build/bin/mlton ./regression/stringcvt.sml $ ./regression/stringcvt File stringcvt.sml: Testing structure StringCvt... test1 OK test2 OK test3 OK test4 OK test5 OK test6 OK test7 OK test8 OK Segmentation fault: 11 I tried to get a trace in lldb (note I'm not that familiar with lldb, I'm more used to gdb on linux) - the stack trace as displayed just cycles around for over 80,000 frames. Here's a log containing that session (with the shell commands I used): https://all-day-breakfast.com/m/mlton-logs/mlton-stringcvt-trace.log Chris |