guix: produce a -static-pie bitcoind

bitcoin/bitcoin: PR #25573

1 minor finding · 3 suggestions

Earlier concerns neither republished nor resolved: 3 suggestions. See the Run archive for their assessments.

Findings

Link

[minor] · Static-PIE links no longer fail on linker warnings

The x86_64 and aarch64 static-PIE executable flags drop --fatal-warnings, removing a release-build gate; no warning from the current links has been identified.

Location: contrib/guix/libexec/build_linux.sh:48 (head).

Details and suggested fix

The new branch supplies an explicit CMAKE_EXE_LINKER_FLAGS value without the -Wl,--fatal-warnings still added to HOST_LDFLAGS. Previously, that flag reached executable links through ${HOST_LDFLAGS}. Neither environment LDFLAGS nor the depends toolchain's initialization overrides the explicit cache value, and the CMake helper's fatal-warning option applies only to configure probes. Consequently, a linker warning no longer makes these executable links fail. Add -Wl,--fatal-warnings to the static branch without restoring the dynamic-interpreter option.


Optional improvements

Link

[suggestion] · Runtime documentation omits the second dynamic GUI executable

bitcoin-gui remains dynamically linked but is missing from the release-note exception, while the shipped INSTALL.md incorrectly retains a glibc 2.31 requirement for all binaries.

Location: doc/release-notes-25573.md:4 (head).

Details and suggested fix

build_linux_gui.sh separately builds and installs both bitcoin-qt and bitcoin-gui with dynamic-linker flags and the glibc 2.31 toolchain. Both therefore still need a compatible host glibc and loader, as reflected by their exemptions in symbol-check.py. List both executables as exceptions in this note. Also narrow the unconditional requirement in doc/INSTALL_linux.md to the GUI executables and the other Linux architectures: package.sh copies that document into each Linux archive as INSTALL.md, where it otherwise contradicts the new portability statement for the static binaries.


Link

[suggestion] · Static ELF assertions bypass normal failure reporting

--static failures abort reporting instead of naming the file and check; optimized Python removes all static checks, although default Guix packaging fails closed.

Location: contrib/guix/symbol-check.py:302 (head).

Details and suggested fix

check_ELF_STATIC expresses every requirement as an assert, and its caller neither uses the return value nor adds to failed. A violation raises an uncaught AssertionError, skipping the usual <file>: failed <CHECK> report and all remaining files. With python3 -O or PYTHONOPTIMIZE, even the ABI and RUNPATH calls disappear, so a non-GUI ELF selected by --static passes symbol-check without validation. The default invocation uses plain python3 in a pure Guix environment and does not request optimization. Express the static requirements as named boolean checks and accumulate failures through the existing reporting path.


Link

[suggestion] · Static symbol counts do not reject unexpected exports

The static checker would accept up to two unexpected x86_64 exports under its three-symbol ceiling; no current unexpected export has been identified.

Location: contrib/guix/symbol-check.py:303 (head).

Details and suggested fix

The --static path skips check_exported_symbols and only limits the total number of dynamic symbols. With the documented single zero-value x86_64 baseline entry, one or two additional defined exports fit under that limit without violating the import, library, interpreter, ABI or RUNPATH checks. REDUCE_EXPORTS is enabled, but it does not validate the resulting symbol identities. Check exported-symbol identities against an explicit per-architecture allowlist of expected baseline symbols rather than relying on the total count.


Coverage details

Earlier concerns

Earlier reports raised these, with the titles and severities shown there. This review neither republished nor resolved them.