This is an archive of the discontinued LLVM Phabricator instance.

[amdgpu-arch] Fix rpath to run from build dir
ClosedPublic

Authored by JonChesterfield on May 5 2021, 11:15 AM.

Details

Summary

[amdgpu-arch] Fix rpath to run from build dir

Prior to this, amdgpu-arch has RUNPATH set to $ORIGIN/../lib which works
for some installs, but not from the build directory where clang executes
the tool from when running tests.

This cmake option adds the location of the rocr runtime to the RUNPATH
(note, it amends RUNPATH here, despite the cmake option referring to RPATH)
to create a binary that runs from build or install location.

Before:
RUNPATH [$ORIGIN/../lib]
After:
RUNPATH [$ORIGIN/../lib:$HOME/llvm-install/lib]

Credit to Greg for knowing this trick and pointing to examples of it in use
for the aomp build scripts.

Diff Detail

Event Timeline

JonChesterfield requested review of this revision.May 5 2021, 11:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptMay 5 2021, 11:15 AM
pdhaliwal accepted this revision.May 5 2021, 11:50 PM

Looks good to me.

clang/tools/amdgpu-arch/CMakeLists.txt
17

Curious, does this fix the linking issue mentioned in https://reviews.llvm.org/D99949#2739522?

This revision is now accepted and ready to land.May 5 2021, 11:50 PM

It does indeed fix that comment from D99949

This revision was landed with ongoing or failed builds.May 6 2021, 5:07 AM
This revision was automatically updated to reflect the committed changes.