Skip to content

Commit b979afa

Browse files
committed
Also patch rpath of executables
1 parent e4e67ac commit b979afa

40 files changed

+37
-0
lines changed

GraphvizWrapper/graphvizfiles/cp-linux.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,13 @@ find "$TARGET_DIR" -type f -name "*.so*" | while read -r so_file; do
2828
patchelf --set-rpath '$ORIGIN' "$so_file" && echo "RPATH '\$ORIGIN' added to $so_file" || echo "Failed to patch $so_file"
2929
done
3030

31+
echo "Adding RPATH '\$ORIGIN' to all executables in $TARGET_DIR..."
32+
33+
find "$TARGET_DIR" -type f -perm -111 | while read -r exe_file; do
34+
echo "Processing: $exe_file"
35+
# Add or update RPATH to "."
36+
patchelf --set-rpath '$ORIGIN' "$exe_file" && echo "RPATH '\$ORIGIN' added to $exe_file" || echo "Failed to patch $exe_file"
37+
done
38+
3139
echo "RPATH update complete."
40+
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
0 Bytes
Binary file not shown.
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
0 Bytes
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
8 KB
Binary file not shown.
Binary file not shown.
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
#!/bin/bash
2+
3+
# Modify the RPATH of all binaries to make sure all locally deployed dependencies can be found.
4+
5+
# Ensure a directory is provided
6+
if [ $# -ne 1 ]; then
7+
echo "Usage: $0 <directory>"
8+
exit 1
9+
fi
10+
11+
TARGET_DIR=$1
12+
13+
echo "Adding RPATH '\$ORIGIN' to all .so files in $TARGET_DIR..."
14+
15+
find "$TARGET_DIR" -type f -name "*.so*" | while read -r so_file; do
16+
echo "Processing: $so_file"
17+
patchelf --set-rpath '$ORIGIN' "$so_file" && echo "RPATH '\$ORIGIN' added to $so_file" || echo "Failed to patch $so_file"
18+
done
19+
20+
echo "Adding RPATH '\$ORIGIN' to all executables in $TARGET_DIR..."
21+
22+
find "$TARGET_DIR" -type f -perm -111 | while read -r exe_file; do
23+
echo "Processing: $exe_file"
24+
patchelf --set-rpath '$ORIGIN' "$exe_file" && echo "RPATH '\$ORIGIN' added to $exe_file" || echo "Failed to patch $exe_file"
25+
done
26+
27+
echo "RPATH update complete."
28+

0 commit comments

Comments
 (0)