Fix rpath setting in linux

This commit is contained in:
zhoushunjie
2022-09-21 15:56:56 +08:00
parent e8e4ef30b1
commit f5ea967654

View File

@@ -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)
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':