Skip to content

Commit c396e36

Browse files
committed
Explain why we set the comdat option
1 parent f21d635 commit c396e36

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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=*/ true,
111+
// Tell the import library writer to make `.idata$3` a COMDAT section.
112+
// This prevents duplicate symbol errors when using /WHOLEARCHIVE
113+
// to link a staticlib with the MSVC linker.
114+
// See #129020
115+
true,
112116
) {
113117
sess.dcx()
114118
.emit_fatal(ErrorCreatingImportLibrary { lib_name, error: error.to_string() });

0 commit comments

Comments
 (0)