From 9574cf4b979c107500ded355b1ced2ba74459aa6 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Sat, 20 Dec 2025 17:59:03 +0100 Subject: [PATCH] first flatpak multilib prototype --- CMakeLists.txt | 1 + flatpak/ct-ng-x86_64.config | 49 ++++---- flatpak/io.github.wivrn.wivrn.yml.in | 167 +++++++++++++-------------- server/active_runtime.cpp | 5 +- 4 files changed, 111 insertions(+), 111 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 12546101..88253f3c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -320,6 +320,7 @@ foreach(TARGET_NAME wivrn wivrn-server wivrn-dashboard wivrn-common wivrn-dissec -fdiagnostics-color -Wall -Wextra -pedantic -Wundef -Wno-missing-field-initializers + -Wno-maybe-uninitialized -Wno-unused-parameter -Wno-comment -Wno-unused-variable diff --git a/flatpak/ct-ng-x86_64.config b/flatpak/ct-ng-x86_64.config index 83f9bf5f..154eeb4f 100644 --- a/flatpak/ct-ng-x86_64.config +++ b/flatpak/ct-ng-x86_64.config @@ -374,9 +374,9 @@ CT_BINUTILS_PATCH_GLOBAL=y # CT_BINUTILS_PATCH_LOCAL_BUNDLED is not set # CT_BINUTILS_PATCH_NONE is not set CT_BINUTILS_PATCH_ORDER="global" -# CT_BINUTILS_V_2_45 is not set +CT_BINUTILS_V_2_45=y # CT_BINUTILS_V_2_44 is not set -CT_BINUTILS_V_2_43=y +# CT_BINUTILS_V_2_43 is not set # CT_BINUTILS_V_2_42 is not set # CT_BINUTILS_V_2_41 is not set # CT_BINUTILS_V_2_40 is not set @@ -394,16 +394,16 @@ CT_BINUTILS_V_2_43=y # CT_BINUTILS_V_2_28 is not set # CT_BINUTILS_V_2_27 is not set # CT_BINUTILS_V_2_26 is not set -CT_BINUTILS_VERSION="2.43.1" +CT_BINUTILS_VERSION="2.45" CT_BINUTILS_MIRRORS="$(CT_Mirrors GNU binutils) $(CT_Mirrors sourceware binutils/releases)" CT_BINUTILS_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_BINUTILS_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" CT_BINUTILS_ARCHIVE_FORMATS=".tar.xz .tar.bz2 .tar.gz" CT_BINUTILS_SIGNATURE_FORMAT="packed/.sig" +CT_BINUTILS_2_45_or_later=y CT_BINUTILS_2_45_or_older=y -CT_BINUTILS_older_than_2_45=y -CT_BINUTILS_2_44_or_older=y -CT_BINUTILS_older_than_2_44=y +CT_BINUTILS_later_than_2_44=y +CT_BINUTILS_2_44_or_later=y CT_BINUTILS_later_than_2_41=y CT_BINUTILS_2_41_or_later=y CT_BINUTILS_later_than_2_39=y @@ -419,11 +419,8 @@ CT_BINUTILS_2_26_or_later=y # GNU binutils # CT_BINUTILS_GOLD_SUPPORTS_ARCH=y -CT_BINUTILS_HAS_GOLD=y -CT_BINUTILS_GOLD_SUPPORT=y CT_BINUTILS_FORCE_LD_BFD_DEFAULT=y CT_BINUTILS_LINKER_LD=y -# CT_BINUTILS_LINKER_LD_GOLD is not set CT_BINUTILS_LINKERS_LIST="ld" CT_BINUTILS_LINKER_DEFAULT="bfd" CT_BINUTILS_PLUGINS=y @@ -467,11 +464,11 @@ CT_GLIBC_PATCH_ORDER="global" # CT_GLIBC_V_2_42 is not set # CT_GLIBC_V_2_41 is not set # CT_GLIBC_V_2_40 is not set -# CT_GLIBC_V_2_39 is not set +CT_GLIBC_V_2_39=y # CT_GLIBC_V_2_38 is not set # CT_GLIBC_V_2_37 is not set # CT_GLIBC_V_2_36 is not set -CT_GLIBC_V_2_35=y +# CT_GLIBC_V_2_35 is not set # CT_GLIBC_V_2_34 is not set # CT_GLIBC_V_2_33 is not set # CT_GLIBC_V_2_32 is not set @@ -486,7 +483,7 @@ CT_GLIBC_V_2_35=y # CT_GLIBC_V_2_23 is not set # CT_GLIBC_V_2_19 is not set # CT_GLIBC_V_2_17 is not set -CT_GLIBC_VERSION="2.35" +CT_GLIBC_VERSION="2.39" CT_GLIBC_MIRRORS="$(CT_Mirrors GNU glibc)" CT_GLIBC_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_GLIBC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" @@ -496,12 +493,12 @@ CT_GLIBC_2_42_or_older=y CT_GLIBC_older_than_2_42=y CT_GLIBC_2_41_or_older=y CT_GLIBC_older_than_2_41=y -CT_GLIBC_2_38_or_older=y -CT_GLIBC_older_than_2_38=y -CT_GLIBC_2_37_or_older=y -CT_GLIBC_older_than_2_37=y -CT_GLIBC_2_36_or_older=y -CT_GLIBC_older_than_2_36=y +CT_GLIBC_later_than_2_38=y +CT_GLIBC_2_38_or_later=y +CT_GLIBC_later_than_2_37=y +CT_GLIBC_2_37_or_later=y +CT_GLIBC_later_than_2_36=y +CT_GLIBC_2_36_or_later=y CT_GLIBC_later_than_2_34=y CT_GLIBC_2_34_or_later=y CT_GLIBC_later_than_2_32=y @@ -539,10 +536,12 @@ CT_GLIBC_BUILD_SSP=y CT_GLIBC_HAS_LIBIDN_ADDON=y # CT_GLIBC_USE_LIBIDN_ADDON is not set CT_GLIBC_NO_SPARC_V8=y +CT_GLIBC_HAS_OBSOLETE_LIBCRYPT=y CT_GLIBC_EXTRA_CONFIG_ARRAY="" CT_GLIBC_CONFIGPARMS="" # CT_GLIBC_ENABLE_DEBUG is not set CT_GLIBC_EXTRA_CFLAGS="" +# CT_GLIBC_ENABLE_OBSOLETE_LIBCRYPT is not set # CT_GLIBC_ENABLE_FORTIFIED_BUILD is not set # CT_GLIBC_DISABLE_VERSIONING is not set CT_GLIBC_OLDEST_ABI="" @@ -610,15 +609,15 @@ CT_GCC_PATCH_GLOBAL=y CT_GCC_PATCH_ORDER="global" # CT_GCC_V_15 is not set # CT_GCC_V_14 is not set -# CT_GCC_V_13 is not set +CT_GCC_V_13=y # CT_GCC_V_12 is not set -CT_GCC_V_11=y +# CT_GCC_V_11 is not set # CT_GCC_V_10 is not set # CT_GCC_V_9 is not set # CT_GCC_V_8 is not set # CT_GCC_V_7 is not set # CT_GCC_V_6 is not set -CT_GCC_VERSION="11.5.0" +CT_GCC_VERSION="13.4.0" CT_GCC_MIRRORS="$(CT_Mirrors GNU gcc/gcc-${CT_GCC_VERSION}) $(CT_Mirrors sourceware gcc/releases/gcc-${CT_GCC_VERSION})" CT_GCC_ARCHIVE_FILENAME="@{pkg_name}-@{version}" CT_GCC_ARCHIVE_DIRNAME="@{pkg_name}-@{version}" @@ -628,10 +627,10 @@ CT_GCC_15_or_older=y CT_GCC_older_than_15=y CT_GCC_14_or_older=y CT_GCC_older_than_14=y -CT_GCC_13_or_older=y -CT_GCC_older_than_13=y -CT_GCC_12_or_older=y -CT_GCC_older_than_12=y +CT_GCC_later_than_13=y +CT_GCC_13_or_later=y +CT_GCC_later_than_12=y +CT_GCC_12_or_later=y CT_GCC_later_than_11=y CT_GCC_11_or_later=y CT_GCC_later_than_10=y diff --git a/flatpak/io.github.wivrn.wivrn.yml.in b/flatpak/io.github.wivrn.wivrn.yml.in index 6ea17811..73e50fd0 100644 --- a/flatpak/io.github.wivrn.wivrn.yml.in +++ b/flatpak/io.github.wivrn.wivrn.yml.in @@ -1,16 +1,12 @@ # kate: syntax yaml id: io.github.wivrn.wivrn runtime: org.kde.Platform -runtime-version: '6.9' +runtime-version: '6.10' sdk: org.kde.Sdk sdk-extensions: - org.freedesktop.Sdk.Extension.rust-stable - - org.freedesktop.Sdk.Extension.llvm18 -add-build-extensions: - org.freedesktop.Sdk.Compat.i386: - directory: lib/i386-linux-gnu - version: '24.08' - remove-after-build: true + - org.freedesktop.Sdk.Extension.llvm20 + - org.freedesktop.Sdk.Compat.i386 command: wivrn-dashboard separate-locales: false @@ -73,7 +69,7 @@ modules: sources: - type: git url: https://github.com/crosstool-ng/crosstool-ng.git - tag: 1e9bf8151513b054f60f34bc89507c31dc242cf0 + tag: a3fef85781d3cda0b27388916f3287826aeec177 - type: shell commands: - sed -i 's/-O2 -g/-O2/' scripts/crosstool-NG.sh @@ -126,14 +122,14 @@ modules: url: https://ftpmirror.gnu.org/gnu/gettext/gettext-0.23.1.tar.xz sha256: c1f97a72a7385b7e71dd07b5fea6cdaf12c9b88b564976b23bd8c11857af2970 - type: file - url: https://ftpmirror.gnu.org/gnu/binutils/binutils-2.43.1.tar.xz - sha256: 13f74202a3c4c51118b797a39ea4200d3f6cfbe224da6d1d95bb938480132dfd + url: https://ftpmirror.gnu.org/gnu/binutils/binutils-2.45.tar.xz + sha256: c50c0e7f9cb188980e2cc97e4537626b1672441815587f1eab69d2a1bfbef5d2 - type: file - url: https://ftpmirror.gnu.org/gnu/gcc/gcc-11.5.0/gcc-11.5.0.tar.xz - sha256: a6e21868ead545cf87f0c01f84276e4b5281d672098591c1c896241f09363478 + url: https://ftpmirror.gnu.org/gnu/gcc/gcc-13.4.0/gcc-13.4.0.tar.xz + sha256: 9c4ce6dbb040568fdc545588ac03c5cbc95a8dbf0c7aa490170843afb59ca8f5 - type: file - url: https://ftpmirror.gnu.org/gnu/glibc/glibc-2.35.tar.xz - sha256: 5123732f6b67ccd319305efd399971d58592122bcc2a6518a1bd2510dd0cf52e + url: https://ftpmirror.gnu.org/gnu/glibc/glibc-2.39.tar.xz + sha256: f77bd47cf8170c57365ae7bf86696c118adb3b120d3259c64c502d3dc1e2d926 - type: file path: ct-ng-x86_64.config dest-filename: .config @@ -274,7 +270,7 @@ modules: sources: - type: git url: https://github.com/qcoro/qcoro.git - tag: v0.11.0 + tag: v0.12.0 - name: opencomposite buildsystem: cmake-ninja @@ -283,12 +279,12 @@ modules: cxxflags: -idirafter/usr/include arch: aarch64: - ldflags: -L/usr/lib/aarch64-linux-gnu -Wl,--warn-unresolved-symbols + ldflags: -L/usr/lib/aarch64-linux-gnu env: CC: /app/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-gcc CXX: /app/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-g++ x86_64: - ldflags: -L/usr/lib/x86_64-linux-gnu -Wl,--warn-unresolved-symbols + ldflags: -L/usr/lib/x86_64-linux-gnu env: CC: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc CXX: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-g++ @@ -304,18 +300,19 @@ modules: only-arches: x86_64 buildsystem: cmake-ninja build-options: - prepend-pkg-config-path: /app/lib/i386-linux-gnu/pkgconfig + prepend-pkg-config-path: /usr/lib/i386-linux-gnu/pkgconfig cflags: -m32 -idirafter/usr/include cxxflags: -m32 -idirafter/usr/include - ldflags: -L/app/lib/i386-linux-gnu + ldflags: -L/usr/lib/i386-linux-gnu env: CC: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc CXX: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-g++ config-opts: - -DUSE_SYSTEM_OPENXR=OFF - -DUSE_SYSTEM_GLM=OFF + - -DCMAKE_ASM_FLAGS=-m32 - -DCMAKE_LIBRARY_ARCHITECTURE=i386-linux-gnu - - -DCMAKE_SYSTEM_LIBRARY_PATH=/app/lib/i386-linux-gnu + - -DCMAKE_SYSTEM_LIBRARY_PATH=/usr/lib/i386-linux-gnu sources: - type: git url: https://gitlab.com/znixian/OpenOVR.git @@ -324,7 +321,7 @@ modules: - name: xrizer buildsystem: simple build-options: - append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm18/bin + append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm20/bin cflags: -idirafter/usr/include cxxflags: -idirafter/usr/include env: @@ -353,74 +350,33 @@ modules: tag: 76e01ac8ad79fed226a883985daa3cbe61271ca7 - xrizer-gen-src.json - - name: xrizer32 - only-arches: x86_64 - buildsystem: simple - build-options: - append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm18/bin - cflags: -idirafter/usr/include - cxxflags: -idirafter/usr/include - ldflags: -L/app/lib/i386-linux-gnu -Wl,--warn-unresolved-symbols - env: - CARGO_HOME: /run/build/xrizer/cargo - CC: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc - CXX: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-g++ - RUSTFLAGS: -C linker=/app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc - build-commands: - - cargo --offline fetch --manifest-path Cargo.toml --verbose - - cargo xbuild --release --target=i686-unknown-linux-gnu - - mkdir /app/xrizer - - cp -rL target/i686-unknown-linux-gnu/release/bin/ /app/xrizer/ - sources: - - type: git - url: https://github.com/Supreeeme/xrizer.git - tag: 76e01ac8ad79fed226a883985daa3cbe61271ca7 - - xrizer-gen-src.json - - - name: wivrn-library32 - buildsystem: cmake-ninja - only-arches: x86_64 - build-options: - prepend-pkg-config-path: /app/lib/i386-linux-gnu/pkgconfig - # org.kde.Platform//6.8 sets _FORTIFY_SOURCE=3 but gcc 11 only supports _FORTIFY_SOURCE=2 - ldflags: -L/app/lib/386-linux-gnu -Wl,--warn-unresolved-symbols - cflags: -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=2 -m32 -idirafter/usr/include -idirafter/usr/lib/x86_64-linux-gnu/include/ - cxxflags: -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=2 -m32 -idirafter/usr/include -idirafter/usr/lib/x86_64-linux-gnu/include/ - env: - CC: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc - CXX: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-g++ - config-opts: - - -DCMAKE_BUILD_TYPE=RelWithDebInfo - - -DWIVRN_BUILD_CLIENT=OFF - - -DWIVRN_BUILD_SERVER=OFF - - -DWIVRN_BUILD_SERVER_LIBRARY=ON - - -DWIVRN_BUILD_DASHBOARD=OFF - - -DWIVRN_BUILD_WIVRNCTL=OFF - - -DWIVRN_WERROR=ON - - -DWIVRN_OPENXR_MANIFEST_ABI=i686 - - -DFETCHCONTENT_FULLY_DISCONNECTED=ON - - -DFETCHCONTENT_BASE_DIR=deps - - -DGIT_DESC=WIVRN_GIT_DESC - - -DGIT_COMMIT=WIVRN_GIT_COMMIT - - -Wno-dev - sources: - - WIVRN_SRC1 - WIVRN_SRC2 - WIVRN_SRC3 - - type: git - url: https://gitlab.freedesktop.org/monado/monado - tag: MONADO_COMMIT - dest: deps/monado-src - - type: shell - commands: - - cd deps/monado-src && ../../patches/apply.sh ../../patches/monado/* +# - name: xrizer32 +# only-arches: x86_64 +# buildsystem: simple +# build-options: +# append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm20/bin +# cflags: -idirafter/usr/include +# cxxflags: -idirafter/usr/include +# ldflags: -L/app/lib/i386-linux-gnu -Wl,--warn-unresolved-symbols +# env: +# CARGO_HOME: /run/build/xrizer32/cargo +# CC: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc +# CXX: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-g++ +# RUSTFLAGS: -C linker=/app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc +# build-commands: +# - cargo --offline fetch --manifest-path Cargo.toml --verbose --target=i686-unknown-linux-gnu +# - cargo xbuild --release --target=i686-unknown-linux-gnu +# - mkdir /app/xrizer +# - cp -rL target/i686-unknown-linux-gnu/release/bin/ /app/xrizer/ +# sources: +# - type: git +# url: https://github.com/Supreeeme/xrizer.git +# tag: 76e01ac8ad79fed226a883985daa3cbe61271ca7 +# - xrizer-gen-src.json - name: wivrn-library buildsystem: cmake-ninja build-options: - # org.kde.Platform//6.8 sets _FORTIFY_SOURCE=3 but gcc 11 only supports _FORTIFY_SOURCE=2 - cflags: -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=2 - cxxflags: -Wp,-U_FORTIFY_SOURCE -Wp,-D_FORTIFY_SOURCE=2 arch: aarch64: ldflags: -L/usr/lib/aarch64-linux-gnu -Wl,--warn-unresolved-symbols @@ -461,6 +417,47 @@ modules: commands: - cd deps/monado-src && ../../patches/apply.sh ../../patches/monado/* + - name: wivrn-library32 + buildsystem: cmake-ninja + only-arches: x86_64 + build-options: + prepend-pkg-config-path: /usr/lib/i386-linux-gnu/pkgconfig + ldflags: -L/usr/lib/i386-linux-gnu + cflags: -m32 -idirafter/usr/include -idirafter/usr/lib/x86_64-linux-gnu/include/ + cxxflags: -m32 -idirafter/usr/include -idirafter/usr/lib/x86_64-linux-gnu/include/ + env: + CC: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc + CXX: /app/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-g++ + config-opts: + - -DCMAKE_BUILD_TYPE=RelWithDebInfo + - -DWIVRN_BUILD_CLIENT=OFF + - -DWIVRN_BUILD_SERVER=OFF + - -DWIVRN_BUILD_SERVER_LIBRARY=ON + - -DWIVRN_BUILD_DASHBOARD=OFF + - -DWIVRN_BUILD_WIVRNCTL=OFF + - -DWIVRN_WERROR=ON + - -DFETCHCONTENT_FULLY_DISCONNECTED=ON + - -DFETCHCONTENT_BASE_DIR=deps + - -DGIT_DESC=WIVRN_GIT_DESC + - -DGIT_COMMIT=WIVRN_GIT_COMMIT + - -Wno-dev + - -DWIVRN_OPENXR_MANIFEST_ABI=i686 + - -DCMAKE_LIBRARY_ARCHITECTURE=i386-linux-gnu + - -DCMAKE_SYSTEM_LIBRARY_PATH=/usr/lib/i386-linux-gnu + - -DCMAKE_INSTALL_LIBDIR=lib32 + sources: + - WIVRN_SRC1 + WIVRN_SRC2 + WIVRN_SRC3 + - type: git + url: https://gitlab.freedesktop.org/monado/monado + tag: MONADO_COMMIT + dest: deps/monado-src + - type: shell + commands: + - cd deps/monado-src && ../../patches/apply.sh ../../patches/monado/* + - sed -i '/eglDestroyContext(dpy, ctx);/d' deps/monado-src/cmake/FindEGL.cmake + - name: wivrn buildsystem: cmake-ninja config-opts: diff --git a/server/active_runtime.cpp b/server/active_runtime.cpp index fc5114e8..a191c57a 100644 --- a/server/active_runtime.cpp +++ b/server/active_runtime.cpp @@ -49,7 +49,10 @@ std::vector active_runtime::manifest_path() const std::filesystem::path prefix = "openxr_wivrn"; // Check if in a flatpak if (auto path = flatpak_key(flatpak::section::instance, "app-path")) - return {*path / location / "openxr_wivrn.json"}; + return { + *path / location / "openxr_wivrn.i686.json", + *path / location / "openxr_wivrn.json", + }; // Check if running from build directory auto exe = std::filesystem::read_symlink("/proc/self/exe");