Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[9.0] libnethost no LTCG #113893

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

Merged

Conversation

jkoritzinsky
Copy link
Member

@jkoritzinsky jkoritzinsky commented Mar 25, 2025

Fixes Issue #113183

main PR #111805 (slimmed down for servicing)

Description

Ensure that libnethost isn't built with the /LTCG flag, so users can use any version of MSVC to build their native .NET host using libnethost.

Customer Impact

Users can't use the static libnethost unless they build their native host with the same compiler that we build .NET 9.0 with.

LTCG (link-time code-gen) requires the customer to use the exact same version of MSVC that we used if they want to build. We are reverting the flags to the old list (ensuring we don't specify LTCG for any object files in the libnethost static library). The only policy we have is that we can't put LTCG objects in any static library we ship

Regression

Yes, regressed in #102475

Testing

Locally validated that the libnethost static library doesn't have any files built with LTCG.

Risk

Low risk. Only affects users of libnethost.

Package authoring signed off?

IMPORTANT: If this change touches code that ships in a NuGet package, please make certain that you have added any necessary package authoring and gotten it explicitly reviewed.

@jkoritzinsky jkoritzinsky added this to the 9.0.x milestone Mar 25, 2025
@Copilot Copilot AI review requested due to automatic review settings March 25, 2025 20:22
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review any files in this pull request.

Files not reviewed (2)
  • src/native/corehost/hostmisc/CMakeLists.txt: Language not supported
  • src/native/corehost/nethost/CMakeLists.txt: Language not supported

Copy link
Contributor

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Copy link
Member

@jeffschwMSFT jeffschwMSFT left a comment

Choose a reason for hiding this comment

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

lgtm. please get a code review. we will take for consideration in 9.0.x

@jeffschwMSFT jeffschwMSFT added the Servicing-consider Issue for next servicing release review label Mar 25, 2025
@rbhanda rbhanda modified the milestones: 9.0.x, 9.0.5 Apr 1, 2025
@rbhanda rbhanda added Servicing-approved Approved for servicing release and removed Servicing-consider Issue for next servicing release review labels Apr 1, 2025
@carlossanlop
Copy link
Member

Friendly reminder that code complete is on April 14th for the May Release. If you'd like to get this change included in that release, please get a Tactics approval and merge this PR before that date.

@jkoritzinsky jkoritzinsky merged commit fb0873b into dotnet:release/9.0-staging Apr 2, 2025
151 checks passed
@jkoritzinsky jkoritzinsky deleted the nethost-noltcg-9.0 branch April 2, 2025 19:03
@alexrp
Copy link
Contributor

alexrp commented Apr 19, 2025

Ensure that libnethost isn't built with the /LTCG flag, so users can use any version of MSVC to build their native .NET host using libnethost.

Not that it changes anything, but just for the record, it's also important for the use case of non-Microsoft linkers such as lld-link, as these of course can't process MSVC's LTCG IR at all.

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-Host Servicing-approved Approved for servicing release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants