diff options
| author | bors <bors@rust-lang.org> | 2023-07-16 10:59:45 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-07-16 10:59:45 +0000 |
| commit | 55be59d2cefe33529a07b0e011384658c9240035 (patch) | |
| tree | ed2f3439c3e5d9e8bff65daec5bae23516c9b20c /compiler/rustc_codegen_ssa/src/back | |
| parent | 00a39cc785fcbb4f1e9c9454e9ee8a85e6ff021c (diff) | |
| parent | ad16606471db319ebcb42bef9a05538079c21ab9 (diff) | |
| download | rust-55be59d2cefe33529a07b0e011384658c9240035.tar.gz rust-55be59d2cefe33529a07b0e011384658c9240035.zip | |
Auto merge of #113626 - Urgau:dedup-native-static-libs, r=petrochenkov
De-duplicate consecutive libs when printing native-static-libs This PR adds a de-duplicate step just before printing the `native-static-libs`. This step de-duplicates all the consecutive libs based only on the relevant comparison elements (this exclude spans, ast elements, ...). Fixes https://github.com/rust-lang/rust/issues/113209
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/back')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/back/link.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_codegen_ssa/src/back/link.rs b/compiler/rustc_codegen_ssa/src/back/link.rs index b603a878746..0dfb41f42f0 100644 --- a/compiler/rustc_codegen_ssa/src/back/link.rs +++ b/compiler/rustc_codegen_ssa/src/back/link.rs @@ -1392,6 +1392,11 @@ fn print_native_static_libs( let mut lib_args: Vec<_> = all_native_libs .iter() .filter(|l| relevant_lib(sess, l)) + // Deduplication of successive repeated libraries, see rust-lang/rust#113209 + // + // note: we don't use PartialEq/Eq because NativeLib transitively depends on local + // elements like spans, which we don't care about and would make the deduplication impossible + .dedup_by(|l1, l2| l1.name == l2.name && l1.kind == l2.kind && l1.verbatim == l2.verbatim) .filter_map(|lib| { let name = lib.name; match lib.kind { |
