[amdgpu-arch] Fix rpath to run from build dir
authorJon Chesterfield <jonathanchesterfield@gmail.com>
Thu, 6 May 2021 12:06:59 +0000 (13:06 +0100)
committerJon Chesterfield <jonathanchesterfield@gmail.com>
Thu, 6 May 2021 12:07:00 +0000 (13:07 +0100)
commitb24e9f82b71f325214c41fdc3f106207cc2244a6
treead0aa82970d300fd6c09d5ba1b75ae651a619089
parent67cfefebbbbb3a5923c47c31293a8f76596de8be
[amdgpu-arch] Fix rpath to run from build dir

[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.

Reviewed By: pdhaliwal

Differential Revision: https://reviews.llvm.org/D101926
clang/tools/amdgpu-arch/CMakeLists.txt