Skip to content

Commit

Permalink
Mark globals as externallt init on nested link (#2201)
Browse files Browse the repository at this point in the history
  • Loading branch information
wsmoses authored Dec 16, 2024
1 parent fbb386d commit 1c20de3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/compiler/validation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

2 comments on commit 1c20de3

@wsmoses
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/121456

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v0.13.23 -m "<description of version>" 1c20de3658794cea86637e7f0efa511b69b7f94c
git push origin v0.13.23

Please sign in to comment.