From 3fc81d32314eca98b51846f493a8bc77cf14a701 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Mon, 1 Aug 2011 17:36:53 +0000 Subject: [PATCH] Fix linkage type for tentative definition of ivar offset variables (GNUstep runtime) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136628 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/CGObjCGNU.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/CodeGen/CGObjCGNU.cpp b/lib/CodeGen/CGObjCGNU.cpp index c92260beac..ae8a8dd58f 100644 --- a/lib/CodeGen/CGObjCGNU.cpp +++ b/lib/CodeGen/CGObjCGNU.cpp @@ -2453,8 +2453,8 @@ llvm::Value *CGObjCGNU::EmitIvarOffset(CodeGenFunction &CGF, llvm::Value *Offset = TheModule.getGlobalVariable(name); if (!Offset) Offset = new llvm::GlobalVariable(TheModule, IntTy, - false, llvm::GlobalValue::CommonLinkage, - 0, name); + false, llvm::GlobalValue::LinkOnceAnyLinkage, + llvm::Constant::getNullValue(IntTy), name); return CGF.Builder.CreateLoad(Offset); } uint64_t Offset = ComputeIvarBaseOffset(CGF.CGM, Interface, Ivar); -- 2.40.0