guix: produce a -static-pie bitcoind

bitcoin/bitcoin: PR #25573

1 minor finding · 7 suggestions

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

Findings

Link

[minor] · Static executable links lose --fatal-warnings

The x86_64/aarch64 static executable links no longer treat linker warnings as build failures, although no warning currently emitted by these links was identified.

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

Details and suggested fix

Previously, CMAKE_EXE_LINKER_FLAGS included ${HOST_LDFLAGS}, which supplies -Wl,--fatal-warnings on these hosts. The new static branch supplies its own cache value without that option. Keeping ${HOST_LDFLAGS} in the environment does not restore it, and working_linker_werror_flag only enforces warnings during CMake probes. Add -Wl,--fatal-warnings to the static-specific flags to preserve the existing policy without restoring the dynamic-linker option from ${HOST_LDFLAGS}.


Optional improvements

Link

[suggestion] · Static glibc's security-update ownership is undocumented

For x86_64/aarch64 non-GUI release binaries, host glibc security updates no longer update the embedded resolver, but the release notes do not explain that users need an updated Bitcoin Core binary.

Location: contrib/guix/toolchains.scm:307 (head).

Details and suggested fix

These executables now incorporate glibc 2.44 pinned to 625054f30f0e7a961519f045f2364aa3ca6c1c6b. This includes getaddrinfo, which DNS seeding uses without a name proxy. Distribution updates to libc.so.6 cannot replace that embedded code. Document this change in the release notes and state how glibc security fixes will be tracked and delivered through updated Bitcoin Core binaries on maintained branches. This extends the dependency-update responsibility already accepted for other statically linked libraries; it does not identify a current glibc vulnerability.


Link

[suggestion] · Shipped INSTALL.md still requires system glibc for every binary

The Linux archives still contain an unconditional glibc 2.31 requirement that contradicts the newly supported static non-GUI executables.

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

Details and suggested fix

package.sh copies doc/INSTALL_linux.md into every Linux archive as INSTALL.md, including its statement that Bitcoin Core requires glibc 2.31 or newer. Scope that requirement to the dynamically linked GUI executables and the other Linux architectures. Explain separately that the x86_64/aarch64 static non-GUI release executables do not require an installed glibc, while retaining the minimum-kernel requirement.


Link

[suggestion] · The portability exception omits bitcoin-gui

The release note excludes only bitcoin-qt, but the shipped bitcoin-gui executable also remains dynamically linked.

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

Details and suggested fix

build_linux_gui.sh builds and installs both GUI executables with the dynamic-linker flags, and ELF_DYNAMIC_EXECUTABLES exempts both from static checks. The bitcoin wrapper can launch bitcoin-gui, so the current wording incorrectly includes that GUI in the non-glibc and older-glibc portability claim. Name both bitcoin-qt and bitcoin-gui in the exception.


Link

[suggestion] · Static symbol checks bypass named failure reporting

Static symbol checks lose per-file diagnostics; assertions also disappear under python -O, although no current optimized-Python caller was found and normal release packaging still rejects violations.

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

Details and suggested fix

check_ELF_STATIC asserts every property and its caller ignores the return value. A violation therefore raises an uncaught AssertionError without identifying the binary and stops checking subsequent files, rather than populating failed. Optimized Python also removes the nested ABI and runpath calls entirely. Standard packaging uses plain python3 inside a --pure Guix environment, so it retains assertion enforcement. Although assert-based runpath checking predates this PR, the new static gate makes every property assertion-dependent. Implement the static properties, including ABI and runpath, as named boolean checks and run them through the existing failure-collection loop.


Link

[suggestion] · ELF ARM64 release checks do not verify BTI marking

The pre-existing ELF ARM64 checks leave the branch-protection claim for the new static build unchecked; no missing BTI marking has been demonstrated.

Location: contrib/guix/linux_static.scm:7 (head).

Details and suggested fix

The PR claims to complete #19075, but security-check.py assigns ELF ARM64 only BASE_ELF; its branch-protection check applies only to Mach-O. CMake requests -mbranch-protection=standard, and GCC enables standard branch protection by default, but those settings do not verify the final ELF property after linking all archives. Add a check for GNU_PROPERTY_AARCH64_FEATURE_1_BTI on the static aarch64 executables so an unmarked input cannot silently remove the expected marking.


Link

[suggestion] · The static symbol count does not enforce the export policy

The static branch replaces check_exported_symbols with a count bound, allowing a small set of unexpected exports to escape the release check.

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

Details and suggested fix

check_ELF_STATIC documents no exported symbols but checks only that there are at most three dynamic symbols and no imports. On x86_64, a null entry plus one or two defined exports can satisfy those conditions, and the --static path never invokes check_exported_symbols. Restore that check in the static branch, with explicit exceptions if the aarch64 entries require them. Their identities have not been verified, so reusing the existing check unchanged needs that confirmation first.


Link

[suggestion] · The introducing commit leaves the NSS trade-off unexplained

The glibc introduction includes the NSS behavior change without explaining its rationale, separating review of the patch from the later explanation of its compatibility cost.

Location: contrib/guix/patches/glibc-nss-nodlopen.patch:16 at 5a69ace7198b (commit) (commit).

Details and suggested fix

Commit 5a69ace7198baaa0519535a658b392cee7b982ef adds glibc-nss-nodlopen.patch, replacing __libc_dlopen with NULL and suppressing the NSS static-link warning, but its message explains only the /gnu/store path changes. The loss of dynamic NSS backends such as mDNS, LDAP and SSSD is explained later in release-note commit 53fcd3b31ee1b40741663b55e7b9836ab4df3a21. Add the rationale and compatibility cost to the introducing commit's message so reviewers can assess that trade-off with the patch. Alternatively, move the NSS patch and its package entry into a dedicated explanatory commit after the glibc introduction and before 226fc963ea6bb18a04169396e4e3945ab2d5ecf6, which first selects the new libc. The manifest still uses the default libc at the introduction, so this rearrangement preserves the activation dependency. This concerns review flow, not a defect in the final tree.


Coverage details

Earlier concerns

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

Background

Ralph's summary of historical context for the behaviour affected by this change. The historical record reviewed here is incomplete.

Documented decisions

The historical goal for static release binaries was to reduce dependence on the installed system libraries, thereby removing variability, possible bugs and glibc compatibility workarounds, while simplifying containers, application images and VMs. The same discussion accepted that the GUI could retain additional system-library and font requirements.

This explains the portability objective behind statically linking bitcoind and utilities while leaving the GUI dynamically linked. The historical objective was operational independence from host libraries, not merely obtaining an executable described as statically linked.

Source 1 · Source 2