build: disable makepkg's C-flag LTO in all PKGBUILDs
CI / test (push) Successful in 48s

makepkg's default `lto` option appends `-flto=auto` to CFLAGS, CXXFLAGS and
LDFLAGS. ring and secp256k1-sys compile their C through the `cc` crate, which
honours CFLAGS, so their objects became GCC slim-LTO bytecode. rustc's final
link never passes `-flto`, so GCC's LTO plugin did not run and lld reported
every C symbol as undefined:

  undefined symbol: rustsecp256k1_v0_10_0_ec_seckey_verify
  undefined symbol: ring_core_0_17_14__LIMB_is_zero
  ...

The AUR build failed while a plain cargo/meson build on the same machine (the
dev deploy, CI) linked fine, because only makepkg rewrites CFLAGS.

Set `options=('!lto')` in the stable, -git and working-tree PKGBUILDs. That
only turns off makepkg's C-flag-level LTO; Rust's own `lto = true` from
Cargo.toml is unaffected. Note the comment in AGENTS.md.
This commit is contained in:
raucao committed 2026-11-30 19:21:47 +04:00
1 parent d0fdc5bde0
commit 59392e5add
5 files changed
+37

No files matched your search

+7
View File
@@ -1337,6 +1337,13 @@ the UI is tested. `build-aux/deploy-dev.sh` runs on the build host,
post-release commit, because the sha cannot exist before the tarball does.
`build-aux/regent-dev/` is the *working-tree* package the dev deploy's `--pkg`
builds, not an AUR one.
- **Every PKGBUILD sets `options=('!lto')`.** makepkg's default `lto` appends
`-flto=auto` to `CFLAGS`, and `ring`/`secp256k1-sys` compile their C through
`cc` (which honours `CFLAGS`). rustc links the final binary without `-flto`, so
GCC's LTO plugin never runs and `lld` reports every C symbol as undefined
(`undefined symbol: rustsecp256k1_v0_10_0_…`) — the AUR build fails while a
plain `cargo`/`regent-deploy` build on the same machine links fine. `!lto`
only turns off makepkg's *C-flag* LTO; Rust's own `lto = true` stays.
- **Nostr is a mirror.** `.ngit/release.yaml` publishes the same tarball to
Blossom (`blossom.kosmos.org`) under NIP-82, signed by the fixed release
identity (one npub, forever). Gitea stays canonical, and a Nostr failure is not
+9
View File
@@ -13,6 +13,15 @@ the only place release notes are written.
## [Unreleased]
### Fixed
- Packaging no longer fails at link time with undefined
`rustsecp256k1_v0_10_0_…` and `ring_core_0_17_14__…` symbols. makepkg's
default `lto` option puts `-flto=auto` in `CFLAGS`, which the C code built by
`ring` and `secp256k1-sys` picks up, while rustc links the final binary
without it — so the LTO objects contributed no machine code. All PKGBUILDs
now set `options=('!lto')`.
## [0.9.0] - 2026-11-30
### Added
+7
View File
@@ -12,6 +12,13 @@ url="https://gitea.kosmos.org/raucao/regent"
license=('Unlicense')
depends=('gtk4' 'libadwaita' 'glib2' 'glibc' 'gcc-libs')
makedepends=('cargo' 'meson' 'blueprint-compiler' 'git')
# makepkg's default `lto` appends `-flto=auto` to CFLAGS, and ring and
# secp256k1-sys compile their C through the `cc` crate, which honours it. rustc's
# final link never passes `-flto`, so GCC's LTO plugin does not run and lld
# reports the C symbols as undefined ("undefined symbol:
# rustsecp256k1_v0_10_0_…"). Disable the C-flag-level LTO; Rust's own
# `lto = true` (Cargo.toml) is unaffected.
options=('!lto')
provides=('regent')
conflicts=('regent')
source=("$pkgname::git+https://gitea.kosmos.org/raucao/regent.git")
+7
View File
@@ -17,6 +17,13 @@ url="https://gitea.kosmos.org/raucao/regent"
license=('Unlicense')
depends=('gtk4' 'libadwaita' 'glib2' 'glibc' 'gcc-libs')
makedepends=('cargo' 'meson' 'blueprint-compiler')
# makepkg's default `lto` appends `-flto=auto` to CFLAGS, and ring and
# secp256k1-sys compile their C through the `cc` crate, which honours it. rustc's
# final link never passes `-flto`, so GCC's LTO plugin does not run and lld
# reports the C symbols as undefined ("undefined symbol:
# rustsecp256k1_v0_10_0_…"). Disable the C-flag-level LTO; Rust's own
# `lto = true` (Cargo.toml) is unaffected.
options=('!lto')
_release="https://gitea.kosmos.org/raucao/regent/releases/download/v$_tag"
source=("$pkgname-$_tag.tar.xz::$_release/$pkgname-$_tag.tar.xz"
"$pkgname-$_tag.tar.xz.asc::$_release/$pkgname-$_tag.tar.xz.asc")
+7
View File
@@ -12,6 +12,13 @@ url="https://gitea.kosmos.org/raucao/regent"
license=('Unlicense')
depends=('gtk4' 'libadwaita' 'glib2' 'glibc' 'gcc-libs')
makedepends=('cargo' 'meson' 'blueprint-compiler')
# makepkg's default `lto` appends `-flto=auto` to CFLAGS, and ring and
# secp256k1-sys compile their C through the `cc` crate, which honours it. rustc's
# final link never passes `-flto`, so GCC's LTO plugin does not run and lld
# reports the C symbols as undefined ("undefined symbol:
# rustsecp256k1_v0_10_0_…"). Disable the C-flag-level LTO; Rust's own
# `lto = true` (Cargo.toml) is unaffected.
options=('!lto')
provides=('regent')
conflicts=('regent')
source=()