xamarin / xamarin-macios

.NET for iOS, Mac Catalyst, macOS, and tvOS provide open-source bindings of the Apple SDKs for use with .NET managed languages such as C#
Other
2.47k stars 514 forks source link

NativeAOT: re-enable dead stripping #18605

Closed rolfbjarne closed 4 months ago

rolfbjarne commented 1 year ago

We've disabled passing -dead_strip to ld for NativeAOT:

It should be re-enabled once this is fixed:

ivanpovazan commented 4 months ago

Once https://github.com/dotnet/runtime/commit/d9a66070026c9133fade4e61a60d00aec170bfc4 flows in, we should try enable -dead_strip by default with NativeAOT.

akoeplinger commented 4 months ago

Is xamarin-macios still using ld_classic? then I assume it'd still be affected by https://github.com/dotnet/runtime/issues/88032

ivanpovazan commented 4 months ago

Is xamarin-macios still using ld_classic? then I assume it'd still be affected by https://github.com/dotnet/runtime/issues/88032

Yes ld_classic is still used (this will have to be fixed as the option is getting removed by Apple in XCode 16).

https://github.com/dotnet/runtime/issues/88032 reported an issue that occasionally monotouch-test crashes the platform linker. However, at that time object file produced by NativeAOT was not marking all symbols as non-strippable.

The idea is to try turning -dead_strip back on and track if it is going to cause any failures.

rolfbjarne commented 4 months ago

Fixed in #20796.