Commit 568bbc8
committed
fix(build): decide full-static from the TARGET, not from the build host
`supports_full_static` is a host constant (`is_linux`) describing what THIS
machine's own binaries can be. flags.cppm read it to decide whether the
ARTIFACT gets `-static` — a different question with a different answer the
moment host != target.
On a Linux host the two coincide for every Linux target, which is why this
survived: it is invisible until a non-Linux host cross-compiles to Linux.
There, `-static` was silently dropped and `x86_64-linux-musl` — a target whose
entire reason to exist is a portable, fully static ELF — produced something
else. No error, no warning; the flag just was not there.
The predicate now reads the parsed triple:
- empty triple → host target, so the host capability IS the answer
- PE targets → false; their `-static` comes from the C++ runtime
distribution contract (dist::Format::Pe), and answering
true here would make both mechanisms emit it
- macOS → false; libSystem must stay dynamic
- linux → true, glibc or musl, native or cross
- unparseable → fall back to the host answer rather than guess
Every path that works today is bit-for-bit unchanged: on a Linux host every
branch returns exactly what the old constant returned. Only the previously
broken host!=target case changes.
Turns the previous commit's assertions green:
[==========] 6 tests from 1 test suite ran.
[ PASSED ] 6 tests.
Refs .agents/docs/2026-08-03-windows-host-linux-cross-design.md §1.3 (B2)1 parent 2a4a5ba commit 568bbc8
2 files changed
Lines changed: 32 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| 24 | + | |
24 | 25 | | |
25 | 26 | | |
26 | 27 | | |
| |||
536 | 537 | | |
537 | 538 | | |
538 | 539 | | |
539 | | - | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
540 | 549 | | |
541 | 550 | | |
542 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
150 | 168 | | |
151 | 169 | | |
152 | 170 | | |
| |||
0 commit comments