This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][libomp] Cleanup version script and exported symbols

Authored by jlpeyton on Nov 15 2022, 11:16 AM.



This patch is an attempt to fix issues seen once is applied.

The exports_so.txt file attempts to export functions which may not exist
depending on which features are enabled/disabled in the OpenMP
runtime library. There are not many of these so exporting dummy
symbols is feasible.

  1. Export dummy __kmp_reset_stats() function when stats is disabled.
  2. Export dummy debugging data when USE_DEBUGGER is disabled
  3. Export dummy __kmp_itt_[fini|init]_ittlib() functions when ITT Notify is disabled
  4. Export dummy __kmp_reap_monitor() function when KMP_USE_MONITOR is disabled
  5. Remove __kmp_launch_monitor and __kmp_launch_worker from being exported. They have been static symbols since library inception.


Diff Detail

Event Timeline

jlpeyton created this revision.Nov 15 2022, 11:16 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 15 2022, 11:16 AM
jlpeyton requested review of this revision.Nov 15 2022, 11:16 AM

i applied the lld patch and this one, then ran the equivalent of our buildbot, all good, builds and passes.

jhuber6 accepted this revision.Nov 18 2022, 12:03 PM

I think multiple version scripts would've been more correct so we don't export symbols that the user can't do anything useful with. But realistically I'm not too attached to the idea given that it would probably take more effort for little gain. I'm fine with this, others and @MaskRay may wish to comment further.

This revision is now accepted and ready to land.Nov 18 2022, 12:03 PM

Very appreciate your and jhuber6's efforts to fix the symbol versioning issues for OpenMP!


Yes that I see a lot of FALSE in openmp/ since it was imported from a pretty old code base.
Does 0 or false apply?

tianshilei1992 added inline comments.

I think we should keep the same code style as before for consistence. That’s also one of the reasons that even new code for libomp still doesn’t use LLVM code style.

Very appreciate your and jhuber6's efforts to fix the symbol versioning issues for OpenMP!

I agree with @tianshilei1992. I'd like to keep the code style consistent.

MaskRay accepted this revision.Dec 3 2022, 4:19 PM