about summary refs log tree commit diff
path: root/src/librustc_driver
diff options
context:
space:
mode:
authorMarc-Antoine Perennou <Marc-Antoine@Perennou.com>2018-03-02 09:19:50 +0100
committerMarc-Antoine Perennou <Marc-Antoine@Perennou.com>2018-03-02 13:51:02 +0100
commit6250a47ea6147a60e11e59aded80ebb62c8e3ab1 (patch)
tree162197368acfb84f9a44c8372506365467f2b190 /src/librustc_driver
parentddfbf2b0f4726f11bc8e857274ae1a0f8343a73f (diff)
make codegen-backends directory name configurable
This allows to parallel-install several versions of rust system-wide
Fixes #48263

Signed-off-by: Marc-Antoine Perennou <Marc-Antoine@Perennou.com>
Diffstat (limited to 'src/librustc_driver')
-rw-r--r--src/librustc_driver/lib.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/librustc_driver/lib.rs b/src/librustc_driver/lib.rs
index 22c26b06430..0f7a04e391b 100644
--- a/src/librustc_driver/lib.rs
+++ b/src/librustc_driver/lib.rs
@@ -303,7 +303,9 @@ fn get_trans_sysroot(backend_name: &str) -> fn() -> Box<TransCrate> {
     let sysroot = sysroot_candidates.iter()
         .map(|sysroot| {
             let libdir = filesearch::relative_target_lib_path(&sysroot, &target);
-            sysroot.join(libdir).with_file_name("codegen-backends")
+            sysroot.join(libdir)
+                .with_file_name(option_env!("CFG_CODEGEN_BACKENDS_DIR")
+                                .unwrap_or("codegen-backends"))
         })
         .filter(|f| {
             info!("codegen backend candidate: {}", f.display());