Page MenuHomePhabricator

[openmp] [elf_common] Fix linking against LLVM dylib
ClosedPublic

Authored by mgorny on Oct 3 2021, 11:28 PM.

Details

Summary

The hand-rolled linking logic in elf_common does not account for
the possibility of using LLVM dylib rather than a dozen static
libraries. Since it does not seem to be easily convertible
to add_llvm_library, just hand-roll support for LLVM_LINK_LLVM_DYLIB.
This is necessary to support stand-alone builds against installed LLVM.

Diff Detail

Event Timeline

mgorny created this revision.Oct 3 2021, 11:28 PM
mgorny requested review of this revision.Oct 3 2021, 11:28 PM
JonChesterfield accepted this revision.Oct 3 2021, 11:55 PM

Thanks! These cmake files (libomptarget) seem to be quite high maintenance. I don't know whether it's possible to reuse cmake functions from the rest of llvm instead of iterating on these

This revision is now accepted and ready to land.Oct 3 2021, 11:55 PM
This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptOct 4 2021, 12:29 AM

Thanks! These cmake files (libomptarget) seem to be quite high maintenance. I don't know whether it's possible to reuse cmake functions from the rest of llvm instead of iterating on these

I don't really know. Back in the day, I think the idea was that openmp isn't supposed to depend on LLVM but this seems to be no longer the case.

Current state is libomp builds without use of llvm, libomptarget requires llvm. Initially just headers, but partway through implementing yet another elf wrapper library (for windows) that policy changed to depending on llvm directly. Aside from some rough edges in the build scripts this doesn't seem to have broken anyone.