Skip to content

build: apply the tccmacho page_count patch after checkout (vlang/v#29744) - #110

Merged
JalonSolov merged 2 commits into
vlang:thirdparty-macos-arm64from
quaesitor-scientiam:tccmacho-apply-patch-build
Oct 27, 2026
Merged

JalonSolov merged 2 commits into
vlang:thirdparty-macos-arm64from
quaesitor-scientiam:tccmacho-apply-patch-build

Conversation

@quaesitor-scientiam

Copy link
Copy Markdown

Summary

Dependency

The apply reads thirdparty/build_scripts/patches/tccmacho-page-count-filesize.diff from the V checkout the script runs in. That file lands with vlang/v#31146. Build from a V checkout that has it.

Keep in sync

The V repo script applies the same patch, but with --config-new_macho=no, where it is inert. This build.sh is a recorded copy of that script, and this change edits the copy. Both must carry the same apply step, or the next rebuild from the V script drops it.

Verified

  • bash -n build.sh passes.
  • git apply --check passes against TinyCC 85ba3ae8 (the commit this bundle pins), and the patched file has the three fixup_page_count references.

Not verified

  • A full rebuild of the bundle with this script.
  • The bundle on macOS 27 (globals repro).

🤖 Generated with Claude Code

)

PR #109 added patches/tccmacho-page-count-filesize.diff but nothing
applied it, so the bundle built from TCC 85ba3ae8 was unchanged. Apply
the patch from the V repo's copy after the TCC_COMMIT checkout, before
configure. The configure step keeps --config-new_macho=yes, so the
patch is active for this bundle.

The V repo copy of this script (thirdparty/build_scripts/
thirdparty-macos-arm64_tcc.sh) applies the same patch, but with
--config-new_macho=no, where it does nothing. Keep the two in sync.
This script now needs the V checkout to contain the patch file
(vlang/v#31146 or a branch that has it).

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@JalonSolov
JalonSolov requested a balanced review from Copilot October 26, 2026 00:55

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warning

Copilot couldn't run its full agentic review because it didn't start before the timeout. Make sure your repository has a runner available, or add a copilot-code-review.yml file specifying one with the runs-on attribute. See the docs for more details.

Copilot review overview

3 open issues
What changed in this PR

Ensures the TinyCC bundle build actually applies the existing Mach-O page_count patch needed to avoid macOS 27 “garbage globals” when chained fixups are enabled.

Changes:

  • Capture V_ROOT before entering tinycc/ so patch paths resolve correctly.
  • Apply tccmacho-page-count-filesize.diff immediately after checking out TCC_COMMIT and fail fast if it doesn’t apply.
File Description
build.sh Stores the V repo root and applies the TinyCC Mach-O page_count patch after checkout to ensure the bundled TCC includes the fix.

Review effort: Lite

Comment thread build.sh Resolved
Comment thread build.sh Resolved
Comment thread build.sh Resolved
A V checkout without vlang/v#31146 has no patch file, and the failure
used to show only as a git apply error. Check the path up front and
name the file and the required V change.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@JalonSolov
JalonSolov merged commit bdd0940 into vlang:thirdparty-macos-arm64 Oct 27, 2026
1 check failed
@quaesitor-scientiam
quaesitor-scientiam deleted the tccmacho-apply-patch-build branch October 27, 2026 01:54
JalonSolov pushed a commit that referenced this pull request Oct 27, 2026
#110 changed build.sh, so the recipe.sha256 in the macOS arm64
bundle manifest no longer matched the committed file. The staged preflight
rejected the manifest with "declared SHA-256 differs from the immutable
candidate blob", which fails the baseline contract probe in CI.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
medvednikov added a commit that referenced this pull request Nov 19, 2026
…OLDER=thirdparty/tcc bash thirdparty/build_scripts/thirdparty-macos-arm64_tcc.sh` (#120)

Rebuild the macOS arm64 bundle at TinyCC mob 0f004a08. The previous tcc.exe was the
2026-07-28 build of 85ba3ae8; the recipe changes since then (#109/#110 tccmacho patch, #118
--config-new_macho=no) were never applied to a published binary.

0f004a08 contains 70adbb12 (arm64: fix sp offsets of 4096 and more in arm64_spoff). With the
old tcc.exe, tests2/153_large_struct_args.c segfaults; with this one it matches its .expect.

update_tccbin.yml cannot publish this managed bundle (the recipe refuses non-deferred builds,
and monthly candidate composition needs a producer toolchain observation the base manifest
does not have). So this was built by hand with vlang/v master f56fcbbaaa's recipe in deferred
mode (TCCBIN_DEFER_COMMIT=1), MACOSX_DEPLOYMENT_TARGET=11.0 (minos 11.0, as before), Apple
clang 21 on macOS 27.2 arm64. The libgc files, README.md, build.sh and patches are unchanged.

automation/bundle-manifest.json: inventory/outputs sha256 updated for the rebuilt files, and
lib/bcheck_run.o (new in this TinyCC) added. Policy fields (recipe, sources, probes, contract)
are unchanged.

Checked locally: tccbin_tests (hello, gc_alloc, crash) pass with libgc.dylib; V master builds
itself with -cc tcc for two generations; `v -cc tcc test` over builtin, strings, os, math,
time, sync, x/json2, regex, encoding: 451 passed, 0 failed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants