Skip to content

backport: bitcoin/bitcoin#30824: cmake: decouple FORTIFY_SOURCE check from Debug build type - #7696

Merged
PastaPastaPasta merged 1 commit into
dashpay:developfrom
knst:bp-30824-autotools
Sep 19, 2026
Merged

PastaPastaPasta merged 1 commit into
dashpay:developfrom
knst:bp-30824-autotools

Conversation

@knst

@knst knst commented Sep 18, 2026

Copy link
Copy Markdown
Collaborator

Issue being fixed or feature implemented

Every --enable-debug guix build has failed make -C src check-security since 2026-08-29, which is why there has been no nightly release on dash-dev-branches since v23.1.8-nightly.2026.07.30:

Checking binary security...
dash-tx: failed FORTIFY
dash-wallet: failed FORTIFY
make: *** [Makefile:28516: check-security] Error 1

What was done?

Backport bitcoin#30824

FORTIFY_SOURCE should be used if ENABLE_HARDENING=ON and optimisations are being used. This should not be coupled to any particular build type, because even if the build type is Debug, optimisations might still be in use.

Fixes: bitcoin#30800.
Also somewhat of a followup to bitcoin#30778 (comment).

How Has This Been Tested?

To-be-defined

Breaking Changes

Guix builds with debug enabled actually fortified.

Checklist:

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have made corresponding changes to the documentation
  • I have assigned this pull request to a milestone (for repository code-owners and collaborators only)

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

…rom `Debug` build type

BACKPORT marked as partial to be sure that it would be backported again after cmake migration
-----
30803a3 cmake: decouple FORTIFY_SOURCE check from Debug build type (fanquake)

Pull request description:

  `FORTIFY_SOURCE` should be used if `ENABLE_HARDENING=ON` and optimisations are being used. This should not be coupled to any particular build type, because even if the build type is `Debug`, optimisations might still be in use.

  Fixes: bitcoin#30800.
  Also somewhat of a followup to bitcoin#30778 (comment).

ACKs for top commit:
  ryanofsky:
    Code review ACK 30803a3
  TheCharlatan:
    ACK 30803a3

Tree-SHA512: 298f8805a5bb2f1ff54e51ea31324d712c2070cc3eba26561c31001ace4bfa37ae6d18531cbd45e2faf610a0a1b83b420fcde6e329e17f02b021d26563583913

Co-authored-by: merge-script <[email protected]>
@knst
knst force-pushed the bp-30824-autotools branch from 57c5af4 to f1f64f7 Compare September 18, 2026 16:47
@thepastaclaw

Copy link
Copy Markdown
Collaborator

Guix Automation has started building this PR as v23.1.8-devpr7696.f1f64f77. A follow-up comment will be posted when the build finishes.

@thepastaclaw

thepastaclaw commented Sep 18, 2026 •

Copy link
Copy Markdown
Collaborator

⚠️ DEGRADED — Final review complete — no blockers (commit f1f64f7) · triage: low · stand-in models (primary models out of quota)

@coderabbitai

coderabbitai Bot commented Sep 18, 2026 •

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Advanced

Run ID: 67c5531b-4338-4778-8b24-53e6d4f216a3

📥 Commits

Reviewing files that changed from the base of the PR and between dd905bd and f1f64f7.

📒 Files selected for processing (1)
  • configure.ac

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


Walkthrough

The autoconf configuration no longer skips the _FORTIFY_SOURCE=3 check for debug builds. It tests the configured optimization flags and adds the hardening flags only when preprocessing confirms that optimization is active.

Priority: ⬆️ High

Estimated code review effort: 2 (Simple) | ~10 minutes

Merge Risk: ⚪ Minimal · up to f1f64

The configuration now applies Fortify flags when optimization is active, including supported debug configurations, without an established build or runtime regression.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description directly explains the FORTIFY_SOURCE hardening change, the failed debug Guix security checks, and the intended backport.
Title check ✅ Passed The title clearly identifies the backport and the main change: decoupling the FORTIFY_SOURCE check from the Debug build type.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

Copy link
Copy Markdown
Collaborator

@knst knst changed the title Merge bitcoin/bitcoin#30824: cmake: decouple FORTIFY_SOURCE check from Debug build type backport: bitcoin/bitcoin#30824: cmake: decouple FORTIFY_SOURCE check from Debug build type Sep 18, 2026

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

⚠️ DEGRADED — Final validation — Phase 1 + Phase 2

⚠️ DEGRADED review. The primary review models were unavailable (gpt-6-astra unavailable: All credentials for model gpt-6-astra are cooling down (last error: usage_limit_reached: The usage limit has been reache), so this review ran on stand-in models: gpt-5.6-luna → muse-spark-1.3-contributor, gpt-5.6-sol → muse-spark-1.3-contributor, gpt-5.6-terra → muse-spark-1.3-contributor, gpt-6-astra → muse-spark-1.3-contributor. Both review phases and the independent verifiers still ran, but on weaker models, with Phase 1 capped at high effort. Treat the verdict as provisional; a full-strength re-review will run on the next push once the primary models are back.

Backport correctly adapts upstream cmake FORTIFY decoupling to Dash's autotools build: the enable_debug gate is replaced by an OPTIMIZE probe with flags in compile-line order. Verified AX_CHECK_PREPROC_FLAG supports the extra-flags/input args and Dash's CMakeLists.txt has no hardening landing site, so the declared-partial CMake omission is intentional. No in-scope defects.

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: muse-spark-1.3-contributor (agent: phase1-reviewer, role: backport-reviewer); reviewer 3: muse-spark-1.3-contributor (agent: phase1-reviewer, role: dash-core-commit-history); reviewer 4: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: phase2-reviewer, role: general); reviewer 5: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: phase2-reviewer, role: backport-reviewer); reviewer 6: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: phase2-reviewer, role: dash-core-commit-history); final verifier: muse-spark-1.3-contributor (standing in for gpt-6-astra) (agent: astra-verifier, role: final-verifier)

  • Degraded mode: gpt-6-astra unavailable: All credentials for model gpt-6-astra are cooling down (last error: usage_limit_reached: The usage limit has been reache (detected by probe, since 2026-09-18T05:22:01Z); stand-ins gpt-5.6-luna → muse-spark-1.3-contributor, gpt-5.6-sol → muse-spark-1.3-contributor, gpt-5.6-terra → muse-spark-1.3-contributor, gpt-6-astra → muse-spark-1.3-contributor; Phase 1 effort capped at high
  • Triage: low by muse-spark-1.3-contributor (standing in for gpt-6-astra) (effort low) — Small contained build-hardening fix in configure.ac decoupling FORTIFY_SOURCE from Debug build type whose correctness is easy to confirm.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort high); agent phase1-reviewer, muse-spark-1.3-contributor — backport-reviewer (completed, effort high); agent phase1-reviewer, muse-spark-1.3-contributor — dash-core-commit-history (completed, effort high); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (lane failed), glm-5.3-flash (zai below 15% reserve: 5h 99% left, weekly 14% left)
  • Fresh verifier: muse-spark-1.3-contributor (standing in for gpt-6-astra) — final-verifier; agent astra-verifier
  • Phase 2 reviewers: muse-spark-1.3-contributor (standing in for gpt-6-astra) — general (completed, effort medium); agent phase2-reviewer, muse-spark-1.3-contributor (standing in for gpt-6-astra) — backport-reviewer (completed, effort medium); agent phase2-reviewer, muse-spark-1.3-contributor (standing in for gpt-6-astra) — dash-core-commit-history (completed, effort medium); agent phase2-reviewer

@thepastaclaw thepastaclaw added the pastaclaw:commented thepastaclaw's latest review was comment-only label Sep 18, 2026
@PastaPastaPasta
PastaPastaPasta merged commit 86771f6 into dashpay:develop Sep 19, 2026
52 of 53 checks passed
@thepastaclaw thepastaclaw removed the pastaclaw:commented thepastaclaw's latest review was comment-only label Sep 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

cmake: incorrect assumption that Debug build type will not use optimisations

3 participants