Skip to content

Commit

Permalink
Make import libraries compatible with wholearchive
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisDenton committed Aug 19, 2024
1 parent 76fbf0a commit d4a14b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ dependencies = [

[[package]]
name = "ar_archive_writer"
version = "0.4.0"
version = "0.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de11a9d32db3327f981143bdf699ade4d637c6887b13b97e6e91a9154666963c"
checksum = "540d4912d1c71a3485a18d76ec96c526abf6c76b89b4f76d74441bb572d169c1"
dependencies = [
"object 0.36.2",
]
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_codegen_ssa/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
# tidy-alphabetical-start
ar_archive_writer = "0.4.0"
ar_archive_writer = "0.4.1"
arrayvec = { version = "0.7", default-features = false }
bitflags = "2.4.1"
cc = "1.0.90"
Expand Down
6 changes: 5 additions & 1 deletion compiler/rustc_codegen_ssa/src/back/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,11 @@ pub trait ArchiveBuilderBuilder {
&exports,
machine,
!sess.target.is_like_msvc,
/*comdat=*/ false,
// Enable compatibility with MSVC's `/WHOLEARCHIVE` flag.
// Without this flag a duplicate symbol error would be emitted
// when linking a rust staticlib using `/WHOLEARCHIVE`.
// See #129020
true,
) {
sess.dcx()
.emit_fatal(ErrorCreatingImportLibrary { lib_name, error: error.to_string() });
Expand Down

0 comments on commit d4a14b1

Please sign in to comment.