Skip to content

Commit

Permalink
[tools] Add diagnostics when a native library turns off -dead_link su…
Browse files Browse the repository at this point in the history
…pport. (#17361)

Co-authored-by: Manuel de la Pena <[email protected]>
  • Loading branch information
rolfbjarne and mandel-macaque authored Jan 26, 2023
1 parent e64bd31 commit 41384c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion tools/common/Assembly.cs
Original file line number Diff line number Diff line change
@@ -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 '{FullPath}', sets SmartLink=false, which will disable passing -dead_strip to the native linker (and make the app bigger).");
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))

4 comments on commit 41384c6

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

@vs-mobiletools-engineering-service2

This comment was marked as outdated.

Please sign in to comment.