Bug 1687047

Summary: clang doesn't work on rawhide if ran from cargo / rust programs
Product: [Fedora] Fedora Reporter: Emilio Cobos Álvarez (:emilio) <emilio>
Component: clangAssignee: Tom Stellard <tstellar>
Status: CLOSED UPSTREAM QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: airlied, jistone, sbergman, sguelton, siddharth.kde, tstellar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-03-18 12:04:28 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Emilio Cobos Álvarez (:emilio) 2019-03-09 02:56:18 UTC
Description of problem: Any program that calls clang from a Rust build script fails with:

/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

Version-Release number of selected component (if applicable): clang version 8.0.0 (Fedora 8.0.0-0.3.rc2.fc31)

How reproducible: Always

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

Note that this also affects a bunch of other rust programs.

The issue is that clang is picking the rust libLLVM-8.so, rather than the one on the system. I'm not sure if the issue is in Rust's libLLVM.so or on Fedora's clang installation.

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


Additional info: As I said I'm not sure whether the problem is RedHat's build of clang or Rust's LLVM, I'll file both and paste here the rust issue.

I'm mostly filing here because it's the most recent clang upgrade what busted it, but it only updated to clang-8 so before that the issue shouldn't happen.

Comment 1 Emilio Cobos Álvarez (:emilio) 2019-03-09 03:01:46 UTC
I filed this in the rust repo as well as: https://github.com/rust-lang/rust/issues/59034

Comment 2 Josh Stone 2019-03-14 00:39:11 UTC
As I just commented on the other issue -- IMO rust's libLLVM should use a custom version suffix.

Comment 3 Emilio Cobos Álvarez (:emilio) 2019-03-18 12:04:28 UTC
I fixed it on the rust side of things, so closed as UPSTREAM, but I'm not 100% familiar with the bug statuses here, so if that's wrong please change it :)