diff --git a/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h b/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h --- a/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h +++ b/openmp/libomptarget/deviceRTLs/amdgcn/src/target_impl.h @@ -30,6 +30,10 @@ #define INLINE inline #define NOINLINE __attribute__((noinline)) #define ALIGN(N) __attribute__((aligned(N))) +#define PLUGIN_ACCESSIBLE \ + __attribute__((used)) /* Don't discard values the plugin reads */ \ + __attribute__((visibility("default"))) /* Access via SHT_HASH */ \ + __attribute__((section(".data"))) /* Not .bss, can write before load */ #include "llvm/Frontend/OpenMP/OMPGridValues.h" diff --git a/openmp/libomptarget/deviceRTLs/common/src/omp_data.cu b/openmp/libomptarget/deviceRTLs/common/src/omp_data.cu --- a/openmp/libomptarget/deviceRTLs/common/src/omp_data.cu +++ b/openmp/libomptarget/deviceRTLs/common/src/omp_data.cu @@ -19,6 +19,7 @@ // global device environment //////////////////////////////////////////////////////////////////////////////// +PLUGIN_ACCESSIBLE omptarget_device_environmentTy omptarget_device_environment; //////////////////////////////////////////////////////////////////////////////// diff --git a/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h b/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h --- a/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h +++ b/openmp/libomptarget/deviceRTLs/nvptx/src/target_impl.h @@ -26,6 +26,7 @@ #define INLINE inline __attribute__((always_inline)) #define NOINLINE __attribute__((noinline)) #define ALIGN(N) __attribute__((aligned(N))) +#define PLUGIN_ACCESSIBLE /* no annotation needed for cuda plugin */ #include "llvm/Frontend/OpenMP/OMPGridValues.h"