From f5ea9676546ea08ebd57bf4ae8707467e7941470 Mon Sep 17 00:00:00 2001 From: zhoushunjie Date: Wed, 21 Sep 2022 15:56:56 +0800 Subject: [PATCH] Fix rpath setting in linux --- python/scripts/process_libraries.py.in | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/python/scripts/process_libraries.py.in b/python/scripts/process_libraries.py.in index dc81da104..223308711 100644 --- a/python/scripts/process_libraries.py.in +++ b/python/scripts/process_libraries.py.in @@ -39,9 +39,12 @@ def process_on_linux(current_dir): if d not in ["lib", "lib64"]: continue rel_path = os.path.relpath(os.path.join(root, d), libs_path) - rpath = "$ORIGIN/" + rel_path + if path in user_specified_dirs: + # Note(zhoushunjie): Use the absolute path for user_specified_dirs + rpath = os.path.join(root, d) + else: + rpath = "$ORIGIN/" + rel_path rpaths.append(rpath) - for lib in fd_libs: command = "patchelf --set-rpath '{}' {}".format(":".join(rpaths), lib) if platform.machine() != 'sw_64' and platform.machine() != 'mips64':