Skip to content

Commit 7756c27

Browse files
Enable StripSymbols by default
See discussion in dotnet/sdk#31739 (comment). Once this merges, we should: - [ ] Update the `dotnet new console -aot` template - [ ] Update the `dotnet new api -aot` template - [ ] Update docs and declare different defaults.
1 parent 6b7292c commit 7756c27

File tree

7 files changed

+4
-12
lines changed

7 files changed

+4
-12
lines changed

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ The .NET Foundation licenses this file to you under the MIT license.
204204
</PropertyGroup>
205205

206206
<Error Condition="'$(_WhereSymbolStripper)' != '0' and '$(StripSymbols)' == 'true' and '$(ObjCopyNameAlternative)' != ''"
207-
Text="Symbol stripping tool ('$(ObjCopyName)' or '$(ObjCopyNameAlternative)') not found in PATH. Try installing appropriate package for $(ObjCopyName) or $(ObjCopyNameAlternative) to resolve the problem." />
207+
Text="Symbol stripping tool ('$(ObjCopyName)' or '$(ObjCopyNameAlternative)') not found in PATH. Try installing appropriate package for $(ObjCopyName) or $(ObjCopyNameAlternative) to resolve the problem or set the StripSymbols property to false to disable symbol stripping." />
208208
<Error Condition="'$(_WhereSymbolStripper)' != '0' and '$(StripSymbols)' == 'true' and '$(_IsApplePlatform)' != 'true'"
209-
Text="Symbol stripping tool ('$(ObjCopyName)') not found in PATH. Make sure '$(ObjCopyName)' is available in PATH" />
209+
Text="Symbol stripping tool ('$(ObjCopyName)') not found in PATH. Make sure '$(ObjCopyName)' is available in PATH or set the StripSymbols property to false to disable symbol stripping." />
210210

211211
<Exec Command="command -v dsymutil &amp;&amp; command -v strip" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(_IsApplePlatform)' == 'true' and '$(StripSymbols)' == 'true'">
212212
<Output TaskParameter="ExitCode" PropertyName="_WhereSymbolStripper" />
213213
</Exec>
214214
<Error Condition="'$(_WhereSymbolStripper)' != '0' and '$(StripSymbols)' == 'true' and '$(_IsApplePlatform)' != 'true'"
215-
Text="Symbol stripping tools ('dsymutil' and 'strip') not found in PATH. Make sure 'dsymutil' and 'strip' are available in PATH" />
215+
Text="Symbol stripping tools ('dsymutil' and 'strip') not found in PATH. Make sure 'dsymutil' and 'strip' are available in PATH or set the StripSymbols property to false to disable symbol stripping." />
216216

217217
<Exec Command="dsymutil --help" IgnoreExitCode="true" StandardOutputImportance="Low" Condition="'$(_IsApplePlatform)' == 'true' and '$(StripSymbols)' == 'true'">
218218
<Output TaskParameter="ExitCode" PropertyName="_DsymUtilOutput" />

src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ The .NET Foundation licenses this file to you under the MIT license.
1616

1717
<!-- Set defaults for unspecified properties -->
1818
<PropertyGroup>
19+
<StripSymbols Condition="'$(StripSymbols)' == '' and '$(_targetOS)' != 'win'>true</StripSymbols>
1920
<NativeLib Condition="'$(OutputType)' == 'Library' and '$(NativeLib)' == '' and '$(IlcMultiModule)' != 'true'">Shared</NativeLib>
2021
<NativeIntermediateOutputPath Condition="'$(NativeIntermediateOutputPath)' == ''">$(IntermediateOutputPath)native\</NativeIntermediateOutputPath>
2122
<NativeOutputPath Condition="'$(NativeOutputPath)' == ''">$(OutputPath)native\</NativeOutputPath>

src/coreclr/nativeaot/docs/optimizing.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,3 @@ Since `PublishTrimmed` is implied to be true with Native AOT, some framework fea
4141
* `<IlcOptimizationPreference>Size</IlcOptimizationPreference>`: when generating optimized code, favor smaller code size.
4242
* `<IlcInstructionSet>`: By default, the compiler targets the minimum instruction set supported by the target OS and architecture. This option allows targeting newer instruction sets for better performance. The native binary will require the instruction sets to be supported by the hardware in order to run. For example, `<IlcInstructionSet>avx2,bmi2,fma,pclmul,popcnt,aes</IlcInstructionSet>` will produce binary that takes advantage of instruction sets that are typically present on current Intel and AMD processors. Run `ilc --help` for the full list of available instruction sets. `ilc` can be executed from the NativeAOT package in your local nuget cache e.g. `%USERPROFILE%\.nuget\packages\runtime.win-x64.microsoft.dotnet.ilcompiler\8.0.0-...\tools\ilc.exe` on Windows or `~/.nuget/packages/runtime.linux-arm64.microsoft.dotnet.ilcompiler/8.0.0-.../tools/ilc` on Linux.
4343

44-
## Special considerations for Linux/macOS
45-
46-
Debugging symbols (data about your program required for debugging) is by default part of native executable files on Unix-like operating systems. To strip symbols into a separate file (`*.dbg` on Linux and `*.dwarf` on macOS), set `<StripSymbols>true</StripSymbols>`.
47-
48-
No action is needed on Windows since the platform convention is to generate debug information into a separate file (`*.pdb`).

src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
;RuntimeIdentifier=$(PackageRID)
4949
;NativeAotSupported=$(NativeAotSupported)
5050
;CoreCLRArtifactsPath=$(CoreCLRArtifactsPath)
51-
;StripSymbols=true
5251
;ObjCopyName=$(ObjCopyName)
5352
;R2ROverridePath=$(MSBuildThisFileDirectory)ReadyToRun.targets">
5453
<Output TaskParameter="TargetOutputs"

src/tests/nativeaot/SmokeTests/HardwareIntrinsics/X64Baseline.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<CLRTestTargetUnsupported Condition="'$(TargetArchitecture)' != 'x64'">true</CLRTestTargetUnsupported>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<DefineConstants>$(DefineConstants);BASELINE_INTRINSICS</DefineConstants>
9-
<StripSymbols>true</StripSymbols>
109
</PropertyGroup>
1110
<ItemGroup>
1211
<Compile Include="Program.cs" />

src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<CLRTestTargetUnsupported Condition="'$(TargetArchitecture)' != 'x64'">true</CLRTestTargetUnsupported>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<DefineConstants>$(DefineConstants);NON_VEX_INTRINSICS</DefineConstants>
9-
<StripSymbols>true</StripSymbols>
109
</PropertyGroup>
1110

1211
<ItemGroup>

src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
<CLRTestTargetUnsupported Condition="'$(TargetArchitecture)' != 'x64'">true</CLRTestTargetUnsupported>
77
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
88
<DefineConstants>$(DefineConstants);VEX_INTRINSICS</DefineConstants>
9-
<StripSymbols>true</StripSymbols>
109
</PropertyGroup>
1110

1211
<ItemGroup>

0 commit comments

Comments
 (0)