-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
[macOS] NativeAOT unable to produce executables when using the Xcode 15 toolchain #92491
Comments
Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas Issue DetailsWhen the new linker from Xcode 15 is used on object files produced by NativeAOT, the Xcode linker crashes. As a workaround it is possible to install Xcode 14.3.1 in parallel and set it as the default toolchain using This affects arm64 and x64 Macs when using the It also affects the experimental ios NativeAOT support. There is already a PR to fix the the underlying issue here: dotnet/llvm-project#471
|
Do we need to fix net7, too? |
macOS and iOS was not supported for NativeAOT on . NET 7, so no
|
Another Xcode 15 breakage was reported in #92297. Preliminary analysis suggests that we hit the same bug with non- A possible fix is to update the assembly code to use Crucially, I didn't audit Mono code or other components that may run into the same issue. |
What would we need to audit:
And I suppose @dalexsoto the macios team should likewise look at their code? @steveisok do we have any xcode15 testing lanes? |
If you emit DWARF or compact unwinding there, yes. I am not sure if, and to what extent, MonoVM does that.
The assembly files and AOT output are the only two things that come to mind. C/C++/ObjC always produces object files with the subsections-via-symbols flag.
They should...but in their case it's slightly less urgent. On the Xcode 15 branch they currently detect the Xcode version and force the old linker to be used by Forcing the old linker is an option, but it's logistically challenging since you need to also detect Xcode tools version. Apple already stated that they will eventually remove the old linker, so this strategy only buys some time. |
We have a scouting queue with an older beta on it. We could probably update it quickly ourselves if need be. |
Seems like Mono is ok:
The app: using System;
using System.Diagnostics;
using System.Runtime.CompilerServices;
public class C {
public static void Main()
{
Helper(20, 10);
}
[MethodImpl(MethodImplOptions.NoInlining)]
public static void Helper (int throwOnFrame, int catchOnFrame)
{
if (throwOnFrame == 0)
throw new Exception("Throwing");
if (catchOnFrame == 0)
{
try {
Helper (throwOnFrame - 1, -1);
} catch (Exception e) {
Console.WriteLine ($"Caught {e}");
var st = new StackTrace (e);
var frames = st.GetFrames();
int frameNum = 0;
foreach (var frame in frames) {
Console.WriteLine ($"frame {frameNum++}: {frame}");
}
}
return;
}
Helper (throwOnFrame - 1, catchOnFrame - 1);
}
} Update: tried our in-tree MacCatalyst sample with the same throw/catch code with mono's asmwriter and with LLVM and both seem to work correctly with Xcode 15. |
I assume this is all resolved and we won't ship something that wouldn't work with xcode 15. |
When the new linker from Xcode 15 is used on object files produced by NativeAOT, the Xcode linker produces artifacts that crash during the first stack walk.
As a workaround it is possible to install Xcode 14.3.1 in parallel and set it as the default toolchain using
xcode-select
.This affects arm64 and x64 Macs when using the
-p:PublishAot=true
option with .NET 8It also affects the experimental ios NativeAOT support.
There is already a PR to fix the the underlying issue here:
I'm opening this issue mostly for tracking purposes
The text was updated successfully, but these errors were encountered: