[llvm-dev] Global is external, but doesn't have external or weak linkage!

Simone Atzeni via llvm-dev llvm-dev at lists.llvm.org
Wed May 16 16:54:54 PDT 2018


Hi,

I have a pass that creates a GlobalVariable, when I ran it get the
following error:

Global is external, but doesn't have external or weak linkage!
i8** @myvar

This is how I create the GlobalVariable:

------------------------------------------------
new llvm::GlobalVariable(*M, IRB.getInt8PtrTy(), false,
   llvm::GlobalValue::CommonLinkage,
   nullptr, "myvar", NULL,
   GlobalVariable::GeneralDynamicTLSModel,
   0, false);
------------------------------------------------

I am using "IRB.getInt8PtrTy()" because this variable will be a pointer to
a buffer "char *".

This used to work with Clang 4.0, I have been trying to port the pass to
trunk.

Did something changed and it's necessary to update the way I create the
GlobalVariable?

Thanks.
Simone
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180516/f6b598d2/attachment.html>


More information about the llvm-dev mailing list