You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't really understand the problem or what I can do to help.
clang-sys only links to LLVM libraries when linking statically.
When linking dynamically (the default for rust-bindgen), the only linked library is the libclang shared library.
Is there some issue caused by conflicts between dynamically linked instances of libclang and the version of LLVM used by the compiler?
The problem is that cargo sets some environment variable that makes the dynamic linker find rust's libLLVM instead of the one that comes with libclang, and when you're lucky, that works, but when you're not, things break.
There's unfortunately nothing that can be done here, short of adding dependencies on crates that can analyze binaries and check what libraries they depend upon. That would almost amount to writing a custom linker, which sounds crazy.
It turns out everything would work fine if rustup wasn't setting DYLD_LIBRARY_PATH, so once rust-lang/rustup#1752 is merged/shipped, it should be less necessary to fix this issue.
See https://bugzilla.mozilla.org/show_bug.cgi?id=1536486 for context.
rust-lang/rust#59173 only papers over the issue, and there are other creative ways for things to go wrong even if rust somehow makes things better.
clang-sys is manually loading libclang, it should ensure that the right corresponding libllvm is used.
The text was updated successfully, but these errors were encountered: