]> git.ipfire.org Git - thirdparty/gcc.git/commit
amdgcn: fix up offload debug linking with LLVM 13
authorAndrew Stubbs <ams@codesourcery.com>
Wed, 13 Oct 2021 10:53:42 +0000 (11:53 +0100)
committerTobias Burnus <tobias@codesourcery.com>
Mon, 18 Oct 2021 06:10:44 +0000 (08:10 +0200)
commitcc84160c5f470b23b7aed4633f887df113b2675d
tree94c86d60061b6065ff81c1c7793a411482ac747a
parent23ced2dc8346dd9670fc2a160f2e06b2d2e86a47
amdgcn: fix up offload debug linking with LLVM 13

Between LLVM 9 and LLVM 13 the attribute works differently in several ways,
and this needs to be allowed for in GCC and mkoffload independently.

This patch fixes up mkoffload when debug info is enabled, which is made more
complicated because the configure tests checks whether the attribute option
is accepted silently, but does not check if the assembler actually sets the
ELF flags for that attribute, and mkoffload needs to mimick that behaviour
exactly. The patch therefore removes some of the conditionals.

gcc/ChangeLog:

* config/gcn/gcn-hsa.h (S_FIJI): Set unconditionally.
(S_900): Likewise.
(S_906): Likewise.
* config/gcn/gcn.c: Hard code SRAM ECC settings for old architectures.
* config/gcn/mkoffload.c (ELFABIVERSION_AMDGPU_HSA): Rename to ...
(ELFABIVERSION_AMDGPU_HSA_V3): ... this.
(ELFABIVERSION_AMDGPU_HSA_V4): New.
(SET_SRAM_ECC_UNSUPPORTED): New.
(copy_early_debug_info): Create elf flags to match the other objects.
(main): Just let the attribute flags pass through.

(cherry picked from commit f3d64372d777d7d6068df8167b6751c289963e85)
gcc/config/gcn/gcn-hsa.h
gcc/config/gcn/gcn.c
gcc/config/gcn/mkoffload.c