AOT compile aot-instances.dll, the AOT compiler exited with code 139.
Description
After upgrading to Xcode 16 and upgrading source code to version 9 we are getting this error.
IL stripping assemblies
12:01:24 Tool /usr/local/share/dotnet/packs/Microsoft.NETCore.App.Runtime.AOT.osx-arm64.Cross.ios-arm64/9.0.0/Sdk/../tools/mono-aot-cross execution finished (exit code = 139).
12:01:24
12:01:24 /usr/local/share/dotnet/packs/Microsoft.iOS.Sdk.net9.0_18.0/18.0.9617/targets/Xamarin.Shared.Sdk.targets(1277,3): error : Failed to AOT compile aot-instances.dll, the AOT compiler exited with code 139.
Steps to Reproduce
Build a release version for iOS.
Link to public reproduction project repository
No response
Version with bug
9.0.10 SR1
Is this a regression from previous behavior?
No, this is something new
Last version that worked well
8.0.100 SR10
Affected platforms
iOS
Affected platform versions
No response
Did you find any workaround?
No response
Relevant log output
Why did you close this ticket ? Did you find a workaround ? I have the same issue
Why did you close this ticket ? Did you find a workaround ? I have the same issue
I opened the issue in the xamarin-ios repository and ultimately it was routed to the runtime repository.
https://github.com/dotnet/runtime/issues/110003#issuecomment-2506439925
I have the same issue, my current workaround in release builds are these settings (maybe some are not necessary, but my sanity is already gone, maybe it helps somebody)
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-ios18.1|AnyCPU'">
<MtouchLink>None</MtouchLink> <!-- Disable code linking entirely -->
<MtouchUseLlvm>True</MtouchUseLlvm> <!-- Disable LLVM compilation -->
<EnableSGenConc>True</EnableSGenConc> <!-- Disable concurrent garbage collection -->
<NoSymbolStrip>true</NoSymbolStrip>
<MtouchNoSymbolStrip>True</MtouchNoSymbolStrip>
<EmbedOnDemandResources>True</EmbedOnDemandResources>
<SuppressTrimAnalysisWarnings>True</SuppressTrimAnalysisWarnings> <!-- Suppress warnings -->
<EnableTrimAnalyzer>False</EnableTrimAnalyzer> <!-- Disable the trim analyzer -->
<MtouchExtraArgs>--aot=verbose</MtouchExtraArgs>
<MtouchExtraArgs>--aot-options=limit-llvm-stack=400MB</MtouchExtraArgs>
<MtouchExtraArgs>--aot=threads=1</MtouchExtraArgs>
<MtouchInterpreter>True</MtouchInterpreter>
</PropertyGroup>
I have the same issue, my current workaround in release builds are these settings (maybe some are not necessary, but my sanity is already gone, maybe it helps somebody)
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-ios18.1|AnyCPU'"> <MtouchLink>None</MtouchLink> <!-- Disable code linking entirely --> <MtouchUseLlvm>True</MtouchUseLlvm> <!-- Disable LLVM compilation --> <EnableSGenConc>True</EnableSGenConc> <!-- Disable concurrent garbage collection --> <NoSymbolStrip>true</NoSymbolStrip> <MtouchNoSymbolStrip>True</MtouchNoSymbolStrip> <EmbedOnDemandResources>True</EmbedOnDemandResources> <SuppressTrimAnalysisWarnings>True</SuppressTrimAnalysisWarnings> <!-- Suppress warnings --> <EnableTrimAnalyzer>False</EnableTrimAnalyzer> <!-- Disable the trim analyzer --> <MtouchExtraArgs>--aot=verbose</MtouchExtraArgs> <MtouchExtraArgs>--aot-options=limit-llvm-stack=400MB</MtouchExtraArgs> <MtouchExtraArgs>--aot=threads=1</MtouchExtraArgs> <MtouchInterpreter>True</MtouchInterpreter> </PropertyGroup>
Thank you for sharing this, it worked for me ! I was going crazy
I have the same issue, my current workaround in release builds are these settings (maybe some are not necessary, but my sanity is already gone, maybe it helps somebody)
<PropertyGroup Condition="'$(Configuration)|$(TargetFramework)|$(Platform)'=='Release|net9.0-ios18.1|AnyCPU'"> <MtouchLink>None</MtouchLink> <!-- Disable code linking entirely --> <MtouchUseLlvm>True</MtouchUseLlvm> <!-- Disable LLVM compilation --> <EnableSGenConc>True</EnableSGenConc> <!-- Disable concurrent garbage collection --> <NoSymbolStrip>true</NoSymbolStrip> <MtouchNoSymbolStrip>True</MtouchNoSymbolStrip> <EmbedOnDemandResources>True</EmbedOnDemandResources> <SuppressTrimAnalysisWarnings>True</SuppressTrimAnalysisWarnings> <!-- Suppress warnings --> <EnableTrimAnalyzer>False</EnableTrimAnalyzer> <!-- Disable the trim analyzer --> <MtouchExtraArgs>--aot=verbose</MtouchExtraArgs> <MtouchExtraArgs>--aot-options=limit-llvm-stack=400MB</MtouchExtraArgs> <MtouchExtraArgs>--aot=threads=1</MtouchExtraArgs> <MtouchInterpreter>True</MtouchInterpreter> </PropertyGroup>
Thank you for the contribution. ### Unfortunately this didn't fix my issue. I hope this issue gets resolved soon.