[NativeAOT] Another attempt to prevent stripping exported symbols from executables...
authorIvan Povazan <55002338+ivanpovazan@users.noreply.github.com>
Thu, 11 May 2023 14:52:57 +0000 (16:52 +0200)
committerGitHub <noreply@github.com>
Thu, 11 May 2023 14:52:57 +0000 (07:52 -0700)
src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets
src/tests/nativeaot/GenerateUnmanagedEntryPoints/GenerateUnmanagedEntryPoints.csproj

index fbcadcc..6070287 100644 (file)
@@ -335,7 +335,7 @@ The .NET Foundation licenses this file to you under the MIT license.
     <PropertyGroup>
       <_IgnoreLinkerWarnings>false</_IgnoreLinkerWarnings>
       <_IgnoreLinkerWarnings Condition="'$(_IsApplePlatform)' == 'true'">true</_IgnoreLinkerWarnings>
-      <StripFlag Condition="'$(_IsApplePlatform)' == 'true' and '$(NativeLib)' == 'Shared'">-x</StripFlag> <!-- keep global symbols in dylib -->
+      <_StripFlag Condition="'$(_IsApplePlatform)' == 'true' and '$(IlcExportUnmanagedEntrypoints)' == 'true'">-x</_StripFlag> <!-- keep only global symbols -->
     </PropertyGroup>
 
     <!-- write linker script for lld (13+) to retain the __modules section -->
@@ -362,7 +362,7 @@ The .NET Foundation licenses this file to you under the MIT license.
     <Exec Condition="'$(StripSymbols)' == 'true' and '$(_IsApplePlatform)' == 'true' and '$(NativeLib)' != 'Static'"
       Command="
         dsymutil $(DsymUtilOptions) &quot;$(NativeBinary)&quot; &amp;&amp;
-        strip -no_code_signature_warning $(StripFlag) &quot;$(NativeBinary)&quot;" />
+        strip -no_code_signature_warning $(_StripFlag) &quot;$(NativeBinary)&quot;" />
   </Target>
 
   <Target Name="CreateLib"
index 9f73f30..db5f074 100644 (file)
@@ -4,9 +4,6 @@
     <CLRTestKind>BuildAndRun</CLRTestKind>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <IlcExportUnmanagedEntrypoints>true</IlcExportUnmanagedEntrypoints>
-    
-    <!-- Stripping symbols causes problems for running the test on macOS -->
-    <StripSymbols>false</StripSymbols>
   </PropertyGroup>
 
   <ItemGroup>