From d5b766d26c9b16b4260c88295c50de244a0165ca Mon Sep 17 00:00:00 2001 From: The412Banner Date: Fri, 2 Oct 2026 19:33:54 -0400 Subject: [PATCH] x86-64 client: no 32-bit controller reader in games, for real; game-gpu.local The preload line used $LIB, so 32-bit programs still got libfakeinput: FEX falls through to the session's own i386 copy when the rootfs has none. Its fake devices reach the game's SDL2 through udev with a missing attribute and SDL strdup()s the NULL - the Left 4 Dead 2 crash right after GL start-up, in software and on the GPU alike (found with the segvlog diagnostic). The line now names the x86_64 copy. DroidDeck direct also reads game-gpu.local after the generated game-gpu.env. --- .../overlay/usr/local/bin/bannerlator-steam-x64 | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 b/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 index f8d7bd563..25d66666c 100755 --- a/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 +++ b/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 @@ -72,8 +72,11 @@ fi : > "$ROOTFS/etc/ld.so.preload" for lib in libblsession libfakeinput; do have=0 - # The 32-bit controller reader crashes Left 4 Dead 2 (segfault right after its GL start-up): until - # it is fixed, 32-bit programs get only the session shim. + # The 32-bit controller reader crashes Left 4 Dead 2: its fake devices reach the game's own SDL2 + # through udev with a missing attribute, and SDL strdup()s the NULL (device, segvlog: strlen in + # libc <- __strdup <- libSDL2 <- udev_device_get_sysattr_value). Until it is fixed, 32-bit + # programs get only the session shim; its preload line names the x86_64 copy outright, since + # with $LIB FEX falls through to the session's own /usr/local/lib/i386-linux-gnu copy. arches="x86_64 i386"; [ "$lib" = libfakeinput ] && arches=x86_64 rm -f "$ROOTFS/usr/local/lib/i386-linux-gnu/libfakeinput.so" for arch in $arches; do @@ -82,7 +85,9 @@ for lib in libblsession libfakeinput; do cp -f "/usr/local/lib/$arch-linux-gnu/$lib.so" "$ROOTFS/usr/local/lib/$arch-linux-gnu/$lib.so" have=1 done - if [ "$have" = 1 ]; then echo "/usr/local/\$LIB/$lib.so" >> "$ROOTFS/etc/ld.so.preload" + if [ "$have" = 1 ] && [ "$lib" = libfakeinput ]; then + echo "/usr/local/lib/x86_64-linux-gnu/$lib.so" >> "$ROOTFS/etc/ld.so.preload" + elif [ "$have" = 1 ]; then echo "/usr/local/\$LIB/$lib.so" >> "$ROOTFS/etc/ld.so.preload" else step "warning: no x86 build of $lib (/usr/local/lib/x86_64-linux-gnu/$lib.so)"; fi done rm -f "$ROOTFS/usr/local/lib/libblsession-x86_64.so" "$ROOTFS/usr/local/lib/libfakeinput-x86_64.so" @@ -228,10 +233,12 @@ rt=$HOME/.local/share/Steam/ubuntu12_32/steam-runtime.old # server they joined and whether it is secure. case "$*" in *hl2.sh*|*hl2_linux*|*srcds*) set -- "$@" -condebug ;; esac # The GPU: FEX's host thunks and the session's GPU settings, saved by the launcher (the client -# itself draws in software). BL_X64_GAME_SOFTWARE=1 keeps the game in software too. +# itself draws in software). BL_X64_GAME_SOFTWARE=1 keeps the game in software too. game-gpu.env is +# rewritten whenever the launcher runs; game-gpu.local (yours, never rewritten) is read after it. gpu=$HOME/game-gpu.env if [ -f "$gpu" ] && [ "${BL_X64_GAME_SOFTWARE:-0}" != 1 ]; then . "$gpu" + [ -f "$HOME/game-gpu.local" ] && . "$HOME/game-gpu.local" else # GL threading is a GPU-path tuning from the session; with software GL under FEX it is no help. export mesa_glthread=false