[clang] [Clang][HIP] Skip internalization for non-LTO device links (PR #225859)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 23 10:59:45 PDT 2026


================
@@ -53,19 +53,19 @@ void AMDGCN::Linker::constructLldCommand(Compilation &C, const JobAction &JA,
                                          const llvm::opt::ArgList &Args) const {
   // Construct lld command.
   // The output from ld.lld is an HSA code object file.
-  ArgStringList LldArgs{"-flavor",
-                        "gnu",
-                        "-m",
-                        "elf64_amdgpu",
-                        "--no-undefined",
-                        "-shared",
-                        "-plugin-opt=-amdgpu-internalize-symbols"};
+  const ToolChain &TC = getToolChain();
+  LTOKind LTOMode = TC.getLTOMode(Args, Action::OFK_HIP);
+  ArgStringList LldArgs{"-flavor",        "gnu",    "-m", "elf64_amdgpu",
----------------
jhuber6 wrote:

Unrelated, but this is the `--offload-device-only` path, right? What's stopping us from combining this with the normal `amdgpu::linker`? That one should handle everything normally. I guess the `internalize` call? I don't know if that's still relevant or why it was added in the first place.

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


More information about the cfe-commits mailing list