Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
8170097
Enable symbol stripping for Apple platforms
kotlarmilos Feb 11, 2026
5925853
Revert changes
kotlarmilos Feb 11, 2026
2145b8c
Enable stripping in crossgen2_publish
kotlarmilos Feb 11, 2026
12f4bb4
Merge branch 'main' into bugfix/enable-strip-symbols
MichalStrehovsky Feb 18, 2026
cc0629e
Merge branch 'main' into bugfix/enable-strip-symbols
kotlarmilos Feb 27, 2026
ed67ff4
Merge branch 'main' into bugfix/enable-strip-symbols
kotlarmilos Mar 2, 2026
ca0bba7
Merge branch 'main' into bugfix/enable-strip-symbols
kotlarmilos Mar 4, 2026
b9866fb
Merge branch 'main' into bugfix/enable-strip-symbols
kotlarmilos Mar 11, 2026
0424d5e
Enable debug information generation for Apple targets by adding -glin…
kotlarmilos Mar 12, 2026
6ade1ef
Fix PCM errors by centralizing -gline-tables-only and using -gnone fo…
kotlarmilos Mar 13, 2026
245cbd0
Ignore dsymutil non-fatal .pcm warnings during Apple symbol stripping
kotlarmilos Mar 16, 2026
19820c4
Suppress dsymutil stderr for tool AOT publish on Apple platforms
kotlarmilos Mar 16, 2026
a3583b7
Refactor Apple platform detection and symbol stripping options in AOT…
kotlarmilos Mar 17, 2026
18fbd46
Redirect dsymutil stdout to suppress non-fatal PCM errors
kotlarmilos Mar 18, 2026
264d183
Apply Apple dsymutil settings for all NativeAOT components
kotlarmilos Mar 18, 2026
2cec8eb
Simplify fix: revert CMakeLists and CrossGen.targets changes
kotlarmilos Mar 19, 2026
1e66d6b
Merge branch 'main' into bugfix/enable-strip-symbols
kotlarmilos Mar 20, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions eng/toolAot.targets
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
<Project>
<!-- Settings for tools that publish as AOT -->

<PropertyGroup Condition="'$(AotOrSingleFile)' == 'true' and '$(UseNativeAotForComponents)' == 'true'">
<PublishAot>true</PublishAot>
<PropertyGroup Condition="'$(UseNativeAotForComponents)' == 'true'">
<PublishAot Condition="'$(AotOrSingleFile)' == 'true'" >true</PublishAot>
Copy link

Copilot AI Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is an extra space before the closing angle bracket in the <PublishAot ...> element (... == 'true'" >true). This is inconsistent with the surrounding XML formatting and should be removed to keep the file tidy and avoid noisy diffs in future edits.

Suggested change
<PublishAot Condition="'$(AotOrSingleFile)' == 'true'" >true</PublishAot>
<PublishAot Condition="'$(AotOrSingleFile)' == 'true'">true</PublishAot>

Copilot uses AI. Check for mistakes.
<!--
_IsApplePlatform is defined in the NativeAOT NuGet package targets which are imported after
Directory.Build.targets, so it is not available here. Use PortableOS to detect Apple platforms.
-->
<_IsApplePlatformToolAot Condition="'$(PortableOS)' == 'osx' or '$(PortableOS)' == 'ios' or '$(PortableOS)' == 'iossimulator' or '$(PortableOS)' == 'tvos' or '$(PortableOS)' == 'tvossimulator' or '$(PortableOS)' == 'maccatalyst'">true</_IsApplePlatformToolAot>
<!-- Use .dwarf files instead of .dsym files since our symbol exporting may not safely handle folders. -->
<NativeSymbolExt Condition="'$(_IsApplePlatform)' == 'true'">.dwarf</NativeSymbolExt>
<DsymUtilOptions Condition="'$(_IsApplePlatform)' == 'true'">--flat</DsymUtilOptions>
<NativeSymbolExt Condition="'$(_IsApplePlatformToolAot)' == 'true'">.dwarf</NativeSymbolExt>
<DsymUtilOptions Condition="'$(_IsApplePlatformToolAot)' == 'true'">--flat</DsymUtilOptions>
</PropertyGroup>

<PropertyGroup Condition="'$(AotOrSingleFile)' == 'true' and '$(UseNativeAotForComponents)' != 'true'">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ The .NET Foundation licenses this file to you under the MIT license.
Command="&quot;$(ObjCopyName)&quot; --add-gnu-debuglink=&quot;$(NativeBinary)$(NativeSymbolExt)&quot; &quot;$(NativeBinary)&quot;" />

<Exec Condition="'$(StripSymbols)' == 'true' and '$(_IsApplePlatform)' == 'true' and '$(NativeLib)' != 'Static'"
IgnoreStandardErrorWarningFormat="true"
Command="
dsymutil $(DsymUtilOptions) &quot;$(NativeBinary)&quot; &amp;&amp;
strip -no_code_signature_warning -x &quot;$(NativeBinary)&quot;" />
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/tools/aot/ILCompiler/ILCompiler_publish.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<AotOrSingleFile>true</AotOrSingleFile>
<UseBootstrapLayout Condition="'$(UseBootstrap)' == 'true'">true</UseBootstrapLayout>
<!-- Workaround for dsymutil module cache errors on Apple platforms until https://github.com/dotnet/runtime/pull/123386 -->
<!-- See https://github.com/dotnet/runtime/issues/123687 -->
<StripSymbols Condition="'$(PortableOS)' == 'osx' or '$(PortableOS)' == 'ios' or '$(PortableOS)' == 'tvos' or '$(PortableOS)' == 'maccatalyst'">false</StripSymbols>
</PropertyGroup>

<Import Project="ILCompiler.props" />
Expand Down
3 changes: 0 additions & 3 deletions src/coreclr/tools/aot/crossgen2/crossgen2_publish.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
<TrimmerSingleWarn>false</TrimmerSingleWarn>
<AotOrSingleFile>true</AotOrSingleFile>
<UseBootstrapLayout Condition="'$(UseBootstrap)' == 'true'">true</UseBootstrapLayout>
<!-- Workaround for dsymutil module cache errors on Apple platforms until https://github.com/dotnet/runtime/pull/123386 -->
<!-- See https://github.com/dotnet/runtime/issues/123687 -->
<StripSymbols Condition="'$(PortableOS)' == 'osx' or '$(PortableOS)' == 'ios' or '$(PortableOS)' == 'tvos' or '$(PortableOS)' == 'maccatalyst'">false</StripSymbols>
</PropertyGroup>

<Import Project="crossgen2.props" />
Expand Down
2 changes: 1 addition & 1 deletion src/native/managed/native-library.targets
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
<_StripLike Condition="'$(_StripLike)' == ''">gnu</_StripLike>
</PropertyGroup>

<Exec Command="dsymutil --flat $(LikeCoreCLRDSymUtilMinimizeOpt) $(StripSourceFile)" Condition="'$(_StripLike)' == 'apple'"/> <!-- produces the .dylib.dwarf file -->
<Exec Command="dsymutil --flat $(LikeCoreCLRDSymUtilMinimizeOpt) $(StripSourceFile)" Condition="'$(_StripLike)' == 'apple'" IgnoreStandardErrorWarningFormat="true" /> <!-- produces the .dylib.dwarf file -->
<Exec Command="strip -no_code_signature_warning -S $(StripSourceFile)" Condition="'$(_StripLike)' == 'apple'"/>
<!-- runtime build runs "codesign -f -s - libWhatever.dylib" in release configurations -->
<Exec Command="codesign -f -s - $(StripSourceFile)" Condition="'$(RuntimeConfiguration)' == 'Release' and '$(_StripLike)' == 'apple'" />
Expand Down
1 change: 1 addition & 0 deletions src/tasks/Crossgen2Tasks/Microsoft.NET.CrossGen.targets
Original file line number Diff line number Diff line change
Expand Up @@ -677,6 +677,7 @@ Copyright (c) .NET Foundation. All rights reserved.
<Exec Command="chmod 644 &quot;%(_ReadyToRunNativeObjectOutputs.Identity)&quot;" />

<Exec Condition="'$(StripSymbols)' == 'true'"
IgnoreStandardErrorWarningFormat="true"
Command="
dsymutil $(DsymUtilOptions) &quot;%(_ReadyToRunNativeObjectOutputs.Identity)&quot; &amp;&amp;
strip -no_code_signature_warning -x &quot;%(_ReadyToRunNativeObjectOutputs.Identity)&quot;" />
Expand Down
3 changes: 0 additions & 3 deletions src/tests/Common/XUnitLogChecker/XUnitLogChecker.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
<PublishAot Condition="'$(UseNativeAotForComponents)' == 'true'">true</PublishAot>
<PublishSingleFile Condition="'$(UseNativeAotForComponents)' != 'true'">true</PublishSingleFile>
<SuppressTrimAnalysisWarnings>false</SuppressTrimAnalysisWarnings>
<!-- Workaround for dsymutil module cache errors on Apple platforms until https://github.com/dotnet/runtime/pull/123386 -->
<!-- See https://github.com/dotnet/runtime/issues/123687 -->
<StripSymbols Condition="'$(PortableOS)' == 'osx' or '$(PortableOS)' == 'ios' or '$(PortableOS)' == 'tvos' or '$(PortableOS)' == 'maccatalyst'">false</StripSymbols>
</PropertyGroup>

<ItemGroup>
Expand Down
3 changes: 0 additions & 3 deletions src/tools/ilasm/src/ilasm/ilasm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@
<PublishTrimmed>true</PublishTrimmed>
<AotOrSingleFile>true</AotOrSingleFile>
<UseBootstrapLayout Condition="'$(UseBootstrap)' == 'true'">true</UseBootstrapLayout>
<!-- Workaround for dsymutil module cache errors on Apple platforms until https://github.com/dotnet/runtime/pull/123386 -->
<!-- See https://github.com/dotnet/runtime/issues/123687 -->
<StripSymbols Condition="'$(PortableOS)' == 'osx' or '$(PortableOS)' == 'ios' or '$(PortableOS)' == 'tvos' or '$(PortableOS)' == 'maccatalyst'">false</StripSymbols>
<Nullable>enable</Nullable>
</PropertyGroup>

Expand Down
Loading