libgomp: Unbreak gcn offload build
authorJakub Jelinek <jakub@redhat.com>
Fri, 12 Nov 2021 15:11:02 +0000 (16:11 +0100)
committerJakub Jelinek <jakub@redhat.com>
Fri, 12 Nov 2021 15:11:02 +0000 (16:11 +0100)
commitf49c7a4fb23d82c89c97acec88770b300c903d9a
treed749f9a8f986e833f60fe9496c93f9a23069aab0
parent847f587dc478654b5139ef5bb2e228024143c512
libgomp: Unbreak gcn offload build

My recent libgomp change apparently broke libgomp build for gcn offloading.
The problem is that gcn, unlike nvptx, doesn't override teams.c source file
and the patch I've committed assumed all the non-LIBGOMP_USE_PTHREADS targets
do not use it.  My understanding is that gcn included omp_get_num_teams
and omp_get_team_num definitions in both icv-device.o and teams.o,
with the definitions only in the former working correctly.

This patch brings gcn into sync with how nvptx does it, that teams.c
is overridden, provides a dummy GOMP_teams_reg and omp_get_{num_teams,team_num}
definitions and icv-device.c doesn't provide those.

2021-11-12  Jakub Jelinek  <jakub@redhat.com>

PR target/103201
* config/gcn/icv-device.c (omp_get_num_teams, omp_get_team_num): Move
to ...
* config/gcn/teams.c: ... here.  New file.
libgomp/config/gcn/icv-device.c
libgomp/config/gcn/teams.c [new file with mode: 0644]