[OpenMP][FIX] Ensure thread and team state are defined properly
authorJohannes Doerfert <johannes@jdoerfert.de>
Fri, 22 Jul 2022 00:29:18 +0000 (19:29 -0500)
committerJohannes Doerfert <johannes@jdoerfert.de>
Fri, 22 Jul 2022 02:57:14 +0000 (21:57 -0500)
The namespaces were missing causing the symbols to have "C" mangling.
To avoid this in the future we qualify the names now fully.

openmp/libomptarget/DeviceRTL/src/State.cpp

index c72932a..7a73330 100644 (file)
@@ -219,13 +219,13 @@ void state::TeamStateTy::assertEqual(TeamStateTy &Other) const {
   ASSERT(HasThreadState == Other.HasThreadState);
 }
 
-namespace {
-
-state::TeamStateTy SHARED(TeamState);
+state::TeamStateTy SHARED(_OMP::state::TeamState);
 
 __attribute__((loader_uninitialized))
-state::ThreadStateTy *ThreadStates[mapping::MaxThreadsPerTeam];
-#pragma omp allocate(ThreadStates) allocator(omp_pteam_mem_alloc)
+state::ThreadStateTy *_OMP::state::ThreadStates[mapping::MaxThreadsPerTeam];
+#pragma omp allocate(_OMP::state::ThreadStates) allocator(omp_pteam_mem_alloc)
+
+namespace {
 
 int returnValIfLevelIsActive(int Level, int Val, int DefaultVal,
                              int OutOfBoundsVal = -1) {