From a520661667597530ad3a3d9f7d5d730cfc590223 Mon Sep 17 00:00:00 2001 From: Frits van Bommel Date: Thu, 21 May 2009 15:23:28 +0200 Subject: [PATCH] Now that templates instantiations are no longer emitted for all modules that even blink at them they seem to break due to being linkonce (if compiled with any optimization level > 0), so let's give them weak linkage instead. The difference is that unreferenced linkonce symbols can be deleted, while weak symbols need to be preserved. --- gen/linkage.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gen/linkage.h b/gen/linkage.h index c296df98..50c104c3 100644 --- a/gen/linkage.h +++ b/gen/linkage.h @@ -3,11 +3,11 @@ // Make it easier to test new linkage types -# define TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage +# define TEMPLATE_LINKAGE_TYPE llvm::GlobalValue::WeakODRLinkage # define TYPEINFO_LINKAGE_TYPE llvm::GlobalValue::LinkOnceODRLinkage // The One-Definition-Rule shouldn't matter for debug info, right? # define DEBUGINFO_LINKONCE_LINKAGE_TYPE \ - llvm::GlobalValue::LinkOnceAnyLinkage + llvm::GlobalValue::WeakAnyLinkage #endif