Problem
Self-host Phase A–C are green (docs/bootstrap-selfhost.md, #512–#520 ✅): procedural test/bootstrap-aot/*, namespace_hello.php, class constants, native link smoke.
The compiler itself lives under namespace PHPCompiler; in lib/. #84 / #513 closed namespace parsing for small fixtures, but no issue tracks linking a real lib/ file (e.g. lib/OpCode.php or lib/Frame.php) as a native binary.
Goal
Add Phase D gate:
make bootstrap-aot-link-lib # new target
# links one namespaced lib/*.php subset; stdout matches Zend on fixture input
Scope
Acceptance criteria
docker run --rm -i -w /compiler php-compiler:22.04-dev bash -lc '
tar -xf - 2>/dev/null
make bootstrap-aot-link-lib
'
Exit 0; linked binary runs without Zend for the fixture.
Verification (local / Docker only)
php script/bootstrap-inventory.php --check
php script/bootstrap-aot-lint.php
make bootstrap-aot-link-lib
Dependencies
Non-goals
Links
Problem
Self-host Phase A–C are green (
docs/bootstrap-selfhost.md, #512–#520 ✅): proceduraltest/bootstrap-aot/*,namespace_hello.php, class constants, native link smoke.The compiler itself lives under
namespace PHPCompiler;inlib/. #84 / #513 closed namespace parsing for small fixtures, but no issue tracks linking a reallib/file (e.g.lib/OpCode.phporlib/Frame.php) as a native binary.Goal
Add Phase D gate:
Scope
lib/OpCode.phplints;lib/Frame.phpneeds ClassMethod)script/bootstrap-aot-link.shwithlib_opcode(or similar) targetdocs/bootstrap-selfhost.md+ 🗺️ ROADMAP: Compile a small PHP web application (living document) #78 Phase 0 stretch@group llvmtest or script check inci-local.sh(optional, skipped without LLVM)Acceptance criteria
Exit 0; linked binary runs without Zend for the fixture.
Verification (local / Docker only)
Dependencies
lib/Frame.php-class unitslib/Runtime.phpNon-goals
lib/Compiler.phpin one TU (AOT: Link multiple translation units into one binary #154 multi-TU stretch)vendor/Links