From 2012d9bf079e048cf52d947e7eb6ba5ee535a003 Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Fri, 9 Aug 2024 21:14:23 +0200 Subject: [PATCH] build-system: don't override RPATH The RPATH shouldn't be overriden. Packages like conda set an RPATH. If it is changed conda doesn't work any more. --- Pmodules/libpbuild.bash | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Pmodules/libpbuild.bash b/Pmodules/libpbuild.bash index 41e2d70..c01ea7a 100644 --- a/Pmodules/libpbuild.bash +++ b/Pmodules/libpbuild.bash @@ -1291,12 +1291,18 @@ _build_module() { local -- rpath='' local -i depth=0 for fname in "${bin_objects[@]}"; do + # don't override existing RPATH + rpath=$(patchelf --print-rpath "${fname}") + [[ -z "${rpath}" ]] || continue (( depth=$(std::get_dir_depth "${fname}") + group_depth + 3 )) rpath='$ORIGIN/'$(printf "../%.0s" $(${seq} 1 ${depth}))lib64 ${patchelf} --force-rpath --set-rpath "${rpath}" "${fname}" done mapfile -t bin_objects < <(std::find_shared_objects '.') for fname in "${bin_objects[@]}"; do + # don't override existing RPATH + rpath=$(patchelf --print-rpath "${fname}") + [[ -z "${rpath}" ]] || continue (( depth=$(std::get_dir_depth "${fname}") + group_depth + 3 )) rpath='$ORIGIN/'$(printf "../%.0s" $(${seq} 1 ${depth}))lib64 ${patchelf} --force-rpath --set-rpath "${rpath}" "${fname}"