Problem
make bootstrap-selfhost-lib-spine-smoke / native link of compiler_lib_spine_smoke fails on harness when expanding real JIT lowering on string builtins:
Call to undefined method Struct::getElementType()
Stack points at generated code in lib/JIT/Builtin/Type/String_.php (e.g. strlen / __string__alloc paths) calling:
$string->typeOf()->getElementType()->getName()
on LLVM values whose typeOf() is already a pointer (__string__*), not a struct wrapper — getElementType() is invalid on Struct in PHPLLVM for that shape.
This blocks:
Goal
Spine bundle links under AOT with real String_ JIT lowering (no Struct::getElementType fatal).
Implementation hints
| Area |
Files |
Approach |
| Root cause |
lib/JIT/Builtin/Type/String_.php |
Audit all typeOf()->getElementType() on params; use Context::getStringFromType() / struct name from pointer element type |
| Pattern |
lib/JIT/JitValueBox.php, lib/JIT/Context.php |
Existing helpers resolve __string__ / __value__ without double getElementType |
| Regression |
test/selfhost/compiler_lib_spine_smoke/ |
Must link in make bootstrap-selfhost-lib-spine-smoke |
| Policy |
lib/JIT/SelfHostBuiltinPolicy.php |
Keep stub until fix proven; then allowlist symbol batch |
Repro (Docker)
make docker-build-22
docker run --rm -v "$(pwd):/compiler" -w /compiler php-compiler:22.04-dev \
bash -lc 'make bootstrap-selfhost-lib-spine-smoke 2>&1 | tail -40'
Acceptance criteria
Dependencies
Verification (local / Docker only)
make bootstrap-selfhost-lib-spine-smoke
BOOTSTRAP_LIB_SPINE_VM_SMOKE=1 make bootstrap-selfhost-lib-spine-vm-smoke
No GitHub Actions.
Links
Problem
make bootstrap-selfhost-lib-spine-smoke/ native link ofcompiler_lib_spine_smokefails on harness when expanding real JIT lowering on string builtins:Stack points at generated code in
lib/JIT/Builtin/Type/String_.php(e.g.strlen/__string__allocpaths) calling:on LLVM values whose
typeOf()is already a pointer (__string__*), not a struct wrapper —getElementType()is invalid onStructin PHPLLVM for that shape.This blocks:
BOOTSTRAP_LIB_SPINE_VM_SMOKE_GATE=1inci-localExternalMethodfor hot string pathsGoal
Spine bundle links under AOT with real
String_JIT lowering (noStruct::getElementTypefatal).Implementation hints
lib/JIT/Builtin/Type/String_.phptypeOf()->getElementType()on params; useContext::getStringFromType()/ struct name from pointer element typelib/JIT/JitValueBox.php,lib/JIT/Context.php__string__/__value__without doublegetElementTypetest/selfhost/compiler_lib_spine_smoke/make bootstrap-selfhost-lib-spine-smokelib/JIT/SelfHostBuiltinPolicy.phpRepro (Docker)
Acceptance criteria
BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smokeexits 0 inphp-compiler:22.04-devStruct::getElementTypefatal fromString_.phpduring link./script/ci-local.shstill green (full gate after CI: Default BOOTSTRAP_LIB_SPINE_VM_SMOKE_GATE=1 in ci-local (#1846 follow-up) #1867 flip)Dependencies
Verification (local / Docker only)
No GitHub Actions.
Links