Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions include/swift/IRGen/Linking.h
Original file line number Diff line number Diff line change
Expand Up @@ -1095,6 +1095,14 @@ class ApplyIRLinkage {
if (Triple.isOSBinFormatELF())
return;

// WebAssembly: disable COMDATs.
// LLVM's Wasm COMDAT code assumes each COMDAT will be in its own section.
// This works for C++ on Clang, since each COMDAT is emitted into its own
// .rodata.<symbol name> section,
// but not for Swift metadata, which are all placed in the same section.
if (Triple.isOSBinFormatWasm())
return;

if (IRL.Linkage == llvm::GlobalValue::LinkOnceODRLinkage ||
IRL.Linkage == llvm::GlobalValue::WeakODRLinkage)
if (Triple.supportsCOMDAT())
Expand Down