From cad433832460aa3caa89117dc4a17bf4a9c66c79 Mon Sep 17 00:00:00 2001 From: Psychotoxical Date: Thu, 2 Apr 2026 12:41:34 +0200 Subject: [PATCH] fix(aur): unset CFLAGS/CXXFLAGS to fix ring LTO link failure on CachyOS CachyOS makepkg.conf sets -flto=auto in CFLAGS. ring's build.rs uses the cc crate to compile its C/asm objects, which picks up CFLAGS, producing fat-LTO objects. bfd cannot resolve ring_core_* symbols from fat-LTO objects when linking against non-LTO Rust rlibs. Also adds nasm to makedepends (required by ring 0.17.x for x86_64 asm). Co-Authored-By: Claude Sonnet 4.6 --- packages/aur/PKGBUILD | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/aur/PKGBUILD b/packages/aur/PKGBUILD index 2cd00c03..842dd3f5 100644 --- a/packages/aur/PKGBUILD +++ b/packages/aur/PKGBUILD @@ -17,6 +17,7 @@ makedepends=( 'rust' 'cargo' 'clang' + 'nasm' ) source=("$pkgname-$pkgver.tar.gz::https://github.com/Psychotoxical/psysonic/archive/refs/tags/v$pkgver.tar.gz") sha256sums=('SKIP') @@ -34,6 +35,13 @@ build() { # because the last -fuse-ld=* flag passed to cc wins. export RUSTFLAGS="${RUSTFLAGS} -C link-arg=-fuse-ld=bfd" + # CachyOS sets -flto=auto in CFLAGS. ring compiles its C/asm objects via the + # cc crate and picks up CFLAGS, producing fat-LTO objects. bfd cannot resolve + # symbols from fat-LTO objects when linking against non-LTO Rust rlibs, causing + # "undefined reference to ring_core_*" even though the symbols exist in the .a. + # Strip CFLAGS/CXXFLAGS entirely so ring builds plain ELF objects. + unset CFLAGS CXXFLAGS + npm install npm run tauri:build -- --no-bundle }