diff --git a/src/compiler/validation.jl b/src/compiler/validation.jl index dbd0c14773..61b6079e10 100644 --- a/src/compiler/validation.jl +++ b/src/compiler/validation.jl @@ -1023,6 +1023,12 @@ function check_ir!(@nospecialize(job::CompilerJob), errors::Vector{IRError}, imp linkage!(fn, LLVM.name(fn) != pname ? LLVM.API.LLVMInternalLinkage : LLVM.API.LLVMExternalLinkage) end end + + for glob in globals(pmod) + if LLVM.linkage(glob) == LLVM.API.LLVMExternalLinkage + LLVM.initializer!(glob, nothing) + end + end GPUCompiler.link_library!(mod, pmod)