<div dir="ltr">Hi,<div><br></div><div>I have a pass that creates a GlobalVariable, when I ran it get the following error:</div><div><br></div><div>Global is external, but doesn't have external or weak linkage!<br></div><div><div>i8** @myvar</div></div><div><br></div><div>This is how I create the GlobalVariable:</div><div><br></div><div>------------------------------------------------ <br></div><div><div>new llvm::GlobalVariable(*M, IRB.getInt8PtrTy(), false,</div><div><span style="white-space:pre">                                </span>   llvm::GlobalValue::CommonLinkage,</div><div><span style="white-space:pre">                                </span>   nullptr, "myvar", NULL,</div><div><span style="white-space:pre">                                </span>   GlobalVariable::GeneralDynamicTLSModel,</div><div><span style="white-space:pre">                          </span>   0, false);</div></div><div>

<div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial">------------------------------------------------ <br></div><div style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;text-decoration-style:initial;text-decoration-color:initial"><br class="gmail-Apple-interchange-newline">

</div>I am using "IRB.getInt8PtrTy()" because this variable will be a pointer to a buffer "char *".</div><div><br></div><div>This used to work with Clang 4.0, I have been trying to port the pass to trunk.</div><div><br></div><div>Did something changed and it's necessary to update the way I create the GlobalVariable?</div><div><br></div><div>Thanks.</div><div>Simone</div></div>