diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
index fbcadcc71b5977..607028701561f4 100644
--- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
+++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
@@ -335,7 +335,7 @@ The .NET Foundation licenses this file to you under the MIT license.
<_IgnoreLinkerWarnings>false
<_IgnoreLinkerWarnings Condition="'$(_IsApplePlatform)' == 'true'">true
- -x
+ <_StripFlag Condition="'$(_IsApplePlatform)' == 'true' and '$(IlcExportUnmanagedEntrypoints)' == 'true'">-x
@@ -362,7 +362,7 @@ The .NET Foundation licenses this file to you under the MIT license.
+ strip -no_code_signature_warning $(_StripFlag) "$(NativeBinary)"" />
BuildAndRun
true
true
-
-
- false