llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

libclang has no registered targets after r371787

Open llvmbot opened this issue 6 years ago • 4 comments

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

llvmbot avatar May 05 '20 20:05 llvmbot

Merged: db810b69f80

tstellar avatar May 07 '20 18:05 tstellar

Landed in 02b303321d3

jkorous-apple avatar May 06 '20 04:05 jkorous-apple

https://reviews.llvm.org/D79451

jkorous-apple avatar May 05 '20 22:05 jkorous-apple

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

jkorous-apple avatar May 05 '20 22:05 jkorous-apple