diff options
| author | Marc-Antoine Perennou <Marc-Antoine@Perennou.com> | 2020-02-06 12:32:42 +0100 |
|---|---|---|
| committer | Marc-Antoine Perennou <Marc-Antoine@Perennou.com> | 2020-02-11 09:40:58 +0100 |
| commit | 1bba9cfb9036eb44bb549f34c090cb38bd0d84fd (patch) | |
| tree | ad55fece7f35195367077a857afdbd49b4ffc563 /src/librustc_codegen_ssa | |
| parent | dc4242d9052a42cdf329c3a2430d02a3b3d415cb (diff) | |
| download | rust-1bba9cfb9036eb44bb549f34c090cb38bd0d84fd.tar.gz rust-1bba9cfb9036eb44bb549f34c090cb38bd0d84fd.zip | |
rustbuild: include channel in sanitizers installed name
Allows parallel install of different rust channels Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Diffstat (limited to 'src/librustc_codegen_ssa')
| -rw-r--r-- | src/librustc_codegen_ssa/back/link.rs | 7 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/build.rs | 4 |
2 files changed, 9 insertions, 2 deletions
diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs index d3b8f7ea33f..aaa4448fc19 100644 --- a/src/librustc_codegen_ssa/back/link.rs +++ b/src/librustc_codegen_ssa/back/link.rs @@ -765,6 +765,9 @@ fn link_sanitizer_runtime(sess: &Session, crate_type: config::CrateType, linker: let default_sysroot = filesearch::get_or_default_sysroot(); let default_tlib = filesearch::make_target_lib_path(&default_sysroot, sess.opts.target_triple.triple()); + let channel = option_env!("CFG_RELEASE_CHANNEL") + .map(|channel| format!("-{}", channel)) + .unwrap_or_default(); match sess.opts.target_triple.triple() { "x86_64-apple-darwin" => { @@ -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 00000000000..ea2af6e192e --- /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"); +} |
