contrib: fix macOS cross-compile config #11618
riptl commented on Sep 22, 2026 14:34 UTC
This switches CC only after base.mk has already derived CC_MAJOR_VERSION from the bootstrap compiler. Consequently the LLVM 21-specific -Wno-unterminated-string-initialization in config/extra/with-brutality.mk is not enabled, while exact-size string initializers such as src/waltz/h2/fd_h2_conn.c:12 trigger that warning under -Werror. Refresh the compiler version variables after assigning the cross compiler.
Removing CMake and the downloaded project-dependency packages leaves the setup documentation inaccurate: contrib/cross/README.md:34-39 still says this script downloads and builds Firedancer project dependencies. Update that setup list to describe the sysroot-only behavior.
<!-- ccr-overview-v2 -->
Copilot review overview
🟡 Changes recommended
The cross compiler version metadata remains derived from the host compiler, preventing required LLVM 21 warning configuration.
Get a fresh assessment by requesting another Copilot review.
Review effort: Balanced
Findings: 1 <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/high-v2-light.png" alt="High severity" width="62" height="18" align="texttop"></picture> · 1 <picture><source media="(prefers-color-scheme: dark)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.svg"><img src="https://github.githubassets.com/static/images/icons/copilot-code-review/low-v2-light.png" alt="Low severity" width="62" height="18" align="texttop"></picture>
<details open>
<summary><strong>Open (2)</strong></summary>
</details>
<details>
<summary><strong>What changed in this PR</strong></summary>
Fixes macOS ARM-to-Linux x86 cross-compilation and simplifies toolchain setup.
Changes:
| File | Description |
| ---- | ----------- |
| contrib/cross/macos-arm-clang_x_linux-x86.sh | Streamlines toolchain dependencies and sysroot packages. |
| config/everything.mk | Applies build flags when compiling build metadata. |
| config/cross/macos-arm-clang_x_linux-x86.mk | Selects Homebrew LLVM 21. |
</details>
---
💡 <a href="/firedancer-io/firedancer/new/main?filename=.github/skills/code-review/SKILL.md" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Add a code-review agent skill</a> or configure MCP servers for context-aware, tailored reviews. <a href="https://docs.github.com/copilot/how-tos/use-copilot-agents/request-a-code-review/use-code-review?tool=webui#mcp-servers-and-agent-skills" class="Link--inTextBlock" target="_blank" rel="noopener noreferrer">Learn more in the docs.</a>
I did not run into this problem
<!-- fd-benchmark-comment:v1 -->
┌─ ⚡ PERF · 0dd61ad vs main@57d3990 ─────────────────────────────────
│ SUITE BASELINE NEW Δ
│ replay tps, mainnet 30,802 tps 30,966 tps · +0.53%
│ bench tps, localnet 763,778 tps 761,860 tps · -0.25%
│ snapshot load, testnet 14.94 s 15.02 s · +0.51%
│ mem total, mainnet 158.44 GiB 158.44 GiB · 0.00%
│ mem total, testnet 89.44 GiB 89.44 GiB · 0.00%
│ mem total, ag mainnet 189.95 GiB 189.95 GiB · 0.00%
│ mem total, ag testnet 120.95 GiB 120.95 GiB · 0.00%
│ clean compile, firedancer 3.00 s 3.00 s · -0.03%
│ binary size, firedancer 56.26 MB 56.26 MB · 0.00%
├─────────────────────────────────────────────────────────────────────
@@ 0 REGRESSIONS · 0 WARNINGS · 0 IMPROVED · 9 NOISE @@
└─────────────────────────────────────────────────────────────────────
<!-- fd-benchmark-state {"head":"0dd61ad3945c84d2cadabc9971304cc196522d32","base":"57d39904e3886731b96b9174ff8763ee7c36e3ad","runs":{"replay":{"run_id":35741284448,"status":"done","rows":{"replay_tps":{"base":30801.8,"new":30966.1},"mem_mainnet":{"base":158.4417495727539,"new":158.4417495727539},"mem_testnet":{"base":89.4417495727539,"new":89.4417495727539},"mem_ag_mainnet":{"base":189.95149612426758,"new":189.95149612426758},"mem_ag_testnet":{"base":120.95149612426758,"new":120.95149612426758},"compile":{"base":2.998,"new":2.997},"binsize":{"base":56.262152,"new":56.262504}}},"snapshot":{"run_id":35741284448,"status":"done","rows":{"snapshot_load":{"base":14.939146190998144,"new":15.015648648994102}}},"bench":{"run_id":35741284448,"status":"done","rows":{"bench_tps":{"base":763778,"new":761860}}}},"history":[],"seq":3} -->
Approved these changes.
drubin-fd