[llvm] [clang] [LinkerWrapper] Support relocatable linking for offloading (PR #80066)

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 31 10:28:54 PST 2024


Artem-B wrote:

Supporting such mixed mode opens an interesting set of issues we may need to consider going forward:
* who/where/how runs initializers in the fully linked parts?
* Are public functions in the fully linked parts visible to the functions in partially linked parts? In the full-rdc mode they would, as if it's a plain C++ compilation. In partial they would not as the main GPU executable and the partial parts will be in separate executables. 

This would be OK for something like CUDA where cross-TU references are usually limited to host, but would be surprising for someone who would expect C++-like behavior, which sort of the ultimate goal for offloading use case. This will eventually become a problem if/when we grow large enough subset of independent offload-enabled libraries. The top-level user will have a hard time figuring out what's visible and what is not, unless the libraries deliberately expose only host-level APIs, if/when they fully link GPU side code.

 

https://github.com/llvm/llvm-project/pull/80066


More information about the cfe-commits mailing list