[clang] [Clang][SYCL] Introduce clang-sycl-link-wrapper to link SYCL offloading device code (Part 1 of many) (PR #112245)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Tue Oct 15 16:10:50 PDT 2024


jhuber6 wrote:

> > I don't think `lld` makes sense, but you can definitely use the LTO interface inside of this tool to create a similar effect.
> 
> Why not? `lld` is a toolchain linker (which you said this is supposed to emulate), and it is an interface to the LTO interface... so it seems to me like `lld` is the right place to do this.

I guess the closest analogue would be the WASM target?  It seems like overkill since the `ld.lld` source code doesn't really share much code and  this target pretty much only consumes LLVM-IR. I guess @MaskRay can vote on what makes sense here, since AFAIK (I'm not a SYCL or SPIR-V guy) this is mostly just wrapping some toolchain specific magic around LTO linking. You could totally do it even with the ELF target if you just pass `-Wl,--lto-emit-llvm`, I think the SPIR-V target might work soonish so maybe that's a reasonable option.

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


More information about the cfe-commits mailing list