about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2018-01-30 15:40:44 -0800
committerAlex Crichton <alex@alexcrichton.com>2018-01-31 10:16:26 -0800
commit8ebe5424809a517a9e74984a32e79e0ff9d612f9 (patch)
tree0315049b77c8cebf8550945ac3621582affba1fa /src/bootstrap
parentdef3269a71be2e737cad27418a3dad9f5bd6cd32 (diff)
downloadrust-8ebe5424809a517a9e74984a32e79e0ff9d612f9.tar.gz
rust-8ebe5424809a517a9e74984a32e79e0ff9d612f9.zip
rustc: Move location of `codegen-backends` dir
Right now this directory is located under:

  $sysroot/lib/rustlib/$target/lib/codegen-backends

but after seeing what we do in a few other places it seems that a more
appropriate location would be:

  $sysroot/lib/rustlib/$target/codegen-backends

so this commit moves it!
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/builder.rs5
-rw-r--r--src/bootstrap/compile.rs3
-rw-r--r--src/bootstrap/dist.rs8
3 files changed, 9 insertions, 7 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 1272643edd2..780513dd943 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -377,6 +377,11 @@ impl<'a> Builder<'a> {
         self.ensure(Libdir { compiler, target })
     }
 
+    pub fn sysroot_codegen_backends(&self, compiler: Compiler) -> PathBuf {
+        self.sysroot_libdir(compiler, compiler.host)
+            .with_file_name("codegen-backends")
+    }
+
     /// Returns the compiler's libdir where it stores the dynamic libraries that
     /// it itself links against.
     ///
diff --git a/src/bootstrap/compile.rs b/src/bootstrap/compile.rs
index fa289bbd76a..1d5e11c5d6d 100644
--- a/src/bootstrap/compile.rs
+++ b/src/bootstrap/compile.rs
@@ -724,8 +724,7 @@ fn copy_codegen_backends_to_sysroot(builder: &Builder,
     //
     // Here we're looking for the output dylib of the `CodegenBackend` step and
     // we're copying that into the `codegen-backends` folder.
-    let libdir = builder.sysroot_libdir(target_compiler, target);
-    let dst = libdir.join("codegen-backends");
+    let dst = builder.sysroot_codegen_backends(target_compiler);
     t!(fs::create_dir_all(&dst));
 
     for backend in builder.config.rust_codegen_backends.iter() {
diff --git a/src/bootstrap/dist.rs b/src/bootstrap/dist.rs
index 4127239dc49..dbb7d19e432 100644
--- a/src/bootstrap/dist.rs
+++ b/src/bootstrap/dist.rs
@@ -435,11 +435,9 @@ impl Step for Rustc {
             }
 
             // Copy over the codegen backends
-            let backends_src = builder.sysroot_libdir(compiler, host)
-                .join("codegen-backends");
-            let backends_dst = image.join("lib/rustlib")
-                .join(&*host)
-                .join("lib/codegen-backends");
+            let backends_src = builder.sysroot_codegen_backends(compiler);
+            let backends_rel = backends_src.strip_prefix(&src).unwrap();
+            let backends_dst = image.join(&backends_rel);
             t!(fs::create_dir_all(&backends_dst));
             cp_r(&backends_src, &backends_dst);