about summary refs log tree commit diff
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-08-18 03:21:22 +0000
committerbors <bors@rust-lang.org>2020-08-18 03:21:22 +0000
commitb97e9b5dc74e705cd01603c5f735652a04460a60 (patch)
tree239513efd2c6134eba5b84e7923b298f40a4090a
parentd7dcae03c9c014362cdefb7ec605bb35804a6a94 (diff)
parent14c0e4c9ea9b7c69df61f76f308af3133330366f (diff)
downloadrust-b97e9b5dc74e705cd01603c5f735652a04460a60.tar.gz
rust-b97e9b5dc74e705cd01603c5f735652a04460a60.zip
Auto merge of #75654 - tmandry:rollup-ej0oezi, r=tmandry
Rollup of 3 pull requests

Successful merges:

 - #75548 (librustc_metadata::locator: Properly detect file type.)
 - #75603 (Use more compatible out-implib style)
 - #75637 (update stacker to 0.1.11 to unbreak build for wasm32-unknown-unknown)

Failed merges:

r? @ghost
-rw-r--r--Cargo.lock4
-rw-r--r--src/librustc_codegen_ssa/back/linker.rs2
-rw-r--r--src/librustc_data_structures/Cargo.toml2
-rw-r--r--src/librustc_metadata/locator.rs14
4 files changed, 14 insertions, 8 deletions
diff --git a/Cargo.lock b/Cargo.lock
index c1fa3bef07c..5c767817ae5 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -4345,9 +4345,9 @@ checksum = "ffbc596e092fe5f598b12ef46cc03754085ac2f4d8c739ad61c4ae266cc3b3fa"
 
 [[package]]
 name = "stacker"
-version = "0.1.9"
+version = "0.1.11"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "72dd941b456e1c006d6b9f27c526d5b69281288aeea8cba82c19d3843d8ccdd2"
+checksum = "a92bc346006ae78c539d6ab2cf1a1532bc657b8339c464877a990ec82073c66f"
 dependencies = [
  "cc",
  "cfg-if",
diff --git a/src/librustc_codegen_ssa/back/linker.rs b/src/librustc_codegen_ssa/back/linker.rs
index 5100ef8ad4f..0ddf8bd316f 100644
--- a/src/librustc_codegen_ssa/back/linker.rs
+++ b/src/librustc_codegen_ssa/back/linker.rs
@@ -266,7 +266,7 @@ impl<'a> GccLinker<'a> {
                 if let Some(implib_name) = implib_name {
                     let implib = out_filename.parent().map(|dir| dir.join(&implib_name));
                     if let Some(implib) = implib {
-                        self.linker_arg(&format!("--out-implib,{}", (*implib).to_str().unwrap()));
+                        self.linker_arg(&format!("--out-implib={}", (*implib).to_str().unwrap()));
                     }
                 }
             }
diff --git a/src/librustc_data_structures/Cargo.toml b/src/librustc_data_structures/Cargo.toml
index 00dab143fdc..988bb733f9f 100644
--- a/src/librustc_data_structures/Cargo.toml
+++ b/src/librustc_data_structures/Cargo.toml
@@ -30,7 +30,7 @@ rustc_index = { path = "../librustc_index", package = "rustc_index" }
 bitflags = "1.2.1"
 measureme = "0.7.1"
 libc = "0.2"
-stacker = "0.1.9"
+stacker = "0.1.11"
 tempfile = "3.0.5"
 
 [dependencies.parking_lot]
diff --git a/src/librustc_metadata/locator.rs b/src/librustc_metadata/locator.rs
index bdd20a4bf6f..8fa14a44f52 100644
--- a/src/librustc_metadata/locator.rs
+++ b/src/librustc_metadata/locator.rs
@@ -685,13 +685,19 @@ impl<'a> CrateLocator<'a> {
                     && file.ends_with(&self.target.options.dll_suffix)
             {
                 // Make sure there's at most one rlib and at most one dylib.
-                let loc = fs::canonicalize(&loc).unwrap_or_else(|_| loc.clone());
+                // Note to take care and match against the non-canonicalized name:
+                // some systems save build artifacts into content-addressed stores
+                // that do not preserve extensions, and then link to them using
+                // e.g. symbolic links. If we canonicalize too early, we resolve
+                // the symlink, the file type is lost and we might treat rlibs and
+                // rmetas as dylibs.
+                let loc_canon = fs::canonicalize(&loc).unwrap_or_else(|_| loc.clone());
                 if loc.file_name().unwrap().to_str().unwrap().ends_with(".rlib") {
-                    rlibs.insert(loc, PathKind::ExternFlag);
+                    rlibs.insert(loc_canon, PathKind::ExternFlag);
                 } else if loc.file_name().unwrap().to_str().unwrap().ends_with(".rmeta") {
-                    rmetas.insert(loc, PathKind::ExternFlag);
+                    rmetas.insert(loc_canon, PathKind::ExternFlag);
                 } else {
-                    dylibs.insert(loc, PathKind::ExternFlag);
+                    dylibs.insert(loc_canon, PathKind::ExternFlag);
                 }
             } else {
                 self.rejected_via_filename