[clang] Fix Strong VTables Accidentally Emitted by #159856 (PR #200942)

Alexey Bataev via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 12 03:58:36 PDT 2026


================
@@ -1849,6 +1849,9 @@ void CGOpenMPRuntime::emitAndRegisterVTable(CodeGenModule &CGM,
       CGM.EmitVTable(CXXRecord);
       CodeGenVTables VTables = CGM.getVTables();
       llvm::GlobalVariable *VTablesAddr = VTables.GetAddrOfVTable(CXXRecord);
+      // Must set VTables to weak since we're emitting them in multiple TUs now
+      if (VTablesAddr->hasExternalLinkage())
+        VTablesAddr->setLinkage(llvm::GlobalValue::WeakODRLinkage);
----------------
alexey-bataev wrote:

What about COMDAT?

https://github.com/llvm/llvm-project/pull/200942


More information about the cfe-commits mailing list