Skip to content

Fix build on GCC 15 (Fedora 43+) by injecting missing <cstdint> include#1269

Open
stephensong wants to merge 1 commit intoromanz:masterfrom
stephensong:fix/gcc15-cstdint
Open

Fix build on GCC 15 (Fedora 43+) by injecting missing <cstdint> include#1269
stephensong wants to merge 1 commit intoromanz:masterfrom
stephensong:fix/gcc15-cstdint

Conversation

@stephensong
Copy link

Summary

  • GCC 15 (shipped with Fedora 43+) no longer transitively includes <cstdint> from C++ standard headers
  • This causes the bundled RocksDB source in rust-librocksdb-sys to fail with errors like 'uint64_t' has not been declared
  • Fix adds .cargo/config.toml that sets CXXFLAGS = "-include cstdint", injecting the missing include globally for all C++ compilation units

Why this approach

  • No vendored source files are patched
  • No impact on compilers that already include <cstdint> transitively (the flag is harmless if the header is already included)
  • Minimal, single-file change

Test plan

  • Clean cargo build --release succeeds on Fedora 43 with GCC 15
  • Resulting electrs binary runs and reports correct version (v0.11.0)

…lude

GCC 15 no longer transitively includes `<cstdint>` from C++ standard
headers, causing the bundled RocksDB in rust-librocksdb-sys to fail
with `uint64_t has not been declared` errors. Setting CXXFLAGS via
`.cargo/config.toml` resolves this without patching vendored sources.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
# The bundled RocksDB source in rust-librocksdb-sys requires uint64_t etc.,
# so we inject the missing include globally for all C++ compilation units.
[env]
CXXFLAGS = "-include cstdint"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this override existing CXXFLAGS?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants