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)
committerAndrew Stubbs <ams@codesourcery.com>
Fri, 15 Oct 2021 12:28:12 +0000 (13:28 +0100)
commitf3d64372d777d7d6068df8167b6751c289963e85
tree151782c85342f479d5c176e8c0745857ce4f8cf8
parentcbcba1eb28db3c2540957ccb3779f750daea6099
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.
gcc/config/gcn/gcn-hsa.h
gcc/config/gcn/gcn.c
gcc/config/gcn/mkoffload.c