Skip to content
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 runtime fails to build cross-compilers for x86/x64 on arm/arm64 #82495

Closed
Tracked by #4476
directhex opened this issue Feb 22, 2023 · 9 comments
Closed
Tracked by #4476

Mono runtime fails to build cross-compilers for x86/x64 on arm/arm64 #82495

directhex opened this issue Feb 22, 2023 · 9 comments
Assignees
Labels
area-VM-meta-mono runtime-mono specific to the Mono runtime
Milestone

Comments

@directhex
Copy link
Contributor

directhex commented Feb 22, 2023

Splitting out the issues described in #74175, especially the comments #74175 (comment) and #74175 (comment)

As-is, we cannot build cross-compilers from arm64 to x64, so we cannot build cross-compilers for osx-arm64 to iOS, tvOS, Android, or Mac Catalyst. The same problem applies for Linux cross-compilers to Android. The build system is ready on the mono.proj etc side, it's problems with the Mono runtime itself.

@rdavisau
Copy link

In case it's useful, unscientific testing on my M1 showed using arm64 binaries for mono-aot-cross and friends made the aot compile task 30%-35% faster across a variety of projects.

image

@lambdageek lambdageek added this to the 8.0.0 milestone Jul 17, 2023
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jul 17, 2023
lambdageek added a commit to lambdageek/runtime that referenced this issue Jul 17, 2023
lambdageek added a commit that referenced this issue Jul 18, 2023
This PR allows an `osx-arm64` or `osx-x64` machine to produce a `mono-aot-cross` compiler that will run on the following host and create AOT images for the following targets:

| Host | Target | Test App runs |
|--------|--------|--------|
| osx-arm64 | iossimulator-x64 | ✅  |
| osx-arm64 | android-x64 | ✅   |
| osx-arm64 | android-x86 | ✅  - depends on a hack for #89039 | 

Additionally a `linux-x64` or `linux-arm64` machine can build a `mono-aot-cross` compiler for these host/target pairs:

| Host | Target | Test App runs |
|--------|--------|--------|
| linux-arm64 | android-x64 | ❓ |
| linux-arm64 | linux_musl-x64 | ❓ |
| linux-arm64 | android-x86 | ❓ |

Related to #82495

* [aot][ios] Build cross-compilers targeting x64 hosted on arm64

* Use MONO_CROSS_COMPILE instead of host checks

* [android][x86] Build mono-aot-cross hosted on osx-arm64 targeting android-x86

* fix build of mono-aot-cross hosted on linux-arm64 targeting android-x64

* runtime pipeline changes to build arm64 artifacts on x64 hardware

* Fix linux_musl-arm64 builds

---------

Co-authored-by: Jo Shields <directhex@apebox.org>
@lambdageek
Copy link
Member

lambdageek commented Jul 18, 2023

After #74715 and #89027 I think this is our status now (updating the table from #74175 (comment)):

Build machine Cross-compiler target Executing machine Status
linux-x64 browser-wasm linux-arm64
linux-x64 android-x64 linux-arm64
linux-x64 android-arm64 linux-arm64 ⚠ Builds, disabled in #74175
linux-x64 android-x86 linux-arm64 ☑, ⚠ may need #89039 for local builds
linux-x64 android-arm linux-arm64 ⚠ Builds, disabled in #74175
win-x64 browser-wasm win-arm64 ☠ Does not build, removed from scope
win-x64 android-x64 win-arm64 ☠ Does not build, removed from scope
win-x64 android-arm64 win-arm64 ☠ Does not build, removed from scope
win-x64 android-x86 win-arm64 ☠ Does not build, removed from scope
win-x64 android-arm win-arm64 ☠ Does not build, removed from scope
osx-x64 browser-wasm osx-arm64
osx-x64 android-x64 osx-arm64
osx-x64 android-arm64 osx-arm64 ⚠ Builds, disabled in #74175
osx-x64 android-x86 osx-arm64
osx-x64 android-arm osx-arm64 ⚠ Builds, disabled in #74175
osx-x64 ios-arm64 osx-arm64 ⚠ Builds, disabled in #74175
osx-x64 iossimulator-arm64 osx-arm64 ⚠ Builds, disabled in #74175
osx-x64 iossimulator-x64 osx-arm64
osx-x64 iossimulator-x86 osx-arm64 ❌ Does not build - ❓ is this still supported
osx-x64 ios-arm osx-arm64 ⚠ Builds, disabled in PR - ❓ is this still supported
osx-x64 tvos-arm64 osx-arm64 ⚠ Builds, disabled in #74175
osx-x64 tvossimulator-arm64 osx-arm64 ⚠ Builds, disabled in #74175
osx-x64 tvossimulator-x64 osx-arm64
osx-x64 maccatalyst-arm64 osx-arm64 ⚠ Builds, disabled in #74175
osx-x64 maccatalyst-x64 osx-arm64

I'm not sure what "disabled in #74175 means" - I think it means the CI pipelines were disabled. Some of them may be back on as part of #89027 @directhex

@directhex
Copy link
Contributor Author

Just meant "disabled in the PR I'm trying to get merged"

Do we still support any scenarios where iossimulator-x86 or ios-arm matter? IOS dropped support for 32-bit ARM with iOS 11 (2017). I can't easily determine when x86 support for the simulator was dropped, but I imagine it's the same thing if the whole-ass OS lost 32-bit support at once.

What's the minimum iOS version we support?

@steveisok
Copy link
Member

@directhex No, we do not support x86 and arm on ios any longer.

@akoeplinger what's the min iOS version we are targeting in .NET 8?

@directhex
Copy link
Contributor Author

We should kill them for 8 then

@steveisok
Copy link
Member

We should kill them for 8 then

@akoeplinger did in #81965

I also found iOS 11 is the min we support for .NET 8

steveisok pushed a commit to steveisok/runtime that referenced this issue Aug 3, 2023
…, and android where possible

As a result of dotnet#89027 and dotnet#74715, we can now build native arm64 cross compilers on linux and macos. This change adds the right references to the workload manifest so that they can be installed with maui and the mobile SDK's.

win-arm64 is the only arm64 platform left and that is a work in progress.

Contributes to dotnet#82495

Fixes dotnet/maui#4476
steveisok added a commit that referenced this issue Aug 4, 2023
…, and android where possible (#89961)

As a result of #89027 and #74715, we can now build native arm64 cross compilers on linux and macos. This change adds the right references to the workload manifest so that they can be installed with maui and the mobile SDK's.

win-arm64 is the only arm64 platform left and that is a work in progress.

Contributes to #82495

Fixes dotnet/maui#4476
@SamMonoRT
Copy link
Member

Assigning to @directhex for accurate tracking.
@steveisok @directhex - should we move this to 9.0, or is the remaining work essential to ship 8.0 release ?

@steveisok
Copy link
Member

I think 9.0 is fine. There's really no time to test the win-arm64 cross compiler. That's the only one left in the bunch.

@steveisok steveisok modified the milestones: 8.0.0, 9.0.0 Aug 11, 2023
@directhex
Copy link
Contributor Author

directhex commented Aug 11, 2023 via email

@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-VM-meta-mono runtime-mono specific to the Mono runtime
Projects
None yet
Development

No branches or pull requests

5 participants