Description
It seems that, for Windows platforms, the libnethost.lib static library shipped with the .NET SDK is built with LTCG enabled, rendering it entirely unusable by non-MSVC toolchains such as Zig or just plain LLD on its own.
I'm not sure LTCG meaningfully benefits libnethost anyway, so I would argue it should just be disabled here.
Reproduction Steps
#define NETHOST_USE_AS_STATIC
#include "nethost.h"
int main()
{
char_t buffer[4096];
size_t buffer_size = sizeof(buffer) / sizeof(char_t);
(void)get_hostfxr_path(buffer, &buffer_size, NULL);
}
zig cc test.c /path/to/libnethost.lib
Expected behavior
The program should link successfully.
Actual behavior
$ zig cc test.c libnethost.lib
lld-link: error: unknown file type: nethost\CMakeFiles\libnethost.dir\nethost.cpp.obj
Regression?
No.
Known Workarounds
Building from source with LTCG off (presumably), but this is a pretty big inconvenience.
Configuration
- .NET SDK 6.0.6
- Windows x64
Other information
No response
Description
It seems that, for Windows platforms, the
libnethost.libstatic library shipped with the .NET SDK is built with LTCG enabled, rendering it entirely unusable by non-MSVC toolchains such as Zig or just plain LLD on its own.I'm not sure LTCG meaningfully benefits libnethost anyway, so I would argue it should just be disabled here.
Reproduction Steps
zig cc test.c /path/to/libnethost.libExpected behavior
The program should link successfully.
Actual behavior
Regression?
No.
Known Workarounds
Building from source with LTCG off (presumably), but this is a pretty big inconvenience.
Configuration
Other information
No response