question

Sammyfreg-5260 avatar image
0 Votes"
Sammyfreg-5260 asked Sammyfreg-5260 answered

Visual Studio 2022 LLVM linking warning

It seems that using the LLVM toolchain without DLL runtime libraries generates some warning.

Visual Studio 2022 (17.2.4)
Note: This was working properly in Visual Studio 2019.

Repro
1. Install Visual Studio 2022 with LLVM toolset support
2. Create a new C++ console App Project
3. Change the Project property General => Platform Toolset from Visual Studio 2022 to LLVM
4. Compile the project (should be compiling fine)
5. Change the Project property C/C++ => Code Generation => Runtime Library from Multi-threaded debug DLL to Multi-threaded debug
6. Compile the Project (it should give you warnings)


Excerpt of the warnings:

 1>------ Build started: Project: ConsoleApplication1, Configuration: Debug x64 ------
 1>lld-link : warning : procedure symbol record for `std::out_of_range::~out_of_range` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\xthrow.obj refers to PDB item index 0x1357 which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `std::out_of_range::`scalar deleting destructor'` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\xthrow.obj refers to PDB item index 0x1356 which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `_vsprintf_s_l` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\locale.obj refers to PDB item index 0x12D9 which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `sprintf_s` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\locale.obj refers to PDB item index 0x12E0 which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `std::_Iterator_base12::_Iterator_base12` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\wlocale.obj refers to PDB item index 0x1339 which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `std::_Iterator_base12::~_Iterator_base12` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\wlocale.obj refers to PDB item index 0x133B which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `std::_Iterator_base12::operator=` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\wlocale.obj refers to PDB item index 0x133A which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `std::_Iterator_base12::_Adopt` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\wlocale.obj refers to PDB item index 0x133C which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `std::_Iterator_base12::_Assign_locked` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\wlocale.obj refers to PDB item index 0x133F which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `std::_Iterator_base12::_Assign_unlocked` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\wlocale.obj refers to PDB item index 0x133E which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `std::_Iterator_base12::_Getcont` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\wlocale.obj refers to PDB item index 0x133D which is not a valid function ID record
 1>lld-link : warning : procedure symbol record for `wmemset` in D:\a\_work\1\s\Intermediate\vctools\libcpmt.nativeproj_658832323\objd\amd64\wlocale.obj refers to PDB item index 0x12EC which is not a valid function ID record
 . . .

Note: Associated stackoverflow question
https://stackoverflow.com/questions/72687650/getting-a-visual-studio-2022-clang-linking-error-on-libcpmt-about-some-pdb-issue/73017196#73017196















vs-setupvs-msbuild
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

TianyuSun-MSFT avatar image
0 Votes"
TianyuSun-MSFT answered

Hi @Sammyfreg-5260 ,

Thanks for taking time to post this issue in Microsoft Q&A forum.

It’s probably a potential issue or a kind of side effect. There’s a similar issue reported before, see this thread: Lots of IID-link warnings about PDB with VS 2022 17.1.0 and Clang-cl 13. Could you raise a new ticket on our Developer Community - C++ for further investigate?

Thanks for helping us make VS better.

Best Regards,
Tianyu


If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Sammyfreg-5260 avatar image
0 Votes"
Sammyfreg-5260 answered

It does seems to be exactly the same issue, and seems like it might be fixed with LLVM 14.0.3?

I mostly wanted the team to be aware, so I will just continue using the DLL runtime library in the meantime.

Thank you.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.