Skip to content
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

[tools] Add diagnostics when a native library turns off -dead_link support. #17361

Merged
merged 3 commits into from
Jan 26, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion tools/common/Assembly.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,8 +307,10 @@ void AssertiOSVersionSupportsUserFrameworks (string path)
void ProcessNativeReferenceOptions (NativeReferenceMetadata metadata)
{
// We can't add -dead_strip if there are any LinkWith attributes where smart linking is disabled.
if (!metadata.SmartLink)
if (!metadata.SmartLink) {
Driver.Log (3, $"The library '{metadata.LibraryName}', shipped with the assembly '{FullName}', sets SmartLink=false, which will disable passing -dead_strip to the native linker (and make the app bigger).")
rolfbjarne marked this conversation as resolved.
Show resolved Hide resolved
App.DeadStrip = false;
}

// Don't add -force_load if the binding's SmartLink value is set and the static registrar is being used.
if (metadata.ForceLoad && !(metadata.SmartLink && App.Registrar == RegistrarMode.Static))
Expand Down