diff options
author | Louis Dionne <ldionne@apple.com> | 2020-11-09 16:10:13 -0500 |
---|---|---|
committer | Louis Dionne <ldionne@apple.com> | 2020-11-09 16:56:03 -0500 |
commit | 8d51969bd40a0351ed2f0be54c61b1e62b0b433c (patch) | |
tree | 78d8ce1d835ce49a33e8e466c6aedb522114ea65 /clang/lib/Frontend/CompilerInvocation.cpp | |
parent | 142c6f82fda8d406ed26f1205d22dc1782653b32 (diff) | |
download | llvm-8d51969bd40a0351ed2f0be54c61b1e62b0b433c.zip llvm-8d51969bd40a0351ed2f0be54c61b1e62b0b433c.tar.gz llvm-8d51969bd40a0351ed2f0be54c61b1e62b0b433c.tar.bz2 |
[runtimes] Avoid overwriting the rpath unconditionally
When building the runtimes, it's very important not to add rpaths unless
the user explicitly asks for them (the standard way being CMAKE_INSTALL_RPATH),
or to change the install name dir unless the user requests it (via
CMAKE_INSTALL_NAME_DIR).
llvm_setup_rpath() would override the install_name_dir of the runtimes
even if CMAKE_INSTALL_NAME_DIR was specified to something, which is wrong
and in fact even "dangerous" for the runtimes.
This issue was discovered when trying to build libc++ and libc++abi as
system libraries for Apple, where we set the install name dir to /usr/lib
explicitly. llvm_setup_rpath() would cause libc++ to have the wrong install
name dir, and for basically everything on the system to fail to load.
This was discovered just now because we previously used something closer
to a standalone build, where llvm_setup_rpath() wouldn't exist, and hence
not be used.
This is a revert of the following commits:
libunwind: 3a667b9bd8b741f5ac1d8d47857140a3d70737fb
libc++abi: 4877063e195dfcc128451bbf3dd7b03d04d2562f
libc++: 88434fe05fdb112a33052c4d8a91c9e989cb032d
Those added llvm_setup_rpath() for consistency, so it seems reasonable
to revert.
Differential Revision: https://reviews.llvm.org/D91099
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions