Page MenuHomePhabricator

[Libomptarget] Replace use of `dlopen` with LLVM's dynamic library support
ClosedPublic

Authored by jhuber6 on Aug 9 2022, 9:48 AM.

Details

Summary

This patch replaces uses of dlopen and dlsym with LLVM's support
with loadPermanentLibrary and getSymbolAddress. This allows us to
remove the explicit dependency on the dl libraries in the CMake. This
removes another explicit dependency and solves an issue encountered
while building on Windows platforms. The one downside to this is that
the LLVM library does not currently support dlclose functionality, but
this could be added in the future.

Diff Detail

Event Timeline

jhuber6 created this revision.Aug 9 2022, 9:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2022, 9:48 AM
jhuber6 requested review of this revision.Aug 9 2022, 9:48 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 9 2022, 9:48 AM
jhuber6 updated this revision to Diff 451243.Aug 9 2022, 12:43 PM

Rebasing on D131516 which simplified the use of dlopen so this patch can easily replace it.

jhuber6 updated this revision to Diff 451245.Aug 9 2022, 12:47 PM

Remove use of last dlfcn header.

jhuber6 edited the summary of this revision. (Show Details)Aug 9 2022, 12:47 PM
jhuber6 updated this revision to Diff 451246.Aug 9 2022, 12:49 PM

Fix duplicated header.

JonChesterfield accepted this revision.Aug 24 2022, 7:31 AM
This revision is now accepted and ready to land.Aug 24 2022, 7:31 AM