libgomp: Fix GOMP_DEVICE_NUM_VAR stringification during offload image load
authorChung-Lin Tang <cltang@codesourcery.com>
Tue, 4 Jan 2022 09:26:23 +0000 (17:26 +0800)
committerChung-Lin Tang <cltang@codesourcery.com>
Tue, 4 Jan 2022 09:26:23 +0000 (17:26 +0800)
commitfbb592407c9dd244b4cea086cbb90d7bd0bf60bb
treea81523145a067c65cf2697e2ec9e7012b1b46e3e
parent1a15451da14410bf2bd6ec8f5baba1014638c67a
libgomp: Fix GOMP_DEVICE_NUM_VAR stringification during offload image load

In the patch that implemented omp_get_device_num(), there was an error where
the stringification of GOMP_DEVICE_NUM_VAR, which is the macro expanding to
the actual symbol used, was erroneously using the STRINGX() macro in the
libgomp offload image symbol search, and expansion of the variable name
string through the additional layer of preprocessor symbol was not properly
achieved.

This patch fixes this by changing to properly use XSTRING(), also from
include/symcat.h.

libgomp/ChangeLog:

* plugin/plugin-gcn.c (GOMP_OFFLOAD_load_image): Change uses of STRINGX
into XSTRING when looking for GOMP_DEVICE_NUM_VAR in offload image.
* plugin/plugin-nvptx.c (GOMP_OFFLOAD_load_image): Likewise.
libgomp/plugin/plugin-gcn.c
libgomp/plugin/plugin-nvptx.c