-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mono] Build native osx-arm64 versions of the cross compilers #74175
Comments
I stumbled on this today trying to build a .NET MAUI app on my M1 mac:
It would be great if our tools worked natively for arm64. Even the Apple support doc says:
|
arm64, arm, wasm: builds
x86:
This is VASTLY better than I expected, tbh. The build system appears to already do everything right - the problem area is x86/x64 targets. @lambdageek can you help with the runtime internals issues? |
We will need to create new "packs" for this work, correct? Today building a MAUI app uses |
@eerhardt correct. That's the easy part. |
Wait, I'm wrong, it's less good than I thought. My tests were on an M1 Macbook - it does the right thing there for 3 target arches. It absolutely does not do the right thing on x64 (i.e. how our CI is set up). |
Made some initial progress (compiling android-arm64 cross compiler for linux-arm64 on linux-x64 - compiling works but linking fails due to us trying to use linux-x64 LLVM) |
Windows (win-arm64) has the same issue, we're about to add emulated cross compilers for that case. |
We currently have:
My aim is to additionally support:
However, nothing I'm writing is hardcoded enough that we couldn't whimsically decide to build... a maccatalyst-arm64 cross-compiler for linux-ppc64le or something. We can hammer out the details once we have cross compilers building for |
Currently, I am trying to rearchitect something I was never particularly happy with - to wit, we have I have successfully produced |
Removing windows-arm64 cross-compilers from scope for this issue. Right now we can't even build a basic JIT for windows-arm64, and trying to fix that is a distinct issue from trying to build cross-compilers there. |
(Update @lambdageek says: a newer version of this table is in #82495 (comment))
The way the cross-compiler build is structured, we have an all-or-nothing approach for all architectures supported by a given OS - which is to say, if you say Reproducing the issue locallyYou'll need some offset files for a broken target. Go to the latest build on https://dev.azure.com/dnceng/public/_build?definitionId=686&_a=summary&branchFilter=149480 and click on the published artifacts. Scroll down to Unzip the zip file into Now, you can do an AOT build: Linux:
Mac:
You can also use this method to build your own arm64 cross-compiler for browser-wasm, by using |
This change enables building arbitrary cross-compilers for non-x64 hosts. Right now, only osx-arm64->browser-wasm and linux-arm64->browser-wasm are actually enabled, as runtime bugs prevent us from building any arm64->x86 or arm64->x64 cross-compilers. Getting this framework in will unblock workload work related to "native" wasm on M1 Mac. == BREAKING CHANGE FOR DEVELOPERS == MonoAOTLLVMDir no longer exists. Old: `/p:MonoLLVMDir=/path/to/llvm` specifies the directory with LLVM binaries compiled for `$(TargetArchitecture)`, for compiling the Mono JIT on that target architecture `/p:MonoAOTLLVMDir=/path/to/llvm` specifies the directory with LLVM binaries compiled for `$(BuildArchitecture)`, for compiling the mono-aot-cross executable ``` New: `/p:MonoLLVMDir=/path/to/llvm` specifies a parent-level directory with LLVM binaries compiled for relevant architectures - e.g. `$(MonoLLVMDir)\x64` contains LLVM built for `x64`, current OS. `$(MonoLLVMDir)\arm64 contains LLVM built for arm64`, current OS. You do not need to specify `/p:MonoLLVMDir=` manually, unless you are a developer who may be using custom, non-nupkg LLVM. This change is necessary to stop hardcoding the assumptions that a) `$(BuildArchitecture)` is always `x64` and b) AOT binaries should be compiled for $(BuildArchitecture) Closes: #74175
In .NET 6 we ship
mono-aot-cross
targeting our various platforms as anosx-x64
executable and rely on Rosetta to run it.We should investigate if we can ship alternative runtime packs that include
osx-arm64
compilers.First step is to figure out if there are any issues building
osx-arm64
hosted versions of the cross-compilers.The text was updated successfully, but these errors were encountered: