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

Peter Waller via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 19 01:31:56 PDT 2023


peterwaller-arm added a comment.

First off, thanks for the discourse!

> Can you rephrase this? I don't know what you mean. [...]

You're right, I didn't express this well. My thinking was that logically: if e.g. clang is broken when you install it because it's pointing at an LLVM build directory (which no longer exists), why wouldn't you also install LLVM? And therefore, why wouldn't you point `LLVM_LIBRARY_DIR` at the LLVM install rather than the build directory?

The logical issue is based on these notions that I currently hold:

- The change in this differential affects installs.
- If the install is the thing which is broken and needs fixing, we are installing, by definition.
- Why not do the right thing for installing overall, and therefore point `LLVM_LIBRARY_DIR` to the install path?
- Nobody expects to point `LLVM_LIBRARY_DIR` to a build dir, and then remove that build dir, and expect the installed references work.
- If you're going to expect it to work in the end (with a removed bulid directory), LLVM must be installed, and therefore `LLVM_LIBRARY_DIR` should point to that existing install location.

Can you explain a need to a) point `LLVM_LIBRARY_DIR` to a build directory, b) where a downstream project will get installed, and c) LLVM will not?

It seems to me that if you're pointing `LLVM_LIBRARY_DIR` at a build directory which differs from the installed one, that is another risky case for something breaking, since the configurations of the build and install may not match.

> it is set to the LLVM build directory by default [ed: link to https://github.com/llvm/llvm-project/blob/d763c6e5e2d0a6b34097aa7dabca31e9aff9b0b6/llvm/CMakeLists.txt#L424]

I'm not seeing that as evidence that it's set to the build directory as a more common use case -- what I see there is that those values are meant to match up with llvm-config, which I think of as an install artifact which can be used to determine paths for out of tree projects to build and linking against LLVM, which I would expect to contain install paths and not build paths (?).


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