[clang] [HIP] Use linker wrapper for device-only code object links (PR #211675)

Yaxun Liu via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 14 07:43:58 PDT 2026


================
@@ -9781,7 +9786,24 @@ void LinkerWrapper::ConstructJob(Compilation &C, const JobAction &JA,
                                  const InputInfoList &Inputs,
                                  const ArgList &Args,
                                  const char *LinkingOutput) const {
+  constructJob(C, JA, InputInfoList{Output}, Inputs, Args, LinkingOutput);
+}
+
+void LinkerWrapper::ConstructJobMultipleOutputs(
----------------
yxsamliu wrote:

I reworked this to avoid adding a new raw-output mode to `clang-linker-wrapper`.

The linker wrapper now only emits the fatbin as before. For `--no-gpu-bundle-output`, the driver adds a normal unbundling step after the wrapper. This keeps raw image output handling in the driver and reuses the existing offload bundler path instead of adding more special handling to the wrapper.

I do not think we can drop `--no-gpu-bundle-output`. There are existing users that depend on raw device images. Compiler Explorer uses it for HIP/AMDGPU output display. COMGR uses it in the SPIR-V compilation path. HIP tests use it to build raw `.spv` module inputs. Other tooling also uses it to get raw `.hsaco` files instead of fat binaries. Dropping this mode would regress those users.

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


More information about the cfe-commits mailing list