From dafcea208f9a6d5d22acd59186189f891214ba3b Mon Sep 17 00:00:00 2001 From: "William S. Moses" Date: Sun, 15 Dec 2024 03:04:05 -0500 Subject: [PATCH] Mark globals as externallt init on nested link --- src/compiler/validation.jl | 6 ++++++ 1 file changed, 6 insertions(+) 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)