-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Copy module metadata for source module, if any. #58508
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
c8760c3 to
a7df949
Compare
|
Looks fine to me. I guess our adhoc linker was fine with this but LLVMs default one complained? |
|
Yeah, IIUC another thing that landed as part of #57010. |
vtjnash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concept that there is a "parent module" seems unsound to me. Does your linker not handle these correctly? I'd expect the LTO linker we're using here to combine these properly.
|
I'm not linking these, that happens as part of ... or an abort when there's a mismatch in stack-protector flags. I considered alternative approaches, either (1) having the fresh modules in the |
I think this option makes the most sense. In theory LLVM already implements it because it uses this same operation in many places. In practice, it isn't exactly optimal, but it is just |
a7df949 to
f1c1c67
Compare
|
Alright, implemented the above suggestion. Since GPUCompiler.jl already calls |
vtjnash
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SGTM
Instead, rely on the linker automatically inheriting the metadata from the parent module. This avoids warnings and aborts with external users such as GPUCompiler.jl.
Instead of omitting module flags for non-toplevel modules and relying on LLVM linker inheritance, copy flags from the source/parent module when creating child modules. This ensures that custom flags (e.g., custom Dwarf Version set by GPUCompiler.jl) are properly propagated to child modules. The jl_create_llvm_module function now takes an optional Module *source parameter. When provided, it copies module flags and properties from the source module; when nullptr, it sets the default Julia flags. Co-Authored-By: Claude Opus 4.5 <[email protected]>
b6ed6fa to
ccb306e
Compare
Instead, rely on the linker automatically inheriting the metadata from the parent module. This avoids warnings and aborts with external users such as GPUCompiler.jl.