Author: Atmn Patel Date: 2021-02-02T22:04:20-05:00 New Revision: c0097c784179e6f927ed8ae6b28796faee2fea61
URL: https://github.com/llvm/llvm-project/commit/c0097c784179e6f927ed8ae6b28796faee2fea61 DIFF: https://github.com/llvm/llvm-project/commit/c0097c784179e6f927ed8ae6b28796faee2fea61.diff LOG: [OpenMP][Libomptarget] Remove possible harmful copy constructor call for RTLsTy >From https://bugs.llvm.org/show_bug.cgi?id=48973, we know that `std::call_once(PM->RTLs.initFlag, &RTLsTy::LoadRTLs, PM->RTLs)` causes compile time problems in libstdc++v3 5.3.1. This is because there was a defect in the standard regarding the `call_once` (LWG 2442). This was fixed in libstdc++ soon thereafter, but there are likely other standard libraries where this will fail. By matching this function call with the other one, we fix this bug. Differential Revision: https://reviews.llvm.org/D95769 Added: Modified: openmp/libomptarget/src/interface.cpp Removed: ################################################################################ diff --git a/openmp/libomptarget/src/interface.cpp b/openmp/libomptarget/src/interface.cpp index 239570935cb2..cf6d36960c75 100644 --- a/openmp/libomptarget/src/interface.cpp +++ b/openmp/libomptarget/src/interface.cpp @@ -94,7 +94,7 @@ EXTERN void __tgt_register_requires(int64_t flags) { /// adds a target shared library to the target execution image EXTERN void __tgt_register_lib(__tgt_bin_desc *desc) { TIMESCOPE(); - std::call_once(PM->RTLs.initFlag, &RTLsTy::LoadRTLs, PM->RTLs); + std::call_once(PM->RTLs.initFlag, &RTLsTy::LoadRTLs, &PM->RTLs); for (auto &RTL : PM->RTLs.AllRTLs) { if (RTL.register_lib) { if ((*RTL.register_lib)(desc) != OFFLOAD_SUCCESS) { _______________________________________________ llvm-branch-commits mailing list llvm-branch-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits