case148 โ Header build-context mismatch (cross-source flagship)¶
| Field | Value |
|---|---|
| Verdict | ๐ API_BREAK |
| Category | API Break |
| Platforms | Linux |
| Flags | API break |
Detected ChangeKinds |
โ |
| Source files | examples/case148_xcheck_header_build_mismatch/ |
Verdict: ๐ API_BREAK ยท Cross-check: header_build_context_mismatch ยท
Mode: single-release audit ยท Evidence tier: L3
What it demonstrates¶
The clearest case that combining two sources beats either alone. The public
headers were parsed without the build's ABI-relevant flags
(glibcxx_use_cxx11_abi, -DBIG_BUFFERS). The layout abicheck recorded from the
context-free header parse is therefore wrong โ but nothing in the header
text or the binary says so.
Why no single source sees it¶
| Source | What it sees alone |
|---|---|
| Binary (L0/L1) | a valid layout โ blind to which macros produced it |
| Header AST (L2) | a layout parsed without -DBIG_BUFFERS โ the wrong layout, reported with full confidence |
| Build flags (L3) | the project compiled the TU with -DBIG_BUFFERS=1 |
| Combination | L2 macros โ L3 flags disagree โ HEADER_BUILD_CONTEXT_MISMATCH (API_BREAK) |
Only crosschecking the L2 macro context against the L3 compile flags exposes the divergence. This is why a clean "no change" from a context-free header parse can be actively misleading.
Reproduce¶
abicheck scan --binary libdemo.so -H include/ --build-info build/ --audit # build/ holds compile_commands.json
Fix¶
Parse the public headers with the same ABI-relevant flags the build uses (feed abicheck the compile DB), so the recorded layout matches what ships.
Source files¶
snapshot.abi.json
See also: Examples overview ยท All API_BREAK cases ยท Category: API Break.