diff --git a/openmp/libomptarget/DeviceRTL/src/Mapping.cpp b/openmp/libomptarget/DeviceRTL/src/Mapping.cpp --- a/openmp/libomptarget/DeviceRTL/src/Mapping.cpp +++ b/openmp/libomptarget/DeviceRTL/src/Mapping.cpp @@ -258,7 +258,10 @@ /// Execution mode /// ///{ -static int SHARED(IsSPMDMode); + +// TODO: This is a workaround for initialization coming from kernels outside of +// the TU. We will need to solve this more correctly in the future. +int __attribute__((used, retain, weak)) SHARED(IsSPMDMode); void mapping::init(bool IsSPMD) { if (mapping::isInitialThreadInLevel0(IsSPMD))