This is an archive of the discontinued LLVM Phabricator instance.

[Libomptarget] Replace libelf with LLVM's Elf libraries
ClosedPublic

Authored by jhuber6 on Aug 8 2022, 8:06 AM.

Details

Summary

This patch replaces the dependency on libelf with LLVM's ELF support.
With this patch the user no-longer needs to have libelf on their
system to build and configure OpenMP offloading. The replacement is
mostly mechanical, with the exception of the hash table support which
was added in D131309.

Depends on D131309

Diff Detail

Event Timeline

jhuber6 created this revision.Aug 8 2022, 8:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 8:06 AM
jhuber6 requested review of this revision.Aug 8 2022, 8:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 8 2022, 8:06 AM
JonChesterfield requested changes to this revision.Aug 8 2022, 8:17 AM

Started reading this but it's too large to get through now. Please remove the template layer over different types of elf.

openmp/libomptarget/plugins/amdgpu/impl/system.cpp
173

shouldn't be templated

225

Not this please. There's only one type of elf it could be.

openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
1586–1588

also no

This revision now requires changes to proceed.Aug 8 2022, 8:17 AM
jhuber6 updated this revision to Diff 450820.Aug 8 2022, 8:34 AM

Removing support of non 64-bit LE ELF files and use of templates for them.

jhuber6 updated this revision to Diff 450829.Aug 8 2022, 8:48 AM

Removing use of const_cast

saiislam accepted this revision.Aug 11 2022, 5:52 AM
saiislam added a subscriber: saiislam.

LGTM. Thanks!

JonChesterfield accepted this revision.Aug 24 2022, 7:34 AM

Looks good, thanks

This revision is now accepted and ready to land.Aug 24 2022, 7:34 AM
jhuber6 updated this revision to Diff 458029.Sep 5 2022, 9:09 AM

Updating after moving symbol look-up interface. This will be used by the CUDA
plugin in the future as well.

jhuber6 updated this revision to Diff 458423.Sep 7 2022, 4:49 AM

Updating after pulling a portion of this implementaiton into the previous patch.

This revision was automatically updated to reflect the committed changes.