diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 1cfb4b2f63b57..5790f236cc8fd 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -571,7 +571,7 @@ impl Step for Sanitizers { } let out_dir = builder.native_dir(self.target).join("sanitizers"); - let runtimes = supported_sanitizers(&out_dir, self.target); + let runtimes = supported_sanitizers(&out_dir, self.target, &builder.config.channel); if runtimes.is_empty() { return runtimes; } @@ -635,7 +635,11 @@ pub struct SanitizerRuntime { } /// Returns sanitizers available on a given target. -fn supported_sanitizers(out_dir: &Path, target: Interned) -> Vec { +fn supported_sanitizers( + out_dir: &Path, + target: Interned, + channel: &str, +) -> Vec { let mut result = Vec::new(); match &*target { "x86_64-apple-darwin" => { @@ -644,7 +648,7 @@ fn supported_sanitizers(out_dir: &Path, target: Interned) -> Vec) -> Vec) -> Vec) -> Vec { @@ -772,13 +775,13 @@ fn link_sanitizer_runtime(sess: &Session, crate_type: config::CrateType, linker: // LLVM will link to `@rpath/*.dylib`, so we need to specify an // rpath to the library as well (the rpath should be absolute, see // PR #41352 for details). - let libname = format!("rustc_rt.{}", name); + let libname = format!("rustc{}_rt.{}", channel, name); let rpath = default_tlib.to_str().expect("non-utf8 component in path"); linker.args(&["-Wl,-rpath".into(), "-Xlinker".into(), rpath.into()]); linker.link_dylib(Symbol::intern(&libname)); } "x86_64-unknown-linux-gnu" | "x86_64-fuchsia" | "aarch64-fuchsia" => { - let filename = format!("librustc_rt.{}.a", name); + let filename = format!("librustc{}_rt.{}.a", channel, name); let path = default_tlib.join(&filename); linker.link_whole_rlib(&path); } diff --git a/src/librustc_codegen_ssa/build.rs b/src/librustc_codegen_ssa/build.rs new file mode 100644 index 0000000000000..ea2af6e192e7c --- /dev/null +++ b/src/librustc_codegen_ssa/build.rs @@ -0,0 +1,4 @@ +fn main() { + println!("cargo:rerun-if-changed=build.rs"); + println!("cargo:rerun-if-env-changed=CFG_RELEASE_CHANNEL"); +}