about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-06-19 08:56:04 +0200
committerGitHub <noreply@github.com>2020-06-19 08:56:04 +0200
commitea3c309700020cf78632dc00d949048bf3f75b5f (patch)
tree84243ace4f458c35867bddeb6539d5ae68392a93 /src/librustc_codegen_ssa
parent5e7eec2eaa8b25d8a607a9ced3ef4df01aab3787 (diff)
parent43905cd7501fd37090cb9de6069faaba761e514a (diff)
downloadrust-ea3c309700020cf78632dc00d949048bf3f75b5f.tar.gz
rust-ea3c309700020cf78632dc00d949048bf3f75b5f.zip
Rollup merge of #72999 - mati865:separate-self-contained-dir, r=Mark-Simulacrum
Create self-contained directory and move there some of external binaries/libs

One of the steps to reach design described in https://github.com/rust-lang/rust/issues/68887#issuecomment-633048380
This PR moves things around and allows link code to handle the new directory structure.
Diffstat (limited to 'src/librustc_codegen_ssa')
-rw-r--r--src/librustc_codegen_ssa/back/link.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/librustc_codegen_ssa/back/link.rs b/src/librustc_codegen_ssa/back/link.rs
index 53e3da3c0ba..1eef86f6c93 100644
--- a/src/librustc_codegen_ssa/back/link.rs
+++ b/src/librustc_codegen_ssa/back/link.rs
@@ -1075,6 +1075,10 @@ fn get_object_file_path(sess: &Session, name: &str) -> PathBuf {
     if file_path.exists() {
         return file_path;
     }
+    let file_path = fs.get_selfcontained_lib_path().join(name);
+    if file_path.exists() {
+        return file_path;
+    }
     for search_path in fs.search_paths() {
         let file_path = search_path.dir.join(name);
         if file_path.exists() {
@@ -1470,6 +1474,9 @@ fn add_library_search_dirs(cmd: &mut dyn Linker, sess: &Session) {
     // The location of crates will be determined as needed.
     let lib_path = sess.target_filesearch(PathKind::All).get_lib_path();
     cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
+
+    let lib_path = sess.target_filesearch(PathKind::All).get_selfcontained_lib_path();
+    cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
 }
 
 /// Add options making relocation sections in the produced ELF files read-only