mirror of
https://github.com/stenzek/duckstation.git
synced 2026-11-16 11:04:32 +01:00
CMake: Use DT_RPATH instead of DT_RUNPATH on Linux
Preloaded libraries that interpose dlopen() (e.g. NoMachine) prevented our dependencies from being found, since only the caller's RUNPATH is searched.
This commit is contained in:
3 files changed
+10
-1
No files matched your search
@@ -131,6 +131,10 @@ $LINUXDEPLOY --plugin qt --appdir="$OUTDIR" --executable="$BUILDDIR/bin/duckstat
|
||||
--desktop-file="$ROOTDIR/scripts/appimage/org.duckstation.DuckStation.desktop" \
|
||||
--icon-file="$ROOTDIR/scripts/appimage/org.duckstation.DuckStation.png" \
|
||||
|
||||
# linuxdeploy sets DT_RUNPATH, which dlopen() ignores when called through an interposing preloaded library.
|
||||
echo "Patching RPATH in $BINARY..."
|
||||
"$PATCHELF" --force-rpath --set-rpath '$ORIGIN/../lib' "$OUTDIR/usr/bin/$BINARY"
|
||||
|
||||
echo "Copying resources into AppDir..."
|
||||
cp -a "$BUILDDIR/bin/resources" "$OUTDIR/usr/bin"
|
||||
|
||||
|
||||
@@ -223,7 +223,7 @@ cp -a "$BUILDDIR/bin/duckstation-qt" "$BUILDDIR/bin/resources" "$BUILDDIR/bin/tr
|
||||
|
||||
# Patch RPATH so the binary goes hunting for shared libraries in the AppDir instead of system.
|
||||
echo "Patching RPATH in duckstation-qt..."
|
||||
patchelf --set-rpath '$ORIGIN/../lib' "$OUTDIR/usr/bin/duckstation-qt"
|
||||
patchelf --force-rpath --set-rpath '$ORIGIN/../lib' "$OUTDIR/usr/bin/duckstation-qt"
|
||||
|
||||
# Libraries we pull in from the system.
|
||||
echo "Copying system libraries..."
|
||||
|
||||
Reference in new issue
Block a user