[PATCH] D146918: [CMake] Don't set absolute paths as install runpaths on ELF platforms in llvm_setup_rpath()

Finagolfin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu May 18 11:20:06 PDT 2023


finagolfin added a comment.

> Can I check if this statement is correct?

Sure, simply run the `readelf` commands from this commit message or something similar on the clang toolchain you built, both in your build and install directories, and perhaps with this commit reverted too.

> I think it is 'not incorrect' for the rpath to point to LLVM_LIBRARY_DIR, which is the install path at least for the nixpkgs llvm install.

You may be right that it is okay to add `LLVM_LIBRARY_DIR` to the install runpath if the subproject built separately is being built against already-installed LLVM libraries, but that is not usually the case. For example, compiler-rt is always built separately, so it previously always had these incorrect runpaths to the LLVM build directory, as I showed with the official LLVM 16 build for linux in this commit message.

Given that it isn't usually the case, we certainly shouldn't add that install runpath by default, and you can always add it to the configuration yourself for scenarios like yours <https://github.com/llvm/llvm-project/blob/f649599ea93301bd0d0a2b8e450d1f77425ea92e/llvm/cmake/modules/AddLLVM.cmake#L2329>.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146918/new/

https://reviews.llvm.org/D146918



More information about the llvm-commits mailing list