Files
DroidDeck/tools/vkbridge/build-client-linux.sh
T
ahmadandClaude Opus 5.5 4050270511 feat(vkbridge): Phase 1 integration - Setup toggle, server process, session wiring, builds
- Setup: 'Mali bridge' switch on the GPU row (non-Adreno only); the non-Adreno gate relaxes when on
- VkBridgeComponent starts libvkbridge_server.so before the guest and waits for its socket
- session script points the loader at the bridge ICD and logs the self-test + vulkaninfo
- Flatpak sandboxes get the bridge ICD and socket; the compositor uses the system driver without KGSL
- Gradle builds the server with the NDK; CI/build_local cross-build the ICD + smoke test

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01KZqR8XUE8czvGzEpgSCVQR
2026-10-10 14:28:13 +03:00

27 lines
1.6 KiB
Bash
Executable File

#!/bin/bash
# Builds the Linux side of the bridge for the runtime (glibc, aarch64):
# tools/vkbridge/build-client-linux.sh <linuxfs-asset-dir> [cc]
# Produces, under the asset dir (staged into the runtime by SessionFiles):
# usr/local/lib/vkbridge/libvulkan_droidbridge.so the Vulkan ICD
# usr/local/share/vkbridge/droidbridge_icd.json its manifest
# usr/local/bin/droiddeck-vkbridge-smoke the session-start self-test
set -euo pipefail
d=$1
cc=${2:-aarch64-linux-gnu-gcc}
strip=${STRIP:-${cc%gcc}strip}
here=$(cd "$(dirname "$0")" && pwd)
inc="-I$here/third_party/Vulkan-Headers-1.3.247/include -I$here/common -I$here/common/gen"
mkdir -p "$d/usr/local/lib/vkbridge" "$d/usr/local/share/vkbridge" "$d/usr/local/bin"
"$cc" -O2 -fPIC -shared -fvisibility=hidden -DVKB_CLIENT -Wall -Wno-unused-parameter -Wno-missing-field-initializers \
$inc -I"$here/client" -I"$here/client/compat" -pthread \
-Wl,--no-undefined -Wl,-soname,libvulkan_droidbridge.so \
-o "$d/usr/local/lib/vkbridge/libvulkan_droidbridge.so" \
"$here"/client/*.c "$here/common/vkb_wire.c" "$here/common/gen/vkb_gen_structs.c" "$here/common/gen/vkb_gen_client.c" -ldl
"$strip" --strip-unneeded "$d/usr/local/lib/vkbridge/libvulkan_droidbridge.so"
"$cc" -O2 -Wall $inc -I"$here/tests" -o "$d/usr/local/bin/droiddeck-vkbridge-smoke" "$here/tests/smoke.c" -ldl
"$strip" --strip-unneeded "$d/usr/local/bin/droiddeck-vkbridge-smoke"
cat > "$d/usr/local/share/vkbridge/droidbridge_icd.json" <<JSON
{"file_format_version": "1.0.0", "ICD": {"library_path": "/usr/local/lib/vkbridge/libvulkan_droidbridge.so", "api_version": "1.3.247"}}
JSON
echo "built the vkbridge client into $d"