fix(build): initial rincoin-seeder bootstrap (glibc 2.38, rebrand, configs) - #2
Open
Aevust wants to merge 3 commits into
Open
fix(build): initial rincoin-seeder bootstrap (glibc 2.38, rebrand, configs)#2Aevust wants to merge 3 commits into
Aevust wants to merge 3 commits into
Conversation
Rename bitcoin.{h,cpp} to rincoin.{h,cpp} and update include
guards (netbase/compat/serialize/uint256/strlcpy) from the
BITCOIN_ prefix to RINCOIN_. Add Rincoin Core copyright
headers across the source files and unify the license
reference to the in-repo COPYING file.
Advertise the subversion string /rincoin-seeder:1.0.0/ in the
version handshake, matching the current v1 generation. The
seed nonce value is unchanged; only its macro name is updated.
Fix the combine.pl address filter to match the Rincoin P2P
port 9555 instead of Bitcoin's 8333, and point test.pl at the
Rincoin seed zone.
No protocol behaviour changes: PROTOCOL_VERSION (60000), magic
bytes (RINC) and default ports (9555/19555) are left as-is. The
70018 customized-halving bump is deferred pending the Core/RIP
decision.
Enforce LF line endings, UTF-8 charset, final newline, and trailing-whitespace trimming across the repository. Makefile is explicitly preserved with tab indentation to avoid build failures. .gitattributes enforces LF at the Git layer, so checkouts remain consistent across the Windows and Ubuntu workflow.
The previous guard keyed on __GLIBC_USE(LIB_EXT2), which is enabled by _GNU_SOURCE and therefore always true in the C++ build, regardless of the glibc version. On glibc < 2.38, that skipped the bundled fallback even though libc does not provide strlcpy/strlcat there, leaving an undefined reference at link time. Key the fallback on __GLIBC_PREREQ(2, 38) together with __USE_MISC, the exact condition under which glibc declares these functions, and keep the bundled copies as plain inline definitions. This builds on glibc >= 2.38 (libc provides them), on glibc < 2.38 (bundled fallback), and on non-glibc libcs, without weakening _FORTIFY_SOURCE. Drop the gnu_inline attribute: with this guard, the bundled and libc definitions never coexist, and plain C++ inline avoids an undefined reference when the fallback is the only definition.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
fix(build): gate bundled strlcpy/strlcat on glibc 2.38 and __USE_MISC
Fixes the build failure on glibc 2.38+ (Ubuntu 24.04 / glibc 2.39, g++ 13) caused by a collision between glibc's fortified inline declarations and the bundled
strlcpy/strlcatfallback instrlcpy.h.Root cause
glibc 2.38 (2023) added
strlcpy/strlcatto libc, declared in<string.h>under__USE_MISC, with fortified definitions in<bits/string_fortified.h>. In a C++ build, libstdc++ defines_GNU_SOURCE, so__USE_MISCis active and glibc emits the declarations even under-std=c++11. Under the default_FORTIFY_SOURCEat-O3, those fortified inlines clash with the bundled plaininlinecopies, which carry nognu_inlineattribute:Fix
Define an internal
HAVE_LIBC_STRLCPYflag and compile the bundled copies only when it is unset. The flag is set through a two-level guard:defined(__GLIBC__) && defined(__GLIBC_PREREQ)keeps the preprocessor from evaluating the function-like__GLIBC_PREREQmacro on non-glibc toolchains (musl, *BSD, MinGW), where it is undefined and#if __GLIBC_PREREQ(...)would be ill-formed. On those platforms the flag stays unset and the bundled fallback is compiled, preserving prior behavior.__GLIBC_PREREQ(2, 38) && defined(__USE_MISC)matches the exact condition under which glibc declaresstrlcpy/strlcat(≥ 2.38 with__USE_MISCactive), so a strict build that does not pull in glibc's declaration still gets the fallback.__GLIBC_USE(LIB_EXT2)is unsuitable as the guard: it is enabled by_GNU_SOURCEand therefore always true in this C++ build, which would skip the bundled fallback even on glibc < 2.38 and cause an undefined reference at link time. The bundled function bodies and the third-party BSD header are unchanged.The same root cause exists in upstream
sipa/bitcoin-seeder; the fix has been shared on the related upstream issue as an individual contribution:sipa/bitcoin-seeder, issue 109.chore: rebrand bitcoin-seeder to rincoin-seeder
Adapts the upstream bitcoin-seeder for the Rincoin network:
bitcoin.cpp/bitcoin.htorincoin.cpp/rincoin.hand updates the seed nonce and include guards accordingly.9555, seed hostseed.rincoin.org, and version string/rincoin-seeder:1.0.0/.COPYING(MIT) and per-file copyright headers crediting The Rincoin Core developers while preserving attribution to bitcoin-seeder by Pieter Wuille (sipa).README,Makefile,combine.pl, andtest.plfor the Rincoin network.chore: add .editorconfig and .gitattributes
Enforces LF line endings, UTF-8 charset, final newline, and trailing-whitespace trimming across the repository.
.gitattributeshandles normalization at the Git layer for consistency across the Windows and Ubuntu build workflow.Makefileis explicitly preserved with tab indentation to avoid build failures.Testing
make clean && makeon Ubuntu 24.04 (glibc 2.39, g++ 13) —redeclared inlineerror absent,dnsseedbinary producedundefined reference to strlcpy/strlcatlinker errorsdnsseedstarts and resolves queries on test portBuild & smoke test — Ubuntu 24.04 (glibc 2.39, g++ 13) — 2026-06-08
Build (
make clean && make):No
redeclared inlineerrors. Noundefined referencelinker errors.dnsseedbinary produced.Smoke test (test port, ~4 min):
DNS resolution (
dig @127.0.0.1 -p 15353 A seed.rincoin.org):3 A records returned from available pool (7/26). Query time 0 ms (UDP).
Provenance
GPG-signed development commit:
Aevust/rincoin-seeder/commit/b7a23c7a0cba02576863aa78179328affaeb95b7