Skip to content

Commit 17918a9

Browse files
committed
Merge #20046: depends: Set CMAKE_INSTALL_RPATH for native packages
7d0271b depends: Set CMAKE_INSTALL_RPATH for native packages (Russell Yanofsky) Pull request description: This PR is part of the [process separation project](https://github.com/bitcoin/bitcoin/projects/10). --- After #19685 started setting `LDFLAGS`, the `INSTALL_RPATH_USE_LINK_PATH` cmake option used in the libmultiprocess build no longer works, so it is neccessary to set `CMAKE_INSTALL_RPATH` as a fallback. It's unclear currently whether the bad interaction between `INSTALL_RPATH_USE_LINK_PATH` and `LDFLAGS` is a bug, but the issue is reported: - bitcoin/bitcoin#19981 (comment) - https://discourse.cmake.org/t/install-rpath-use-link-path-not-working-when-cmake-exe-linker-flags-ldflags-is-set/1892 Fixes #19981 ACKs for top commit: fanquake: ACK 7d0271b - I haven't looked in depth, but I've re-read through #19981 and checked the failure by testing #19160 (with this reverted): dongcarl: ACK 7d0271b Looked into this a bit, it makes sense that for the things we build in depends, we want the library search to start in depends. It seems reasonable to expect this to happen automatically when `CMAKE_INSTALL_PREFIX` and `INSTALL_RPATH_USE_LINK_PATH` are set, but oh well... Tree-SHA512: 97cc5801c3204c14cd33004423631456ca0701e2127ee5146810a76e2f4aac9de1f4b5437402a4329cda54e022dc99270fee7e38c2995765f36b3848215fa78e
2 parents 0038ce9 + 7d0271b commit 17918a9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

depends/funcs.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,9 @@ $(1)_cmake=env CC="$$($(1)_cc)" \
163163
CXXFLAGS="$$($(1)_cppflags) $$($(1)_cxxflags)" \
164164
LDFLAGS="$$($(1)_ldflags)" \
165165
cmake -DCMAKE_INSTALL_PREFIX:PATH="$$($($(1)_type)_prefix)"
166-
ifneq ($($(1)_type),build)
166+
ifeq ($($(1)_type),build)
167+
$(1)_cmake += -DCMAKE_INSTALL_RPATH:PATH="$$($($(1)_type)_prefix)/lib"
168+
else
167169
ifneq ($(host),$(build))
168170
$(1)_cmake += -DCMAKE_SYSTEM_NAME=$($(host_os)_cmake_system)
169171
$(1)_cmake += -DCMAKE_C_COMPILER_TARGET=$(host)

0 commit comments

Comments
 (0)