From: David Chisnall Date: Mon, 1 Aug 2011 17:36:53 +0000 (+0000) Subject: Fix linkage type for tentative definition of ivar offset variables (GNUstep runtime) X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3fc81d32314eca98b51846f493a8bc77cf14a701;p=clang 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 --- 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);