From 5e4acb7957c31bcbd5c602ca3f78f42b704ba598 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 24 Jan 2023 15:21:35 +0100 Subject: [PATCH 1/3] [tools] Add diagnostics when a native library turns off -dead_link support. --- tools/common/Assembly.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/common/Assembly.cs b/tools/common/Assembly.cs index f70970d35a73..84b2ed4f2ad4 100644 --- a/tools/common/Assembly.cs +++ b/tools/common/Assembly.cs @@ -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).") 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)) From 4b913cadf16d0597dff77d666296839959dce74b Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Wed, 25 Jan 2023 08:53:30 +0100 Subject: [PATCH 2/3] Update tools/common/Assembly.cs Co-authored-by: Manuel de la Pena --- tools/common/Assembly.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/common/Assembly.cs b/tools/common/Assembly.cs index 84b2ed4f2ad4..d273a6a0623e 100644 --- a/tools/common/Assembly.cs +++ b/tools/common/Assembly.cs @@ -308,7 +308,7 @@ void ProcessNativeReferenceOptions (NativeReferenceMetadata metadata) { // We can't add -dead_strip if there are any LinkWith attributes where smart linking is disabled. 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).") + 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)."); App.DeadStrip = false; } From 4d1ba37e7184bb390f958051e1f4d93968b345e6 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Thu, 26 Jan 2023 10:12:31 +0100 Subject: [PATCH 3/3] Fix property name. --- tools/common/Assembly.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/common/Assembly.cs b/tools/common/Assembly.cs index d273a6a0623e..fbc3814db4e6 100644 --- a/tools/common/Assembly.cs +++ b/tools/common/Assembly.cs @@ -308,7 +308,7 @@ void ProcessNativeReferenceOptions (NativeReferenceMetadata metadata) { // We can't add -dead_strip if there are any LinkWith attributes where smart linking is disabled. 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)."); + 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; }