Skip to content

Commit

Permalink
Revert "Do not include -dead_strip when native linking a NativeAOT ob…
Browse files Browse the repository at this point in the history
…ject file (#18553)"

This reverts commit f212f6b.
  • Loading branch information
ivanpovazan committed Jul 1, 2024
1 parent abd6797 commit a613bd6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/dotnet-linker/Steps/ComputeNativeBuildFlagsStep.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using System.Collections.Generic;

using Xamarin.Utils;
using Xamarin.Bundler;

#nullable enable

Expand Down Expand Up @@ -52,8 +51,7 @@ protected override void TryEndProcess ()
Configuration.Application.DeadStrip = false;

var mainLinkerFlags = new List<MSBuildItem> ();
// Do not pass -dead_strip to the native linker with object files generated by NativeAOT compiler as it can cause the linker to seg fault
if (Configuration.Application.DeadStrip && Configuration.Application.XamarinRuntime != XamarinRuntime.NativeAOT) {
if (Configuration.Application.DeadStrip) {
mainLinkerFlags.Add (new MSBuildItem ("-dead_strip"));
}
Configuration.WriteOutputForMSBuild ("_AssemblyLinkerFlags", mainLinkerFlags);
Expand Down

0 comments on commit a613bd6

Please sign in to comment.