[all-commits] [llvm/llvm-project] 0dcf92: [llvm] add ProfileData to yaml2obj and obj2yaml LL...

Andrew Rogers via All-commits all-commits at lists.llvm.org
Tue Jul 8 08:49:39 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 0dcf924f37269295b505a16176008503159b9860
      https://github.com/llvm/llvm-project/commit/0dcf924f37269295b505a16176008503159b9860
  Author: Andrew Rogers <andrurogerz at gmail.com>
  Date:   2025-07-08 (Tue, 08 Jul 2025)

  Changed paths:
    M llvm/tools/obj2yaml/CMakeLists.txt
    M llvm/tools/yaml2obj/CMakeLists.txt

  Log Message:
  -----------
  [llvm] add ProfileData to yaml2obj and obj2yaml LLVM_LINK_COMPONENTS (#147344)

## Purpose
Add `ProfileData` to `LLVM_LINK_COMPONENTS` for the `yaml2obj` and
`obj2yaml` tools so they link properly when LLVM is built as a Windows
DLL.

## Background
`ProfileData` appears to be a missing dependency from `yaml2obj` and
`obj2yaml`, but when LLVM is built statically it picks-up the required
`LLVMPasses` symbols from a transitive dependency (presumably). When
LLVM is built as a Windows DLL, `yaml2obj` and `obj2yaml` fail to link 3
symbols from `ProfileData` without this change:

```
LLVMCore.lib(Verifier.cpp.obj) : error LNK2019: unresolved external symbol "class std::error_category const & __cdecl llvm::instrprof_category(void)" (?instrprof_category at llvm@@YAAEBVerror_category at std@@XZ) referenced in function "public: virtual class std::error_code __cdecl llvm::InstrProfError::convertToErrorCode(void)const " (?convertToErrorCode at InstrProfError@llvm@@UEBA?AVerror_code at std@@XZ)
LLVMCore.lib(Verifier.cpp.obj) : error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl llvm::InstrProfError::message(void)const " (?message at InstrProfError@llvm@@UEBA?AV?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@XZ)
LLVMCore.lib(Verifier.cpp.obj) : error LNK2019: unresolved external symbol "public: static char llvm::InstrProfError::ID" (?ID at InstrProfError@llvm@@2DA) referenced in function "void __cdecl llvm::handleAllErrors<class `public: static struct std::pair<enum llvm::instrprof_error,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > __cdecl llvm::InstrProfError::take(class llvm::Error)'::`2'::<lambda_1> >(class llvm::Error,class `public: static struct std::pair<enum llvm::instrprof_error,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > > __cdecl llvm::InstrProfError::take(class llvm::Error)'::`2'::<lambda_1> &&)" (??$handleAllErrors at V<lambda_1>@?1??take at InstrProfError@llvm@@SA?AU?$pair at W4instrprof_error@llvm@@V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@std@@VError at 4@@Z@@llvm@@YAXVError at 0@$$QEAV<lambda_1>@?1??take at InstrProfError@0 at SA?AU?$pair at W4instrprof_error@llvm@@V?$basic_string at DU?$char_traits at D@std@@V?$allocator at D@2@@std@@@std@@0 at Z@@Z)
bin\yaml2obj.exe : fatal error LNK1120: 3 unresolved externals
```

## Validation
Local builds and tests to validate cross-platform compatibility. This
included llvm, clang, and lldb on the following configurations:

- Windows with MSVC
- Windows with Clang
- Linux with GCC
- Linux with Clang
- Darwin with Clang



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list