muck-dotnet.sh: GUEST_LIBS=DIR runs the relaunched game on another glibc (its ld.so as interpreter, DIR in DT_RPATH)

For reproducing on gooner what only happens on worldmachine's Arch glibc 2.44.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_b6478c5570464e3aa53c29026c16b36e
This commit is contained in:
velzieandClaude Opus 5.5 committed 2026-10-05 19:48:16 -04:00
1 parent c784b5c65d
commit 8c98f89ba4
1 file changed
+7 -2
+7 -2
View File
@@ -10,7 +10,10 @@
# default ~/gex-sandbox/games-linux/Muck), GEXC, CORES (optional taskset
# list), EXE (another Unity game's executable in MUCK, e.g. hollow_knight.x86_64),
# UNITY_RELAUNCH=1 (run a PIE rebuild of that executable: unity-launcher.c; with it,
# STEAM_APPID=N writes steam_appid.txt beside it), DOTNET_FW (the .NET 10 shared framework directory).
# STEAM_APPID=N writes steam_appid.txt beside it), DOTNET_FW (the .NET 10 shared framework directory),
# GUEST_LIBS=DIR (with UNITY_RELAUNCH: the launcher's interpreter is DIR's ld-linux-x86-64.so.2 and DIR
# comes first in its inherited DT_RPATH: another distribution's glibc, e.g. worldmachine's, to
# reproduce what only happens there).
#
# Default: batch mode, no graphics. GFX=GLDIR: with graphics, GL through
# gex-gl (GLDIR holds guest/gl/build.sh's x86-64 build) and X from an
@@ -34,7 +37,9 @@ if [ -n "${UNITY_RELAUNCH:-}" ]; then
# The game's executable rebuilt PIE (unity-launcher.c) among links to its files.
G="$RUN/game"; mkdir -p "$G"
for f in "$MUCK"/*; do [ "$(basename "$f")" = "$EXE" ] || ln -sfn "$f" "$G/"; done
cc -O1 -fPIE -pie -o "$G/$EXE" "$HERE/unity-launcher.c" -L"$MUCK" -l:UnityPlayer.so -Wl,-rpath,'$ORIGIN'
LIBS=; [ -n "${GUEST_LIBS:-}" ] && LIBS=$(realpath "$GUEST_LIBS") && \
LIBS="-Wl,--allow-shlib-undefined -Wl,--disable-new-dtags -Wl,--dynamic-linker=$LIBS/ld-linux-x86-64.so.2 -Wl,-rpath,$LIBS"
cc -O1 -fPIE -pie -o "$G/$EXE" "$HERE/unity-launcher.c" -L"$MUCK" -l:UnityPlayer.so -Wl,-rpath,'$ORIGIN' $LIBS
# STEAM_APPID: Steamworks' development file, so a game started outside Steam runs instead of
# asking Steam to restart it.
[ -n "${STEAM_APPID:-}" ] && echo "$STEAM_APPID" > "$G/steam_appid.txt"