Skip to content

Commit b97e9b5

Browse files
committed
Auto merge of rust-lang#75654 - tmandry:rollup-ej0oezi, r=tmandry
Rollup of 3 pull requests Successful merges: - rust-lang#75548 (librustc_metadata::locator: Properly detect file type.) - rust-lang#75603 (Use more compatible out-implib style) - rust-lang#75637 (update stacker to 0.1.11 to unbreak build for wasm32-unknown-unknown) Failed merges: r? @ghost
2 parents d7dcae0 + 14c0e4c commit b97e9b5

File tree

4 files changed

+14
-8
lines changed

4 files changed

+14
-8
lines changed

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -4345,9 +4345,9 @@ checksum = "ffbc596e092fe5f598b12ef46cc03754085ac2f4d8c739ad61c4ae266cc3b3fa"
43454345

43464346
[[package]]
43474347
name = "stacker"
4348-
version = "0.1.9"
4348+
version = "0.1.11"
43494349
source = "registry+https://github.com/rust-lang/crates.io-index"
4350-
checksum = "72dd941b456e1c006d6b9f27c526d5b69281288aeea8cba82c19d3843d8ccdd2"
4350+
checksum = "a92bc346006ae78c539d6ab2cf1a1532bc657b8339c464877a990ec82073c66f"
43514351
dependencies = [
43524352
"cc",
43534353
"cfg-if",

src/librustc_codegen_ssa/back/linker.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ impl<'a> GccLinker<'a> {
266266
if let Some(implib_name) = implib_name {
267267
let implib = out_filename.parent().map(|dir| dir.join(&implib_name));
268268
if let Some(implib) = implib {
269-
self.linker_arg(&format!("--out-implib,{}", (*implib).to_str().unwrap()));
269+
self.linker_arg(&format!("--out-implib={}", (*implib).to_str().unwrap()));
270270
}
271271
}
272272
}

src/librustc_data_structures/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ rustc_index = { path = "../librustc_index", package = "rustc_index" }
3030
bitflags = "1.2.1"
3131
measureme = "0.7.1"
3232
libc = "0.2"
33-
stacker = "0.1.9"
33+
stacker = "0.1.11"
3434
tempfile = "3.0.5"
3535

3636
[dependencies.parking_lot]

src/librustc_metadata/locator.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -685,13 +685,19 @@ impl<'a> CrateLocator<'a> {
685685
&& file.ends_with(&self.target.options.dll_suffix)
686686
{
687687
// Make sure there's at most one rlib and at most one dylib.
688-
let loc = fs::canonicalize(&loc).unwrap_or_else(|_| loc.clone());
688+
// Note to take care and match against the non-canonicalized name:
689+
// some systems save build artifacts into content-addressed stores
690+
// that do not preserve extensions, and then link to them using
691+
// e.g. symbolic links. If we canonicalize too early, we resolve
692+
// the symlink, the file type is lost and we might treat rlibs and
693+
// rmetas as dylibs.
694+
let loc_canon = fs::canonicalize(&loc).unwrap_or_else(|_| loc.clone());
689695
if loc.file_name().unwrap().to_str().unwrap().ends_with(".rlib") {
690-
rlibs.insert(loc, PathKind::ExternFlag);
696+
rlibs.insert(loc_canon, PathKind::ExternFlag);
691697
} else if loc.file_name().unwrap().to_str().unwrap().ends_with(".rmeta") {
692-
rmetas.insert(loc, PathKind::ExternFlag);
698+
rmetas.insert(loc_canon, PathKind::ExternFlag);
693699
} else {
694-
dylibs.insert(loc, PathKind::ExternFlag);
700+
dylibs.insert(loc_canon, PathKind::ExternFlag);
695701
}
696702
} else {
697703
self.rejected_via_filename

0 commit comments

Comments
 (0)