From 59a468929b85f69e8fe134cf01308693cb127e0e Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Tue, 25 Apr 2023 09:43:28 +0200 Subject: [PATCH 1/2] Do not strip exported symbols from executables when explicitly specified --- .../BuildIntegration/Microsoft.NETCore.Native.targets | 1 + .../GenerateUnmanagedEntryPoints.csproj | 3 --- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 6f0920d555c4ce..6cd5fe1388628b 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -336,6 +336,7 @@ The .NET Foundation licenses this file to you under the MIT license. <_IgnoreLinkerWarnings>false <_IgnoreLinkerWarnings Condition="'$(_IsApplePlatform)' == 'true'">true -x + -i -s $(ExportsFile) diff --git a/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj b/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj index 9f73f30aa0b24f..db5f0741f8d419 100644 --- a/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj +++ b/src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj @@ -4,9 +4,6 @@ BuildAndRun true true - - - false From 75b8127156551e5e22ba5fe963a8faeeed0d6400 Mon Sep 17 00:00:00 2001 From: Ivan Povazan Date: Tue, 25 Apr 2023 14:38:24 +0200 Subject: [PATCH 2/2] Add '_' prefix to StripFlag internal project property --- .../BuildIntegration/Microsoft.NETCore.Native.targets | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index 6cd5fe1388628b..2ead5803e5ceac 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -335,8 +335,8 @@ The .NET Foundation licenses this file to you under the MIT license. <_IgnoreLinkerWarnings>false <_IgnoreLinkerWarnings Condition="'$(_IsApplePlatform)' == 'true'">true - -x - -i -s $(ExportsFile) + <_StripFlag Condition="'$(_IsApplePlatform)' == 'true' and '$(NativeLib)' == 'Shared'">-x + <_StripFlag Condition="'$(_IsApplePlatform)' == 'true' and '$(NativeLib)' != 'Shared' and '$(IlcExportUnmanagedEntrypoints)' == 'true'">-i -s $(ExportsFile) @@ -363,7 +363,7 @@ The .NET Foundation licenses this file to you under the MIT license. + strip -no_code_signature_warning $(_StripFlag) "$(NativeBinary)"" />