AI-generated analysisPublished automatically and not human-verified. Validated context appears in community notes below.
← Watch feed
Informational 15 Bitcoin

Merge bitcoin/bitcoin#37007: refactor: Add missing explicit instantiations of function templates

Public commit record

What the developer wrote

Authored by merge-script

81/100 · Strong
Merge bitcoin/bitcoin#37007: refactor: Add missing explicit instantiations of function templates

7ec6081ecab27b1ff453f986567b299f7b76d994 refactor: Add missing explicit instantiations of function templates (Hennadii Stepanov)

Pull request description:

The `SignatureHash` and `SignatureHashSchnorr` function templates are defined in `interpreter.cpp` but are also used from other translation units, which have relied on implicit instantiations being emitted in that file. The standard does not guarantee that.

This PR adds the missing explicit instantiations. It fixes linker errors (see the nightly builds with [libstdc++](https://cdash.fish.foo/builds/941/build) and [libc++](https://cdash.fish.foo/builds/951/build)) when building with Clang 24, where module-local optimizer hints are now enabled by default. The change was introduced in https://github.com/llvm/llvm-project/pull/238529.

A successful build of this branch with Clang 24 is available here: https://github.com/hebasto/bitcoin-core-nightly/pull/496.

As a workaround, Clang's previous behavior can be [restored](https://github.com/hebasto/bitcoin-core-nightly/pull/495) with the `-fno-module-local-hints` flag.

ACKs for top commit:
maflcko:
review ACK 7ec6081ecab27b1ff453f986567b299f7b76d994 🔌
sedited:
ACK 7ec6081ecab27b1ff453f986567b299f7b76d994

Tree-SHA512: d49b578876df77f4636d750e5c11c094308b06c8803d3ef2bd1644303dcaf25a9af9afd695f93ecaf76f7dd43ef158221cc355518c039ad8fc80612fa229cf8d
✓ Specific, descriptive subject✓ Names a concrete action or component✓ Provides detailed explanatory context✓ Links an issue, advisory, or supporting reference
The short version

What changed, and why it matters

This is a build-fix change, not a security fix. It adds explicit template instantiations for two internal functions used when computing Bitcoin transaction signatures. Without these, newer Clang compilers could fail to link the program because the functions were being used across multiple source files but only implicitly created in one. The change ensures the functions are definitely generated at compile time so the linker can find them. There is no vulnerability being patched here.

Recommended action

No security action required. Treat as a normal build-system/portability fix. Ensure CI includes Clang 24 builds to catch similar ODR/linkage issues in the future.

Security signals we found

No strong security signals were identified.

Risk score

Why this scored 15/100

Our methodology →
Potential impact 0/30
Exploitability 0/25
Stealth signal 0/15
Affected reach 0/15
Confidence 10/10
Evidence quality 5/5
Human-validated context

Community notes

Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.

No validated notes yet.

The AI analysis stands alone for now. Submit a note if you can add evidence or important context.