From b6482761225cf383a6a6b0e9183b3caf5244b464 Mon Sep 17 00:00:00 2001 From: "Claude (noether)" Date: Fri, 15 May 2026 19:03:46 +0000 Subject: [PATCH] libva-v4l2-request-fourier: -Db_lto=false (closes #17) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI binary segfaulted on HEVC vaEndPicture even though /etc/makepkg.conf has OPTIONS=(... !lto ...). Root cause: arch-meson's wrapper hard-codes `-D b_lto=true` regardless of makepkg.conf, so the binary still gets cross-function ICF (Identical Code Folding) under -O2 + LTO. HEVC is the only codec in the campaign that submits a per-frame chain of 4 control structs (SPS + PPS + DECODE_PARAMS + SLICE_PARAMS); ICF finds a near-duplicate per-codec helper across the codec dispatch and merges them, then the wrong instance's local stack layout is invoked on the HEVC path → SEGV. The other 4 codecs (H.264, VP8, VP9, MPEG-2) submit fewer/simpler control structs and tolerate the folding by accident. Empirical confirmation from the issue body's binary bisection: meson build (default debugoptimized) 485 KB HEVC ✓ arch-meson + --buildtype=release 145 KB HEVC ✓ arch-meson + release + -flto 76 KB HEVC SEGV CI build (this package, 7ac934e-1) 133 KB HEVC SEGV Fix: append `-Db_lto=false` to the arch-meson invocation. pkgrel 1 -> 2. --- arch/libva-v4l2-request-fourier/PKGBUILD | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/arch/libva-v4l2-request-fourier/PKGBUILD b/arch/libva-v4l2-request-fourier/PKGBUILD index 68ee37139..32bdcc016 100644 --- a/arch/libva-v4l2-request-fourier/PKGBUILD +++ b/arch/libva-v4l2-request-fourier/PKGBUILD @@ -36,7 +36,7 @@ _commit=7ac934e0c5420814c7a5fc3e2a2f08251d590d9e # build time by pkgver() below; the static value here is a placeholder # so AUR-style consumers see something coherent before src/ exists. pkgver=1.0.0.r348.7ac934e -pkgrel=1 +pkgrel=2 pkgdesc="VA-API backend for V4L2 stateless decoders (multiplanar fork — fourier umbrella)" arch=('aarch64') url="https://git.reauktion.de/marfrit/libva-v4l2-request-fourier" @@ -61,7 +61,15 @@ build() { cd "${srcdir}/${_upstreampkg}-fourier" # meson_options.txt only exposes 'kernel_headers' — leave it empty to # use system /usr/include kernel UAPI headers. No per-codec toggles. - arch-meson build --buildtype=release + # + # b_lto=false: override arch-meson's wrapper default of `-D b_lto=true`, + # which the makepkg.conf OPTIONS=(..., !lto, ...) line does NOT actually + # override (arch-meson hard-codes b_lto=true). The hand-built reproducer + # from issue #17 shows: LTO/ICF kernel-folds per-codec helpers and HEVC's + # multi-control-struct chain (SPS+PPS+DECODE_PARAMS+SLICE_PARAMS) gets a + # wrong helper-instance pulled in at vaEndPicture → segfault. The 4 other + # codecs (single-control-struct) tolerate the folding by accident. + arch-meson build --buildtype=release -Db_lto=false meson compile -C build }