[LIBOMPTARGET]Lower priority of global constructor/destructor to silence the warning...
authorAlexey Bataev <a.bataev@hotmail.com>
Mon, 2 Mar 2020 15:25:58 +0000 (10:25 -0500)
committerAlexey Bataev <a.bataev@hotmail.com>
Mon, 2 Mar 2020 20:15:11 +0000 (15:15 -0500)
Summary: fixed the warning from gcc since prios 0-100 are reserved for the internal use.

Reviewers: grokos

Subscribers: kkwli0, caomhin, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D75458

openmp/libomptarget/src/rtl.cpp

index 3e1b527..3b9efd6 100644 (file)
@@ -37,7 +37,7 @@ std::mutex *TrlTblMtx;
 HostPtrToTableMapTy *HostPtrToTableMap;
 std::mutex *TblMapMtx;
 
-__attribute__((constructor(0))) void init() {
+__attribute__((constructor(101))) void init() {
   DP("Init target library!\n");
   RTLs = new RTLsTy();
   RTLsMtx = new std::mutex();
@@ -47,7 +47,7 @@ __attribute__((constructor(0))) void init() {
   TblMapMtx = new std::mutex();
 }
 
-__attribute__((destructor(0))) void deinit() {
+__attribute__((destructor(101))) void deinit() {
   DP("Deinit target library!\n");
   delete RTLs;
   delete RTLsMtx;