-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable symbol stripping for crossgen2 #82698
Conversation
Do we index the symbols somewhere? |
No. On Windows, we abandon .pdb and create two packages; Similarly, on Unix we create two packages with same content, both with fat binaries (with symbols). The current state of this PR brings Unix to same plan as Windows. |
Thanks! Adding @dotnet/crossgen-contrib for thoughts. It feels like the Windows behavior is a bug. |
412a1e9
to
a65a755
Compare
src/installer/pkg/sfx/Microsoft.NETCore.App/Microsoft.NETCore.App.Crossgen2.sfxproj
Show resolved
Hide resolved
@@ -22,6 +22,8 @@ | |||
<NativeAotSupported Condition="'$(CrossBuild)' == 'true' and '$(TargetOS)' != '$(HostOS)'">false</NativeAotSupported> | |||
<!-- Can't use NativeAOT in source build yet https://github.com/dotnet/runtime/issues/66859 --> | |||
<NativeAotSupported Condition="'$(DotNetBuildFromSource)' == 'true'">false</NativeAotSupported> | |||
<ObjCopyName Condition="'$(ContinuousIntegrationBuild)' == 'true' and '$(CrossBuild)' == 'true' and '$(RuntimeIdentifier)' == 'linux-musl-arm64'">llvm-objcopy-15</ObjCopyName> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbomer has been working on updating build containers for .NET 8 (we cannot use CentOS7 anymore since it is going to be EOL soon).
The updated containers should have recent LLVM version that will make these workarounds unnecessary once we switch to them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't use CentOS container. It uses Ubuntu 22.04 with Alpine Linux 3.13 rootfs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are updating all build containers, not just the ones that use CentOS 7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is already at the latest Ubuntu 22.04. The binutils objcopy in host doesn't support cross-build architecture, which container update will not fix. This workaround is necessary because we don't find the toolchain specific objcopy tool in NativeAOT. This is not a problem with coreclr build, because we use cmake find mechanism to locate toolchain-specific objcopy and other tools.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good if it is something we want to fix quickly. A better fix will come with updated build containers and this workaround will have to be reverted.
@sbomer Is it ok with you to merge this change? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, LGTM for now. Thanks for the heads up!
This reverts commit 6a218ab.
…dotnet#82881)" This reverts commit 13853e5.
crossgen2 in nuget package has a 62M binary on linux-arm64. The size of stripped binary drops to 16M.