-
Notifications
You must be signed in to change notification settings - Fork 5k
libnethost is built containing objects with /LTCG enabled #111788
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
Comments
Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov |
You mean Related issue #71056 |
@jkoritzinsky can you look at the cmake config here? |
Yep I’ll take a look. |
jkoritzinsky
added a commit
to jkoritzinsky/runtime
that referenced
this issue
Jan 28, 2025
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Description
nethost has this inside its build configuration:
https://github.com./dotnet/runtime/blob/main/src/native/corehost/nethost/CMakeLists.txt#L54-L60
fxr_resolver, which nethost depends on, also contains this:
https://github.com./dotnet/runtime/blob/main/src/native/corehost/fxr/staticlib/CMakeLists.txt#L39-L45
However, hostmisc, also bundled into nethost, does not strip
/LTCG
from its arguments, and builds with it enabled. This is then brought in as a dependency of nethost, causing nethost to not be able to be linked with any other linker than link.exe.Reproduction Steps
Attempting to use lld-link to link nethost with anything should reproduce this, but I do not know if this is actually the case on Windows.
Expected behavior
nethost can be linked against using any linker, as seems to be the original intention.
Actual behavior
nethost fails to be linked against with other linkers, as they do not recognize the whole program opts information:
Regression?
Unsure.
Known Workarounds
Manually building nethost with the same /LTCG opt out in hostmisc/CMakeLists.txt causes things to work as intended again.
Configuration
Other information
No response
The text was updated successfully, but these errors were encountered: