libclang has no registered targets after r371787
| Bugzilla Link | 45809 |
| Resolution | FIXED |
| Resolved on | May 07, 2020 11:12 |
| Version | 10.0 |
| OS | Windows NT |
| Blocks | llvm/llvm-project#44654 |
| Reporter | LLVM Bugzilla Contributor |
| CC | @jkorous-apple,@zygoloid,@tstellar |
| Fixed by commit(s) | 02b303321d3 db810b69f80 |
Extended Description
After r371787 [0], when Rust's bindgen uses libclang, it fails with "no targets are registered" [1].
This only happens when we build LLVM with -DLLVM_LINK_LLVM_DYLIB=ON.
jkorous: I'm not clear on why LLVMSupport was added to libclang's CMakeLists.txt. If I remove that line, the code still compiles, and this bug goes away. I'm not familiar with this part of the code though -- do you have any idea what might be going on?
[0] https://reviews.llvm.org/rL371787 [1] https://github.com/llvm/llvm-project/blob/2946cd701067404b99c39fb29dc9c74bd7193eb3/llvm/lib/Support/TargetRegistry.cpp#L66
Merged: db810b69f80
Landed in 02b303321d3
https://reviews.llvm.org/D79451
Hi David,
You're right - the Support dependency was already there so the line I added is a duplicate. I have no idea how it is related to backend targets but seems like there's no reason to have the line there. Let me just test the patch - I'll let you know when it lands (later today?).
Thanks, Jan