Closed bcr closed 8 months ago
I'm digging into it some more. I think the core is that macos-latest
is 12.6.9 on Intel, so the compiler builds x86_64 single architecture.
I found this link that might be useful about building fat binaries (strategy 1 above), still reading. https://discourse.llvm.org/t/build-runtimes-for-the-same-archs-as-llvm/71522
I was under the impression that M1's could emulate x86_64 for backwards compatibility. In general on the great majority of projects, compilation time for llvm-mos is negligible.
I also note that GitHub recently added M1 runners, so it should technically be possible to run llvm-mos automated tests on that target.
I was under the impression that M1's could emulate x86_64 for backwards compatibility.
I think the way that Apple has chosen to do this is the same as the migration from the IBM ARM processors to the Intel processors -- they have a translation service called Rosetta that handles running code for the non-native platform. For the original Rosetta, they supported it for I think five years and then stopped. For the current Rosetta we are four years into the transition, so there's a real potential for support to end in the next year or so.
As far as I can tell this is fixed with llvm-mos/llvm-mos#274 -- I was able to download the latest artifact.zip and compile and run the k_console_test
in the x16 emulator.
Whoops, some local binaries are made in this project also. Reopening, but I've got a PR ready.
Looks good based on the prerelease archive.
➜ ~ file ~/llvm-mos/bin/mos-sim
/Users/blake/llvm-mos/bin/mos-sim: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64Mach-O 64-bit executable arm64]
/Users/blake/llvm-mos/bin/mos-sim (for architecture x86_64): Mach-O 64-bit executable x86_64
/Users/blake/llvm-mos/bin/mos-sim (for architecture arm64): Mach-O 64-bit executable arm64
I have an M1 Mac with no Rosetta and @jroweboy pointed out that the Mac binaries are x86_64 right now.
I presume there's two options:
I presume there's some risk that building for arm64 opens a can of worms (doesn't work for some reason.)