Skip to content

Retain sccsid symbol in native libs - #6830

Merged
jkotas merged 5 commits into
dotnet:mainfrom
am11:chore/sccsid-preservation
May 26, 2026
Merged

jkotas merged 5 commits into
dotnet:mainfrom
am11:chore/sccsid-preservation

Conversation

@am11

@am11 am11 commented May 26, 2026

Copy link
Copy Markdown
Member

@dotnet-policy-service
dotnet-policy-service Bot requested a review from a team May 26, 2026 10:09

@akoeplinger akoeplinger left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

is this because we upgraded to some newer llvm? I wonder if/how far back we need to backport it

@am11

am11 commented May 26, 2026

Copy link
Copy Markdown
Member Author

We started using --gc-sections linker flag (aggressing trimming of binaries) in dotnet/runtime#128232 and @tmds caught it in time.

@akoeplinger

Copy link
Copy Markdown
Member

@am11

am11 commented May 26, 2026

Copy link
Copy Markdown
Member Author

Those are probably not even needed, lets see: dotnet/diagnostics#5856 😅

@janvorli

Copy link
Copy Markdown
Member

Those are probably not even needed, lets see: dotnet/diagnostics#5856

The build of some legs fails due to the removal of the used attribute

@am11

am11 commented May 26, 2026 •

Copy link
Copy Markdown
Member Author

Those are probably not even needed, lets see: dotnet/diagnostics#5856

The build of some legs fails due to the removal of the used attribute

@janvorli, interestingly, dotnet/runtime#128575 is only reported for shared libs from src/native/libs, coreclr libs are retaining sccsid even without this fix (although copilot's PR dotnet/runtime#128232 unconditionally applied the change). I haven't figured out why --gc-sections is less diligent in coreclr subset; sounds like it's leaving some stuff on the table (or perhaps linker has different dead code analyzer for C vs. C++)? My premise of last commit based on @akoeplinger's comment was if it didn't failed in corhlprpriv.h without retain attribute, then used isn't needed; but after a careful look, it's actually difference in compiler toolchain analysis of dead code.

@am11
am11 requested a review from jkotas May 26, 2026 21:40

@jkotas jkotas left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@jkotas
jkotas merged commit 083b78d into dotnet:main May 26, 2026
11 checks passed
@am11
am11 deleted the chore/sccsid-preservation branch May 26, 2026 22:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

source control version string missing in native libraries

4 participants