Repository navigation
Self-host M3: emit-TU link via LLVM stubs (no PHP CFG segfault) - #2548
Merged
Merged
Conversation
Route Runtime/Compiler spine and bundled lib/ to native LLVM stubs during
M3 emit-TU link instead of PHP CFG lowering (LLVM 9 global ctor segfault).
Simplify {main} to PHP CFG and avoid object allocate in the emit bridge.
Closes #2540
Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
force-pushed
the
agent/selfhost-m3-emit-tu-runtime-stubs
branch
from
May 26, 2026 19:55
01fda97 to
89c794f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PHP_COMPILER_EMIT_HELPER_LINK+PHP_COMPILER_M3_EMIT_TU), route Runtime/Compiler spine symbols and the rest of the bundledlib/tree to LLVM stubs instead of PHP CFG lowering, which was segfaulting LLVM 9 during global ctor / PHPTypes init.Runtime::compile,parseAndCompile, and related spine methods used by the emit bridge.{main}with thin PHP CFG; keep the native emit path onBootstrapAot\*_m3_emitwith a nullRuntimehandle (noobject->allocateIR during link).Test plan
make bootstrap-selfhost-linkBOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smokeBOOTSTRAP_M3_LINK_COMPILE_DRIVER=1 BOOTSTRAP_M3_COMPILE_DRIVER_REAL_LOWERING=1 ./script/bootstrap-selfhost-runtime-compile-smoke.sh— emit helper link OK (8/8 repro)./script/bootstrap-selfhost-helloworld-probe.sh— emit helper link OK (native execute still partial until Batch A real lowering)Closes #2540
Made with Cursor