If a COMDAT key has a local linkage, it behaves as comdat nodeduplicate and
llvm/lib/Linker/LinkModules.cpp does not deduplicate its members.
This is not intended. Switch to an external linkage to allow deduplication.
See also https://maskray.me/blog/2021-07-25-comdat-and-section-group#grp_comdat
Is there any usecase where having the COMDAT key internal linkage is valid? Should we add an assert() to appendToGlobalCtors()?
I'm guessing that will uncover a whole bunch of latent issues in other sanitizers as well.
(Unfortunately we can't make the ctor/dtor created in createSanitizerCtor always ExternalLinkage because e.g. ASan does actually need per-TU ctor/dtor for globals in some cases.)