Skip to content

Commit

Permalink
[release/7.0.1xx] [dotnet/tools] Don't disable compact unwind info. F…
Browse files Browse the repository at this point in the history
…ixes #16546. (#16769)

Don't disable compact unwind info in the native linker, it may break C++
exception handling.

We originally disabled compact unwind info to fix a warning from the native
linker, this will have to be solved another way (in any case extra build
warnings is preferrable compared to an app crashing at runtime due to broken
C++ exception handling).

This partially reverts c05e774.

Fixes #16546.

Backport of #16623

Co-authored-by: Rolf Bjarne Kvinge <[email protected]>
  • Loading branch information
1 parent 0abd8f4 commit b32abc6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 12 deletions.
5 changes: 0 additions & 5 deletions dotnet/targets/Xamarin.Shared.Sdk.targets
Original file line number Diff line number Diff line change
Expand Up @@ -1156,11 +1156,6 @@
<_LinkNativeExecutableInputs Include="@(_XamarinMainLibraries)" />
<_LinkNativeExecutableInputs Include="@(_FileNativeReference)" />
</ItemGroup>

<ItemGroup Condition="'$(_XamarinRuntime)' == 'MonoVM' And $([MSBuild]::VersionGreaterThanOrEquals('$(_XcodeVersion)','14.0'))">
<_MainLinkerFlags Include="-Wl,-no_compact_unwind" />
<_MainLinkerFlags Include="-Wl,-keep_dwarf_unwind" />
</ItemGroup>
</Target>

<!-- Any .dylibs we link with might have an incorrect identity (see https://github.com/xamarin/xamarin-macios/issues/13999),
Expand Down
7 changes: 0 additions & 7 deletions tools/common/CompilerFlags.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,13 +141,6 @@ public void LinkWithMono ()
}
AddOtherFlag ("-lz");
AddOtherFlag ("-liconv");

if (Driver.XcodeVersion.Major >= 14 && Application.BitCodeMode == BitCodeMode.None) {
// This solves a warning:
// ld: warning: could not create compact unwind for _BrotliBuildHistogramsWithContext: registers 27 not saved contiguously in frame
AddOtherFlag ("-Wl,-no_compact_unwind");
AddOtherFlag ("-Wl,-keep_dwarf_unwind");
}
}

public void LinkWithXamarin ()
Expand Down

3 comments on commit b32abc6

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 [CI Build] Build failed 🔥

Build failed for the job 'Build packages'

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 [CI Build] Build failed 🔥

Build failed for the job 'Detect API changes'

Pipeline on Agent
Hash: [CI build]

@vs-mobiletools-engineering-service2
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔥 Unable to find the contents for the comment: D:\a\1\s\change-detection\results\gh-comment.md does not exist :fire

Pipeline on Agent
Hash: b32abc6c5bad99e4eedc0d31536cc40689236652 [CI build]

Please sign in to comment.