Skip to content

Commit 604caa0

Browse files
committed
De-duplicate all consecutive native libs regardless of their options
1 parent e23ae72 commit 604caa0

File tree

2 files changed

+8
-5
lines changed
  • compiler/rustc_codegen_ssa/src/back
  • tests/run-make/print-native-static-libs

2 files changed

+8
-5
lines changed

compiler/rustc_codegen_ssa/src/back/link.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1490,11 +1490,6 @@ fn print_native_static_libs(
14901490
let mut lib_args: Vec<_> = all_native_libs
14911491
.iter()
14921492
.filter(|l| relevant_lib(sess, l))
1493-
// Deduplication of successive repeated libraries, see rust-lang/rust#113209
1494-
//
1495-
// note: we don't use PartialEq/Eq because NativeLib transitively depends on local
1496-
// elements like spans, which we don't care about and would make the deduplication impossible
1497-
.dedup_by(|l1, l2| l1.name == l2.name && l1.kind == l2.kind && l1.verbatim == l2.verbatim)
14981493
.filter_map(|lib| {
14991494
let name = lib.name;
15001495
match lib.kind {
@@ -1521,6 +1516,8 @@ fn print_native_static_libs(
15211516
| NativeLibKind::RawDylib => None,
15221517
}
15231518
})
1519+
// deduplication of consecutive repeated libraries, see rust-lang/rust#113209
1520+
.dedup()
15241521
.collect();
15251522
for path in all_rust_dylibs {
15261523
// FIXME deduplicate with add_dynamic_crate

tests/run-make/print-native-static-libs/bar.rs

+6
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ extern "C" {
1717
extern "C" {
1818
fn g_free2(p: *mut ());
1919
}
20+
21+
#[cfg(windows)]
22+
#[link(name = "glib-2.0", kind = "raw-dylib")]
23+
extern "C" {
24+
fn g_free3(p: *mut ());
25+
}

0 commit comments

Comments
 (0)