2 Commits
Author SHA1 Message Date
Claude 3dd2eef7c9 Intel builtins with __eprintf, and ld64 for the PowerPC crt1.o of 10.4u
- The i386 builtins get __eprintf, which <assert.h> of the 10.4u SDK
  calls.
- ld64 links the PowerPC crt1.o of the 10.4u SDK, which takes the
  addresses of stubs with hi16 and lo16.
- build-runtime-macosx.sh: set the work directories of each step
  before the step.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRSSz5czpTdGQpDYmAk
2026-11-25 22:20:44 +00:00
Claude 037d92c51c Patch ld64 to link the 10.4 SDK's crt1.o
The gcc-built objects in Apple's 10.4 SDK (crt1.o from Xcode 2.0) were
built with -mlong-branch. ld64-253.9 failed on them twice:

- They have three stub sections, the first two empty. ld64 used the
  first, so references into the real stubs pointed nowhere
  ("sectionForAddress(0x620) address not in any section").
- Their long-branch islands take a dylib function's address as
  "stub - picbase". ld64 turns stub references into references to the
  dylib symbol, which a pointer difference cannot use (assertion in
  addClassicRelocs).

The patch uses the first non-empty stub section, and on PowerPC makes a
stub of our own for a pointer difference to a dylib symbol.
scripts/build-cctools-ppc.sh applies it. With it, all 36 test builds
link against MacOSX10.4.0.sdk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B82eRRFymRnn7sFGKZRuKh
2026-10-28 06:11:39 +00:00