From e5145bfad53013731651820a052e26c58b878faf Mon Sep 17 00:00:00 2001 From: The412Banner Date: Fri, 2 Oct 2026 15:16:24 -0400 Subject: [PATCH] x86-64 client: System V IPC shim for x86 programs, and staging The x86 client stops at start on a tier0 assertion: semget answers ENOSYS, as Android kernels have no System V IPC (traced with a DEBUG_STRACE FEX). The session shim that gives the arm64 client its semaphores is now also built as native x86-64 and preloaded through the FEX rootfs's own ld.so.preload. SessionFiles stages it and bannerlator-steam-x64 into installed runtimes. --- .github/workflows/build.yml | 8 +++++++- .../com/droiddeck/launcher/session/SessionFiles.kt | 3 +++ .../overlay/usr/local/bin/bannerlator-steam-x64 | 12 +++++++++--- 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9645c6b11..a0c644f1b4 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,7 +28,7 @@ concurrency: cancel-in-progress: ${{ github.event_name == 'pull_request' }} env: - PRELOAD_CACHE_VERSION: v2 + PRELOAD_CACHE_VERSION: v3 jobs: build: @@ -176,6 +176,12 @@ jobs: aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \ -o "$D/libblsession.so" tools/linuxfs/preload/*.c -ldl aarch64-linux-gnu-strip --strip-unneeded "$D/libblsession.so" + # The same session shim for x86-64 programs under FEX (bannerlator-steam-x64): the x86 + # Steam client needs its System V semaphores just as the arm64 one does. Native gcc on + # this runner; Ubuntu 24.04's glibc is the one in FEX's Ubuntu 24.04 rootfs. + gcc -shared -fPIC -O2 -Wall -pthread \ + -o "$D/libblsession-x86_64.so" tools/linuxfs/preload/*.c -ldl + strip --strip-unneeded "$D/libblsession-x86_64.so" aarch64-linux-gnu-gcc -shared -fPIC -O2 -Wall -pthread \ -o "$D/libblfastpath.so" tools/proot/fastpath/fastpath.c -ldl aarch64-linux-gnu-strip --strip-unneeded "$D/libblfastpath.so" diff --git a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt index a98a054602..1309ce0d70 100644 --- a/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt +++ b/app/src/main/java/com/droiddeck/launcher/session/SessionFiles.kt @@ -29,6 +29,7 @@ object SessionFiles { val files = arrayOf( "usr/local/bin/bannerlator-game-env" to "usr/local/bin/bannerlator-game-env", "libblsession.so" to "usr/local/lib/libblsession.so", + "libblsession-x86_64.so" to "usr/local/lib/x86_64-linux-gnu/libblsession.so", "libfakeinput.so" to "usr/local/lib/libfakeinput.so", "libblfastpath.so" to "usr/local/lib/libblfastpath.so", "usr/local/bin/bannerlator-session" to "usr/local/bin/bannerlator-session", @@ -39,6 +40,8 @@ object SessionFiles { "usr/local/bin/bannerlator-proton-extra" to "usr/local/bin/bannerlator-proton-extra", "usr/local/bin/bannerlator-netmanager" to "usr/local/bin/bannerlator-netmanager", "usr/local/bin/bannerlator-steam-launch" to "usr/local/bin/bannerlator-steam-launch", + // Experimental: Valve's x86-64 client under FEX (desktop menu entry). + "usr/local/bin/bannerlator-steam-x64" to "usr/local/bin/bannerlator-steam-x64", "usr/local/bin/bannerlator-desktop-games" to "usr/local/bin/bannerlator-desktop-games", "usr/local/bin/bannerlator-steam-shim" to "usr/local/bin/bannerlator-steam-shim", "usr/local/bin/bannerlator-steam-shortcuts" to "usr/local/bin/bannerlator-steam-shortcuts", diff --git a/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 b/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 index 8b493984ba..7b517008e5 100755 --- a/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 +++ b/tools/linuxfs/overlay/usr/local/bin/bannerlator-steam-x64 @@ -59,9 +59,15 @@ if [ ! -f "$ROOTFS/.droiddeck-complete" ]; then rm -f "$X64_HOME/rootfs.sqsh" touch "$ROOTFS/.droiddeck-complete" fi -# A path missing from the rootfs falls through to the guest: without its own, the x86 loader -# reads the guest's /etc/ld.so.preload and tries to load the session's arm64 preloads. -if [ ! -e "$ROOTFS/etc/ld.so.preload" ]; then +# The rootfs's own ld.so.preload: a path missing from the rootfs falls through to the guest, whose +# list names the session's arm64 preloads. In it, the session shim built for x86-64 (System V IPC, +# which Android kernels lack: the client's tier0 gives up on start without its semaphore). +if [ -f /usr/local/lib/x86_64-linux-gnu/libblsession.so ]; then + mkdir -p "$ROOTFS/usr/local/lib" + cp -f /usr/local/lib/x86_64-linux-gnu/libblsession.so "$ROOTFS/usr/local/lib/libblsession-x86_64.so" + echo /usr/local/lib/libblsession-x86_64.so > "$ROOTFS/etc/ld.so.preload" +else + step "warning: no x86-64 session shim (/usr/local/lib/x86_64-linux-gnu/libblsession.so); the client will stop on semget" : > "$ROOTFS/etc/ld.so.preload" fi