Skip to content

Rust's libLLVM-8.so doesn't work with clang #59034

Description

@emilio

Which means that programs that run clang from a build script, or from cargo in some other way, fail.

Steps to Reproduce:
0. Have a clang binary pointing to clang-8 installed and in your path.

  1. rustup install nightly
  2. git clone https://github.com/rust-lang/rust-bindgen && cd $_
  3. cargo test

Actual results: /usr/bin/clang: relocation error: /lib64/libclangBasic.so.8: symbol _ZTIN4llvm14FoldingSetBaseE version LLVM_8 not defined in file libLLVM-8.so with link time reference

Expected results: not so

This only happens if ran from cargo, if I run the test executable manually then stuff works, so I suspect this is some LD_LIBRARY_PATH mungling that cargo or rustup do under the hood.

This is technically a regression from #58408, same problem does not exist with rust stable / beta and clang 7.

There's a slight chance that there's an issue on how clang-8 is built in Fedora, so I also filed https://bugzilla.redhat.com/show_bug.cgi?id=1687047, but I think it's unexpected that clang when called from cargo / build scripts uses rust's libLLVM.so, and probably should be avoided.

cc @alexcrichton

No activity

Activity on this issue will appear here.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-LLVMArea: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues.O-linuxOperating system: LinuxP-highHigh priorityT-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions