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

.NET 6: LLVM AOT doesn't work on MacCatalyst #12484

Closed
akoeplinger opened this issue Aug 19, 2021 · 6 comments · Fixed by #12498
Closed

.NET 6: LLVM AOT doesn't work on MacCatalyst #12484

akoeplinger opened this issue Aug 19, 2021 · 6 comments · Fixed by #12498
Assignees
Labels
bug If an issue is a bug or a pull request a bug fix dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release
Milestone

Comments

@akoeplinger
Copy link
Member

Ported from dotnet/runtime#57589 by @filipnavara

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

  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'
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  
/usr/local/share/dotnet/packs/Microsoft.MacCatalyst.Sdk/15.0.100-preview.7.230/targets/Xamarin.Shared.Sdk.targets(847,3): error : clang++ exited with code 1 [/Users/filipnavara/Projects/llvmbug/llvmbug.csproj]
/usr/local/share/dotnet/packs/Microsoft.MacCatalyst.Sdk/15.0.100-preview.7.230/targets/Xamarin.Shared.Sdk.targets(847,3): error :          [/Users/filipnavara/Projects/llvmbug/llvmbug.csproj]

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.

@akoeplinger akoeplinger added the bug If an issue is a bug or a pull request a bug fix label Aug 19, 2021
@akoeplinger akoeplinger added this to the .NET 6 milestone Aug 19, 2021
@filipnavara
Copy link
Contributor

Thanks, I was just about to repost it but you beat me by a minute :)

@rolfbjarne rolfbjarne added dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release labels Aug 19, 2021
@filipnavara
Copy link
Contributor

Ref: dotnet/runtime#57687

rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Aug 20, 2021
rolfbjarne added a commit to rolfbjarne/xamarin-macios that referenced this issue Aug 20, 2021
rolfbjarne added a commit that referenced this issue Aug 23, 2021
…Fixes #12484. (#12498)

* [xharness] Add LLVM test case for Mac Catalyst.

* [tests] Add make target to build monotouch-test using LLVM on Mac Catalyst.

* [tools] Pass the right arguments to the AOT compiler for Mac Catalyst. Fixes #12484.

Mac Catalyst is just special.

Fixes #12484.
@AraHaan
Copy link

AraHaan commented Sep 17, 2021

I seem to now be hitting this issue with Microsoft.MacCatalyst.Sdk version 15.0.100-rc.2.682.

This is when I try to make an MacOS application targeting both x64 and arm64.

@rolfbjarne
Copy link
Member

@AraHaan please file a new issue, whatever is happening is not the same issue as this one.

@AraHaan
Copy link

AraHaan commented Sep 17, 2021

I found out the issue was that it seems to not like the usage of HttpClient when I have it in a constructor parameter that basically the instance gets passed to it from DependencyInjection and so it blows up at the AOT step.

@rolfbjarne
Copy link
Member

@AraHaan

I found out the issue was that it seems to not like the usage of HttpClient when I have it in a constructor parameter that basically the instance gets passed to it from DependencyInjection and so it blows up at the AOT step.

That sounds like something worthy of a bug report, so we can look into it and maybe fix it.

@ghost ghost locked as resolved and limited conversation to collaborators Apr 27, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug If an issue is a bug or a pull request a bug fix dotnet An issue or pull request related to .NET (6) dotnet-pri0 .NET 6: required for stable release
Projects
None yet
4 participants