From f0c702e2c1c2b0171176f55ac860634310a6b6d5 Mon Sep 17 00:00:00 2001 From: Jessica Hamilton Date: Tue, 6 Jul 2021 23:05:25 +0000 Subject: [PATCH] build: add rpath for build tools. * Allows invoking build tools at the command line without having to mess with the LD library path environment variables * Does not change the use of HOST_ADD_BUILD_COMPATIBILITY_LIB_DIR within the build itself * Darwin currently excluded, as it uses a different method for specifying rpath Change-Id: I4db443f2b5824ee70ad44418251a9996c14663bc Reviewed-on: https://review.haiku-os.org/c/haiku/+/4163 Tested-by: Commit checker robot Reviewed-by: Alex von Gluck IV Reviewed-by: Adrien Destugues --- build/jam/BuildSetup | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/build/jam/BuildSetup b/build/jam/BuildSetup index d8502eef67..c8b8c9d16a 100644 --- a/build/jam/BuildSetup +++ b/build/jam/BuildSetup @@ -377,6 +377,12 @@ HOST_LIBROOT = libroot_build_function_remapper.a libroot_build.so ; HOST_STATIC_LIBROOT = libroot_build_function_remapper.a libroot_build.a ; HOST_LIBBE = libbe_build.so ; +# adding rpath allows directly invoking host tools without specifying +# a library search path +if $(HOST_PLATFORM) != darwin { + HOST_LINKFLAGS += -Wl,-rpath,$(HOST_BUILD_COMPATIBILITY_LIB_DIR) ; +} + if $(HOST_PLATFORM_HAIKU_COMPATIBLE) { # the C++ standard and support libraries if $(HOST_CC_IS_LEGACY_GCC) = 1 {