[lld] [llvm] [LLD][COFF] Prefetch inputs early-on to improve link times (PR #169224)
Alexandre Ganea via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 22 05:59:03 PST 2026
aganea wrote:
> Hi @aganea
>
> Our team maintains a downstream fork that's been affected by this commit. I'm not sure of the mechanics yet, but when compiling llvm-min-tblgen on Windows, our MSVC lld linker fails due to the added 'willNeedImpl. function. This function calls another added function, loadSystemModuleSecure. The error we get is just that the symbol can't be resolved within the LLVMSupport library.
>
> ```
> lld-link: error: undefined symbol: struct HINSTANCE__* __cdecl llvm::sys::windows::loadSystemModuleSecure(wchar_t const *)
> >>> referenced by LLVMSupport.lib(Path.cpp.obj):(public: __cdecl `private: void __cdecl llvm::sys::fs::mapped_file_region::willNeedImpl(void)'::`1'::<lambda_1>::operator()(void) const)
> ```
>
> While I dig deeper, I was hoping you may understand and be able to help resolve this. I do know we use a moderately outdated MSVC (clang) compiler.
Hello @DragonDisciple !
This is strange since that API was introduced a while back in https://github.com/llvm/llvm-project/commit/860b1e68ea180672d0e02fa8328f4a7c45e16f0f. Which version of MSVC / LLD are you using? And which build system, Ninja? Can you check the exact command line passed to LLD when building `llvm-min-tblgen` and then dump the symbols of the LLVMSupport.lib that is trying to link in? I am indeed seeing that symbol being defined on my end:
```
C:\git\llvm-project>stage1_msvc\bin\llvm-nm.exe --demangle C:\git\llvm-project\stage1_msvc_debug\lib\LLVMSupport.lib | grep loadSystemModuleSecure
000000d8 r $pdata$?loadSystemModuleSecure at windows@sys at llvm@@YAPEAUHINSTANCE__@@PEB_W at Z
000000b8 r $unwind$?loadSystemModuleSecure at windows@sys at llvm@@YAPEAUHINSTANCE__@@PEB_W at Z
00000d00 T struct HINSTANCE__* __cdecl llvm::sys::windows::loadSystemModuleSecure(wchar_t const *)
000006a0 r struct HINSTANCE__* __cdecl llvm::sys::windows::loadSystemModuleSecure(wchar_t const *)
00000650 r struct HINSTANCE__* __cdecl llvm::sys::windows::loadSystemModuleSecure(wchar_t const *)
00000660 r struct HINSTANCE__* __cdecl llvm::sys::windows::loadSystemModuleSecure(wchar_t const *)
```
https://github.com/llvm/llvm-project/pull/169224
More information about the llvm-commits
mailing list