about summary refs log tree commit diff
path: root/src/librustc_codegen_ssa
diff options
context:
space:
mode:
authorMateusz Mikuła <mati865@gmail.com>2020-06-11 18:12:19 +0200
committerMateusz Mikuła <mati865@gmail.com>2020-06-11 18:48:43 +0200
commit5d298836f2254144f80e56ee37af44ac79f3eb2c (patch)
treea74845981fae7e3e10f5e107c247bc0ea743cdd5 /src/librustc_codegen_ssa
parent961974fe0348f479255f9e95b5924419c2c15a77 (diff)
downloadrust-5d298836f2254144f80e56ee37af44ac79f3eb2c.tar.gz
rust-5d298836f2254144f80e56ee37af44ac79f3eb2c.zip
Move some libs to self-contained directory
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..c57b01dff28 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_lib_path().join("self-contained").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_lib_path().join("self-contained");
+    cmd.include_path(&fix_windows_verbatim_for_gcc(&lib_path));
 }
 
 /// Add options making relocation sections in the produced ELF files read-only