Visual Studio 2022 LLVM linking warning

Sammyfreg 21 Reputation points
2022-07-18T04:56:34.21+00:00

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

Visual Studio Setup
Visual Studio Setup
Visual Studio: A family of Microsoft suites of integrated development tools for building applications for Windows, the web and mobile devices.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
960 questions
Not Monitored
Not Monitored
Tag not monitored by Microsoft.
35,882 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tianyu Sun-MSFT 27,106 Reputation points Microsoft Vendor
    2022-07-18T13:00:18.053+00:00

    Hi @Sammyfreg ,

    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.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Sammyfreg 21 Reputation points
    2022-07-19T13:06:08.513+00:00

    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.

    0 comments No comments