Files
b4a41308ec tcc: count only file-backed pages in chained-fixups page_count (#29744) (#31146)
On macOS 27, TinyCC's chained-fixups writer sizes the __DATA segment's
page_count from vmsize, so the zero-fill __bss pages are listed as
file-backed. dyld then maps them from the file instead of zero-filling,
which gives garbage globals.

Add a patch that counts ceil(filesize / SEG_PAGE_SIZE) pages and skips
segments with no file-backed pages. Apply it after checkout of
TCC_COMMIT in the arm64 TCC build script.

The script configures TinyCC with --config-new_macho=no, so the patch
is compiled but inactive for this bundle. It is kept as defense in
depth for builds that keep chained fixups. The recorded TCC commit hash
does not reflect the applied patch.

Co-authored-by: Richard Wheeler <quaesitor.scientiam@gmail.com>
Co-authored-by: Claude Haiku 5.5 <noreply@anthropic.com>
2026-10-25 20:03:37 -04:00
..

This folder, contains build scripts used by the CI, to generate prebuilt versions (or latest version by default) of: A) TCC from https://repo.or.cz/tinycc.git/ B) libgc from https://github.com/ivmai/bdwgc/

In time, if everything works fine, we can deprecate the older approach, keeping 2 separate binary repos, tccbin/ and libgcbin/, with just pointers back to the build scripts here.

Note: the previous approach (before 2024/08), used in https://github.com/vlang/tccbin/, where that separate repo contained both prebuilt binaries for tcc AND libgc.a, AND the separate scripts to generate them, in separate branches. In contrast, this folder contains all scripts in the same location, in the same branch, just with different names, thus making editing them all at the same time and in atomic commits, that can be reviewed and tested separately in PRs on the CI much easier.

WARNING: this is still experimental, and should not be used, except to ease testing on the CI.