Clang and llvm already use llvm_setup_rpath(), so this change will
help standarize rpath usage across all projects.
Details
- Reviewers
beanz compnerd phosek EricWF smeenai dexonsmith - Commits
- rGd21aeffc860b: Reland: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
rG7e9453d5837f: Revert [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding…
rG7b4be6f9d833: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
rL323492: Reland: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
rCXX323492: Reland: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
rCXX323459: Revert [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding…
rL323459: Revert [libcxx] r323453 - [cmake] [libcxx] Call llvm_setup_rpath() when adding…
rL323453: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
rCXX323453: [cmake] [libcxx] Call llvm_setup_rpath() when adding shared libraries.
Diff Detail
- Repository
- rL LLVM
Event Timeline
Reopen after rollback.
@smeenai pointed out LLVM may not be available in standalone builds
I probably should have put this in the summary, but the reason for this patch isn't just to clean up the cmake files, it's to fix a cmake configuration failure when cross-compiling for Linux on Darwin:
CMake Error at /Users/dhinton/projects/llvm_project/libcxx/lib/CMakeLists.txt:224 (add_library):
The install of the cxx_shared target requires changing an RPATH from the build tree, but this is not supported with the Ninja generator unless on an ELF-based platform. The CMAKE_BUILD_WITH_INSTALL_RPATH variable may be set to avoid this relinking step.
@hintonda Is there a reason why this was done except for "standardizing the usage across projects"?
I'm asking because this change prevents us from being able to avoid having a rpath completely when building libc++. That is the behavior we want when building libc++ as a system library, in which case we specify the install name dir to be /usr/lib, and we don't want any rpath to appear.
It was just for standardization. Please feel free to rollback or modify as necessary.
Ok, thanks a lot for the information. If things worked before, I would like to revert this change as we are working around it in our internal build, and it just bit me today. I'll send a review.
I proposed a revert here for those who are interested: https://reviews.llvm.org/D91099