You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
lld-link : error : hostmisc\CMakeFiles\hostmisc.dir\trace.cpp.obj: is not a native COFF file. Recompile without /GL?
lld-link : error : hostmisc\CMakeFiles\hostmisc.dir\utils.cpp.obj: is not a native COFF file. Recompile without /GL?
lld-link : error : hostmisc\CMakeFiles\hostmisc.dir\pal.windows.cpp.obj: is not a native COFF file. Recompile without /GL?
lld-link : error : hostmisc\CMakeFiles\hostmisc.dir\__\fxr\fx_ver.cpp.obj: is not a native COFF file. Recompile without /GL?
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
.NET 9
Linking on Arch Linux, with lld-link
Other information
No response
The text was updated successfully, but these errors were encountered:
Windows10CE
changed the title
libnethost is built containing objects with /LTSC enabled
libnethost is built containing objects with /LTCG enabled
Jan 24, 2025
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: