[clang] [llvm] [clang][SYCL] Add -fno-sycl-rdc to finalize device code per translation unit (PR #218089)

Tom Honermann via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 28 21:30:14 PDT 2026


================
@@ -7735,6 +7735,15 @@ def fsycl_host_only : Flag<["-"], "fsycl-host-only">,
 def sycl_link : Flag<["--"], "sycl-link">, Flags<[HelpHidden]>,
   HelpText<"Perform link through clang-sycl-linker via the target "
   "offloading toolchain.">;
+def : Flag<["-"], "fsycl-rdc">, Alias<fgpu_rdc>;
+def : Flag<["-"], "fno-sycl-rdc">, Alias<fno_gpu_rdc>,
+  HelpText<"Generate non-relocatable device code during SYCL offload target "
+           "compilation. Use of this option in combination with '-c' will "
+           "produce final device binaries within the generated fat object. "
+           "When using this option, each kernel must be self-contained within "
+           "its translation unit (source file); a device function defined in "
+           "another translation unit cannot be called, even if declared "
+           "SYCL_EXTERNAL.">;
----------------
tahonermann wrote:

Perhaps we should introduce `-foffload-rdc` and `-fno-offload-rdc` with `-fgpu-rdc` and `-fno-gpu-rdc` (and `-fcuda-rdc` and `-fno-cuda-rdc`) demoted to aliases for consistency with general direction elsewhere. 

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


More information about the llvm-commits mailing list