-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
LLVM AOT doesn't work on MacCatalyst #57589
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
/cc @imhameed @SamMonoRT |
Update /cc @directhex @akoeplinger - may just be an issue with the AOT compiler task, not with codegen per se |
Tagging subscribers to this area: @directhex Issue DetailsDescriptionExample application (create from empty project with modified .csproj): Configuration.NET 6.0.100-rc.1.21415.3 Regression?It probably never worked? Other information
Looks like the LLVM compiler didn't get passed the
|
the error in Filip's output sure looks that way |
Effectively, we are correctly saying "build a Mac Catalyst app from runtime and these `-llvm.o` files, but the `-llvm.o` files are not correctly being built in a Mac Catalyst compatible way, resulting in the error ``` ld: building for Mac Catalyst, but linking in object file built for , file '/Users/filipnavara/Projects/llvmbug/obj/Debug/net6.0-maccatalyst/maccatalyst-arm64/nativelibraries/aot-output/arm64/llvmbug.dll.llvm.o' ``` The target platform parameter gets passed around a LOT - `src/tasks/AotCompilerTask/MonoAOTCompiler.props` specifies `<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64'" Include="mtriple=arm64-ios" />` which passes through to MonoAOTCompiler.cs task which passes through to the `mono --aot=llvmopts=mtriple=arm64-ios` flag, which is processed by `src/mono/mono/mini/aot-compiler.c` and eventually regurgitated as `llc -mtriple=arm64-ios -march=aarch64`, which results in .o files which lack the required annotations to be considered Catalyst compatible. Thankfully, it seems that `llc` accepts `clang`'s `-target` triplet values as valid for `-mtriple`, so passing through Catalyst specific values for `mtriple` in `MonoAOTCompiler.props` results in .o files which are correctly linked later by `clang` during the AppleAppBuilder task. It's slow though! 🙀 Fixes dotnet#57589
…57687) Effectively, we are correctly saying "build a Mac Catalyst app from runtime and these `-llvm.o` files, but the `-llvm.o` files are not correctly being built in a Mac Catalyst compatible way, resulting in the error ``` ld: building for Mac Catalyst, but linking in object file built for , file '/Users/filipnavara/Projects/llvmbug/obj/Debug/net6.0-maccatalyst/maccatalyst-arm64/nativelibraries/aot-output/arm64/llvmbug.dll.llvm.o' ``` The target platform parameter gets passed around a LOT - `src/tasks/AotCompilerTask/MonoAOTCompiler.props` specifies `<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64'" Include="mtriple=arm64-ios" />` which passes through to MonoAOTCompiler.cs task which passes through to the `mono --aot=llvmopts=mtriple=arm64-ios` flag, which is processed by `src/mono/mono/mini/aot-compiler.c` and eventually regurgitated as `llc -mtriple=arm64-ios -march=aarch64`, which results in .o files which lack the required annotations to be considered Catalyst compatible. Thankfully, it seems that `llc` accepts `clang`'s `-target` triplet values as valid for `-mtriple`, so passing through Catalyst specific values for `mtriple` in `MonoAOTCompiler.props` results in .o files which are correctly linked later by `clang` during the AppleAppBuilder task. It's slow though! 🙀 Fixes #57589
…otnet#57687) Effectively, we are correctly saying "build a Mac Catalyst app from runtime and these `-llvm.o` files, but the `-llvm.o` files are not correctly being built in a Mac Catalyst compatible way, resulting in the error ``` ld: building for Mac Catalyst, but linking in object file built for , file '/Users/filipnavara/Projects/llvmbug/obj/Debug/net6.0-maccatalyst/maccatalyst-arm64/nativelibraries/aot-output/arm64/llvmbug.dll.llvm.o' ``` The target platform parameter gets passed around a LOT - `src/tasks/AotCompilerTask/MonoAOTCompiler.props` specifies `<MonoAOTCompilerDefaultAotArguments Condition="'$(TargetArchitecture)' == 'arm64'" Include="mtriple=arm64-ios" />` which passes through to MonoAOTCompiler.cs task which passes through to the `mono --aot=llvmopts=mtriple=arm64-ios` flag, which is processed by `src/mono/mono/mini/aot-compiler.c` and eventually regurgitated as `llc -mtriple=arm64-ios -march=aarch64`, which results in .o files which lack the required annotations to be considered Catalyst compatible. Thankfully, it seems that `llc` accepts `clang`'s `-target` triplet values as valid for `-mtriple`, so passing through Catalyst specific values for `mtriple` in `MonoAOTCompiler.props` results in .o files which are correctly linked later by `clang` during the AppleAppBuilder task. It's slow though! 🙀 Fixes dotnet#57589
Description
Example application (create from empty project with modified .csproj):
Archive.zip
Configuration
.NET 6.0.100-rc.1.21415.3
macOS 12.0 Beta
Xcode 13 beta 4 (iirc)
Regression?
It probably never worked?
Other information
Looks like the LLVM compiler didn't get passed the
-target arm64-apple-ios14.2-macabi
. Note that other targets use-mtriple=...
which doesn't work on MacCatalyst AFAIK.The text was updated successfully, but these errors were encountered: