From 74c75d83ca1e7fccd49959c7b881a62301b40c95 Mon Sep 17 00:00:00 2001 From: Psychotoxical Date: Thu, 2 Apr 2026 11:44:00 +0200 Subject: [PATCH] =?UTF-8?q?fix(aur):=20override=20RUSTFLAGS=20to=20swap=20?= =?UTF-8?q?lld=E2=86=92bfd=20for=20ring=20linker=20error?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit makepkg.conf on Arch injects -fuse-ld=lld into RUSTFLAGS which overrides .cargo/config.toml target rustflags. PKGBUILD now explicitly patches RUSTFLAGS at env level so bfd is used regardless of system config. Co-Authored-By: Claude Sonnet 4.6 --- .cargo/config.toml | 4 ++++ packages/aur/PKGBUILD | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/.cargo/config.toml b/.cargo/config.toml index 66222af5..d5a01393 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -3,6 +3,10 @@ # resolve (ring_core_* symbols). Fix: force cc as linker driver and append # -fuse-ld=bfd so it overrides the hardcoded -fuse-ld=lld (last flag wins). # bfd is always available via binutils (part of base-devel on Arch). +# +# NOTE: When building via makepkg (AUR), RUSTFLAGS from /etc/makepkg.conf +# overrides target-specific rustflags here. The PKGBUILD's build() applies +# the same fix by patching the RUSTFLAGS env var directly. [target.x86_64-unknown-linux-gnu] linker = "cc" rustflags = ["-C", "link-arg=-fuse-ld=bfd"] diff --git a/packages/aur/PKGBUILD b/packages/aur/PKGBUILD index 89b67b6b..24c13eb5 100644 --- a/packages/aur/PKGBUILD +++ b/packages/aur/PKGBUILD @@ -27,6 +27,12 @@ build() { export CARGO_HOME="$srcdir/cargo-home" export npm_config_cache="$srcdir/npm-cache" + # ring (used by tauri-plugin-updater → rustls) ships C/asm objects whose + # symbols (ring_core_*) lld cannot resolve. Arch's makepkg.conf bakes + # -fuse-ld=lld into RUSTFLAGS which overrides .cargo/config.toml. + # Swap lld → bfd (binutils, part of base-devel) so the link succeeds. + export RUSTFLAGS="${RUSTFLAGS//-fuse-ld=lld/-fuse-ld=bfd}" + npm install npm run tauri:build -- --no-bundle }