Change:
Which means that programs that run from a build script, or from cargo in some other way, fail. Steps to Reproduce: a clang binary pointing to clang-8 installed and in your path. install nightly clone && cd $ test Actual results: /usr/bin/clang: relocation error: symbol ZTIN4llvm14FoldingSetBaseE version LLVM8 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 LDLIBRARYPATH mungling that cargo or rustup do under the hood. This is technically a regression from , 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 , but I think it's unexpected that clang when called from cargo / build scripts uses rust's , and probably should be avoided. cc
Is invoked from a build script? It is possible that cargo neglects removing the unnecessary or similar environment variables before invoking the script in question. EDIT: oh you wrote that in the report already. I remember there being an issue like this in cargo repo from a long long time ago, but cannot find it now.
cc
See also . We should probably set a custom suffix per . Maybe even include the Rust version to help avoid bootstrap issues like what commit saw. (cc
Yep, I think a suffix of rust version (or maybe LLVM submodule commit?) would be good. I think we'd appreciate a PR for something like that; I would expect it to be a matter of making the version suffix default be or something along those lines.
Sure, that sounds good, I can give that a shot.
I sent with a change that I hope will address this, but see there why I cannot confirm it will :)
triage: P-high, assigning to

Discussion:
clippy_info: channel::GitInfo, miri_info: channel::GitInfo, rustfmt_info: channel::GitInfo, <ins> in_tree_llvm_info: channel::GitInfo, emscripten_llvm_info: channel::GitInfo, </ins> local_rebuild: bool, fail_fast: bool, doc_tests: DocTests,

let clippy_info = channel::GitInfo::new(&config, &src.join("src/tools/clippy")); let miri_info = channel::GitInfo::new(&config, &src.join("src/tools/miri")); let rustfmt_info = channel::GitInfo::new(&config, &src.join("src/tools/rustfmt")); <ins> let in_tree_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-project")); let emscripten_llvm_info = channel::GitInfo::new(&config, &src.join("src/llvm-emscripten")); </ins> let mut build = Build { initial_rustc: config.initial_rustc.clone(),

clippy_info, miri_info, rustfmt_info, <ins> in_tree_llvm_info, emscripten_llvm_info, </ins> cc: HashMap::new(), cxx: HashMap::new(), ar: HashMap::new(),

use cmake; use cc; <ins> use crate::channel; </ins> use crate::util::{self, exe}; use build_helper::up_to_date; use crate::builder::{Builder, RunConfig, ShouldRun, Step};

} if let Some(ref suffix) = builder.config.llvm_version_suffix { <del> cfg.define("LLVM_VERSION_SUFFIX", suffix); </del> <ins> // Allow version-suffix="" to not define a version suffix at all. if !suffix.is_empty() { cfg.define("LLVM_VERSION_SUFFIX", suffix); } } else { let mut default_suffix = format!( "-rust-{}-{}", channel::CFG_RELEASE_NUM, builder.config.channel, ); let llvm_info = if self.emscripten { &builder.emscripten_llvm_info } else { &builder.in_tree_llvm_info }; if let Some(sha) = llvm_info.sha_short() { default_suffix.push_str("-"); default_suffix.push_str(sha); } cfg.define("LLVM_VERSION_SUFFIX", default_suffix); </ins> } if let Some(ref linker) = builder.config.llvm_use_linker {