The patch adds the symbols if OMPT_SUPPORT is not defined.
Github issue: https://github.com/llvm/llvm-project/issues/59660
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I don't think you can assign functions to zero, since these are functions we should probably just make them empty or return nullptr just in case someone actually calls it. Also these will need to be extern "C" since we're in a C++ file. Also, go ahead and put it at the bottom of the file since these have zero utility it shouldn't be the first thing the user sees.
I don't know why the problem is showing up now. ompt_start_tool has been there for a long time. While libomp_ompt_connect is new, it is unconditionally defined.
BTW, both of them are defined in openmp/runtime/src/ompt-general.cpp.
AFAICT the issue shows up when linkers error out when trying to export symbols that are not present. This is behavior that was changed in more recent versions of, e.g., lld.
While these are defined in the ompt-general.cpp file, this file is not included in the build when the user wants to build w/o OMPT support. The VERSION script, however, does not respect these configure-time options, so it tries to export the symbols, which are not there.
So, I thought, we should simply have these symbols defined somewhere, even w/o OMPT support., so the VERSION script does not complain.
I was finally able to reproduce the reported issue and fixed it.
Addressed review comments.