[clang] [llvm] [Offload] Change ELF machine type for SPIR-V OpenMP image (PR #159623)

Joseph Huber via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 19 07:12:55 PDT 2025


================
@@ -423,9 +423,10 @@ Error offloading::intel::containerizeOpenMPSPIRVImage(
   Header.Class = ELF::ELFCLASS64;
   Header.Data = ELF::ELFDATA2LSB;
   Header.Type = ELF::ET_DYN;
-  // Use an existing Intel machine type as there is not one specifically for
-  // Intel GPUs.
-  Header.Machine = ELF::EM_IA_64;
+  // Use a fake machine type as there is not one specifically for
+  // Intel GPUs, the associated runtime plugin is looking for
+  // this value.
+  Header.Machine = 0x8086;
----------------
jhuber6 wrote:

It'd obviously be best to go the official route if this is going to be used in a real context, if it's just a test then I guess we can keep it as a constant. But I would definitely question why Intel hasn't already defined this if it's their official ELF format.

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


More information about the llvm-commits mailing list