This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Solve potential VERSION script error w/ OMPT symbols
ClosedPublic

Authored by jplehr on Dec 22 2022, 3:37 PM.

Details

Summary

The patch adds the symbols if OMPT_SUPPORT is not defined.
Github issue: https://github.com/llvm/llvm-project/issues/59660

Diff Detail

Event Timeline

jplehr created this revision.Dec 22 2022, 3:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 22 2022, 3:37 PM
jplehr requested review of this revision.Dec 22 2022, 3:37 PM
Herald added a project: Restricted Project. · View Herald Transcript

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.

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 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.

Thank you Joseph. I'll fix that.

jplehr updated this revision to Diff 485159.Dec 23 2022, 2:24 PM

I was finally able to reproduce the reported issue and fixed it.
Addressed review comments.

This revision is now accepted and ready to land.Dec 24 2022, 7:19 AM