From 7756c27ffdcb41dcad6e5af24713c638d17259f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20Strehovsk=C3=BD?= Date: Fri, 21 Apr 2023 12:21:06 +0900 Subject: [PATCH] Enable `StripSymbols` by default See discussion in https://github.com/dotnet/sdk/pull/31739#discussion_r1164126543. 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. --- .../BuildIntegration/Microsoft.NETCore.Native.Unix.targets | 6 +++--- .../BuildIntegration/Microsoft.NETCore.Native.targets | 1 + src/coreclr/nativeaot/docs/optimizing.md | 5 ----- .../Microsoft.NETCore.App.Crossgen2.sfxproj | 1 - .../SmokeTests/HardwareIntrinsics/X64Baseline.csproj | 1 - .../SmokeTests/HardwareIntrinsics/x64NonVex.csproj | 1 - .../nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj | 1 - 7 files changed, 4 insertions(+), 12 deletions(-) diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets index 27955fd6bc22c..bee052f2a26f8 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.Unix.targets @@ -204,15 +204,15 @@ The .NET Foundation licenses this file to you under the MIT license. + 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." /> + 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." /> + 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." /> diff --git a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets index a0c5cbae672eb..65d952b311837 100644 --- a/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets +++ b/src/coreclr/nativeaot/BuildIntegration/Microsoft.NETCore.Native.targets @@ -16,6 +16,7 @@ The .NET Foundation licenses this file to you under the MIT license. + Shared $(IntermediateOutputPath)native\ $(OutputPath)native\ diff --git a/src/coreclr/nativeaot/docs/optimizing.md b/src/coreclr/nativeaot/docs/optimizing.md index c64f49bda4426..6521dfd61423f 100644 --- a/src/coreclr/nativeaot/docs/optimizing.md +++ b/src/coreclr/nativeaot/docs/optimizing.md @@ -41,8 +41,3 @@ Since `PublishTrimmed` is implied to be true with Native AOT, some framework fea * `Size`: when generating optimized code, favor smaller code size. * ``: 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, `avx2,bmi2,fma,pclmul,popcnt,aes` 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. -## Special considerations for Linux/macOS - -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 `true`. - -No action is needed on Windows since the platform convention is to generate debug information into a separate file (`*.pdb`). diff --git a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj index e442fdcfc4189..c28c6ea8fb53c 100644 --- a/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj +++ b/src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj @@ -48,7 +48,6 @@ ;RuntimeIdentifier=$(PackageRID) ;NativeAotSupported=$(NativeAotSupported) ;CoreCLRArtifactsPath=$(CoreCLRArtifactsPath) - ;StripSymbols=true ;ObjCopyName=$(ObjCopyName) ;R2ROverridePath=$(MSBuildThisFileDirectory)ReadyToRun.targets"> true true $(DefineConstants);BASELINE_INTRINSICS - true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj index 86c1e23e9dfa5..5e8d35d67bf3d 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64NonVex.csproj @@ -6,7 +6,6 @@ true true $(DefineConstants);NON_VEX_INTRINSICS - true diff --git a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj index d485e9dae32cc..983436eab7d79 100644 --- a/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj +++ b/src/tests/nativeaot/SmokeTests/HardwareIntrinsics/x64Vex.csproj @@ -6,7 +6,6 @@ true true $(DefineConstants);VEX_INTRINSICS - true