Skip to content

Commit 40af214

Browse files
committed
Make import libraries compatible with wholearchive
1 parent 76fbf0a commit 40af214

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

Diff for: Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -205,9 +205,9 @@ dependencies = [
205205

206206
[[package]]
207207
name = "ar_archive_writer"
208-
version = "0.4.0"
208+
version = "0.4.2"
209209
source = "registry+https://github.com/rust-lang/crates.io-index"
210-
checksum = "de11a9d32db3327f981143bdf699ade4d637c6887b13b97e6e91a9154666963c"
210+
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
211211
dependencies = [
212212
"object 0.36.2",
213213
]

Diff for: compiler/rustc_codegen_ssa/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2021"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
ar_archive_writer = "0.4.0"
8+
ar_archive_writer = "0.4.2"
99
arrayvec = { version = "0.7", default-features = false }
1010
bitflags = "2.4.1"
1111
cc = "1.0.90"

Diff for: compiler/rustc_codegen_ssa/src/back/archive.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,11 @@ pub trait ArchiveBuilderBuilder {
108108
&exports,
109109
machine,
110110
!sess.target.is_like_msvc,
111-
/*comdat=*/ false,
111+
// Enable compatibility with MSVC's `/WHOLEARCHIVE` flag.
112+
// Without this flag a duplicate symbol error would be emitted
113+
// when linking a rust staticlib using `/WHOLEARCHIVE`.
114+
// See #129020
115+
true,
112116
) {
113117
sess.dcx()
114118
.emit_fatal(ErrorCreatingImportLibrary { lib_name, error: error.to_string() });

0 commit comments

Comments
 (0)