-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Commit ee2d2bd
authored
[lllvm] add Passes to LLVM_LINK_COMPONENTS for LLVMMCATests (#145617)
## Purpose
Add `Passes` to `LLVM_LINK_COMPONENTS` for `LLVMMCATests` so that it
links properly when LLVM is built as a Windows DLL.
## Background
`LLVPasses` appears to be a missing dependency from `LLVMMCATests`, 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, `LLVMMCATests` fails to link 4 symbols from `LLVMPasses`
without this change:
```
LLVMX86CodeGen.lib(X86CodeGenPassBuilder.cpp.obj) : error LNK2019: unresolved external symbol "public: __cdecl llvm::ModuleInlinerWrapperPass::ModuleInlinerWrapperPass(struct llvm::InlineParams,bool,struct llvm::InlineContext,enum llvm::InliningAdvisorMode,unsigned int)" (??0ModuleInlinerWrapperPass@llvm@@qeaa@UInlineParams@1@_NUInlineContext@1@W4InliningAdvisorMode@1@I@Z) referenced in function "public: void __cdecl llvm::ModuleInlinerWrapperPass::`default constructor closure'(void)" (??_FModuleInlinerWrapperPass@llvm@@QEAAXXZ)
LLVMX86CodeGen.lib(X86CodeGenPassBuilder.cpp.obj) : error LNK2019: unresolved external symbol "public: __cdecl llvm::PipelineTuningOptions::PipelineTuningOptions(void)" (??0PipelineTuningOptions@llvm@@qeaa@XZ) referenced in function "public: void __cdecl llvm::PassBuilder::`default constructor closure'(void)" (??_FPassBuilder@llvm@@QEAAXXZ)
LLVMX86CodeGen.lib(X86CodeGenPassBuilder.cpp.obj) : error LNK2019: unresolved external symbol "public: __cdecl llvm::PassBuilder::PassBuilder(class llvm::TargetMachine *,class llvm::PipelineTuningOptions,class std::optional<struct llvm::PGOOptions>,class llvm::PassInstrumentationCallbacks *)" (??0PassBuilder@llvm@@qeaa@PEAVTargetMachine@1@VPipelineTuningOptions@1@V?$optional@UPGOOptions@llvm@@@std@@PEAVPassInstrumentationCallbacks@1@@z) referenced in function "public: void __cdecl llvm::PassBuilder::`default constructor closure'(void)" (??_FPassBuilder@llvm@@QEAAXXZ)
LLVMX86CodeGen.lib(X86InsertPrefetch.cpp.obj) : error LNK2019: unresolved external symbol "public: __cdecl llvm::SampleProfileLoaderPass::SampleProfileLoaderPass(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >,enum llvm::ThinOrFullLTOPhase,class llvm::IntrusiveRefCntPtr<class llvm::vfs::FileSystem>,bool,bool)" (??0SampleProfileLoaderPass@llvm@@qeaa@V?$basic_string@DU?$char_traits@D@std@@v?$allocator@D@2@@std@@0W4ThinOrFullLTOPhase@1@V?$IntrusiveRefCntPtr@VFileSystem@vfs@llvm@@@1@_N3@Z) referenced in function "public: void __cdecl llvm::SampleProfileLoaderPass::`default constructor closure'(void)" (??_FSampleProfileLoaderPass@llvm@@QEAAXXZ)
unittests\tools\llvm-mca\LLVMMCATests.exe : fatal error LNK1120: 4 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 Clang1 parent e29ac9b commit ee2d2bdCopy full SHA for ee2d2bd
File tree
Expand file treeCollapse file tree
1 file changed
+1
-0
lines changedFilter options
- llvm/unittests/tools/llvm-mca
Expand file treeCollapse file tree
1 file changed
+1
-0
lines changedllvm/unittests/tools/llvm-mca/CMakeLists.txt
Copy file name to clipboardExpand all lines: llvm/unittests/tools/llvm-mca/CMakeLists.txt+1Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1 | 1 |
| |
2 | 2 |
| |
3 | 3 |
| |
| 4 | + | |
4 | 5 |
| |
5 | 6 |
| |
6 | 7 |
| |
|
0 commit comments