On 25/01/2024 23:03, Tobias Burnus wrote:
When targeting AMD GPUs, the LLVM assembler (and linker) are used.

Two days ago LLVM changed the default for theAMDHSA code object version (COV) from 4 to 5. In principle, we do not care which COV is used as long as it works; unfortunately, "mkoffload.cc" also generates an object file directly, bypassing the AMD GPU compiler as it copies debugging data to that file. That object file must have the same COV version (ELF ABI version) as compiler + llvm-mc assembler generated files. In order to ensure those are the same, this patch forces the use of COV 4 instead of using the default. Once GCC requires LLVM >= 14 instead of LLVM >= 13.0.1 we could change it. (Assuming that COV 5 is sufficiently stable in LLVM 14.) - But for now COV 4 will do.
If you wonder how this LLVM issue shows up, simply compile any OpenMP
or OpenACC program with AMD GPU offloading and enable debugging ("-g"),
e.g.
   gcc -fopenmp -g test.f90 -foffload=amdgcn-amdhsa 
-foffload-options=-march=gfx908

With LLVM main (to become LLVM 18), you will then get the error:

   ld: error: incompatible ABI version: /tmp/ccAKx5cz.mkoffload.dbg.o

OK for mainline?

Looks good to me.

The alternative would be to copy the elf flags from another object file; that probably has it's own pitfalls.

OK.

Andrew

Reply via email to