[Openmp-commits] [PATCH] D142249: [openmp] Workaround for HSA in issue 60119
Jon Chesterfield via Phabricator via Openmp-commits
openmp-commits at lists.llvm.org
Fri Jan 20 13:49:37 PST 2023
JonChesterfield added inline comments.
================
Comment at: openmp/libomptarget/src/rtl.cpp:47-50
+ if (PM != nullptr) {
+ // In case one of the plugins chooses to call back into this constructor
+ return;
+ }
----------------
Maetveis wrote:
> This isn't necessary, glibc will not run the `__attribute__((constructor(101)))` calls again on a second `dlopen`.
I'm going to stick with paranoia for the time being. Glibc has a per-library flag that it checks to see if it's already initialised, but it's not totally clear to me whether that flag is set at the start or at the end of initialisation, which affects behaviour on the dlopen of libomptarget. Empirically you're right, that branch is dead, but I'm going to leave it there so I have one fewer failure mode to think about.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D142249/new/
https://reviews.llvm.org/D142249
More information about the Openmp-commits
mailing list