Skip to content

Self-host M3: helloworld_m3_emit execute — parseAndCompile returned null (HelloWorld emit TU) #2567

Closed

Description

@PurHur

Milestone

M3 — largest emit translation unit on the ladder (parent #1492 / #1937)

Problem

With M3 native emit flags, the HelloWorld emit helper links (build/selfhost-helloworld-emit) but strict execute fails:

helloworld_compile_smoke: parseAndCompile returned null (CFG/compile spine)
helloworld_compile_smoke: native emit failed at phase=parseAndCompile
bootstrap-selfhost-helloworld-probe: emit_path=zend_fallback_would_be_used

This TU calls Runtime::parseAndCompileEmitSmoke via the native spine symbol parseandcompileemitsmoke (see BootstrapCompileSmokeM3Emit.php). Smaller TUs fail the same way (#2559, #2561); fix the shared spine in #2563 first, then verify HelloWorld.

Scope

Module Path
Emit entry test/bootstrap-aot/helloworld_m3_emit_native_entry.php
Driver fixture test/bootstrap-aot/helloworld_compile_smoke.php
Probe script/bootstrap-selfhost-helloworld-probe.sh
Bridge lib/JIT/BootstrapCompileSmokeM3Emit.php (parseandcompileemitsmoke branch)
Runtime lib/Runtime.php — parseAndCompileEmitSmoke()

Repro

./script/docker-exec.sh -- bash -lc '
  source script/php-env.sh
  BOOTSTRAP_M3_LINK_COMPILE_DRIVER=1 \
  BOOTSTRAP_M3_COMPILE_DRIVER_REAL_LOWERING=1 \
  BOOTSTRAP_M3_RUNTIME_COMPILE=1 \
  BOOTSTRAP_M3_HELLOWORLD_STRICT=1 \
  ./script/bootstrap-selfhost-helloworld-probe.sh
'
# Today: exit 1, parseAndCompile returned null

Partial (Zend fallback allowed):

make bootstrap-selfhost-helloworld
# emit_path=zend partial; native run OK (Hello World)

Done when

Labels

suggested: self-host, bootstrap, IMPORTANT

Epic #1492 · Root fix #2563 · Smaller TUs #2559 · #2561 · Downstream #2540 (execute segfault if spine green)

Activity

  1. added 2 commits that reference this issue on May 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions