Skip to content

Self-host M5: native $argv bridge — BOOTSTRAP_M5_DRIVER_HOST_FULL_CLI segfault 139 #2794

Closed

Description

@PurHur

Milestone

M5 — native CLI/runtime parity for compiled driver (parent #1492)

Problem

docs/bootstrap-selfhost.md documents that M5 driver host link probe is currently only partial:

  • make bootstrap-selfhost-driver-host-compile → sidecar link OK, but full CLI (BOOTSTRAP_M5_DRIVER_HOST_FULL_CLI=1) hits an LLVM 9 segfault (exit 139) “until native $argv bridge”.

This blocks expanding the compiled-driver smoke into a real CLI-shaped self-host path (and makes cold-boot experiments in #2771 brittle).

Scope

  • lib/VM.php / lib/VM/Context.php / lib/Web/Superglobals.php: argv/argc ingest path (identify compiled-driver call chain)
  • lib/AOT/runtime/*.c: minimal runtime bridge for argv when running compiled bin/* entrypoints
  • src/cli_driver.php / bin/vm.php: CLI dispatch path that must work under native emit
  • Any existing bootstrap glue used by bootstrap-selfhost-driver-host-compile

Repro

# Documented partial gate:
./script/docker-exec.sh -- bash -lc 'make bootstrap-selfhost-driver-host-compile'

# Documented crash mode (expected today):
./script/docker-exec.sh -- bash -lc 'BOOTSTRAP_M5_DRIVER_HOST_FULL_CLI=1 make bootstrap-selfhost-driver-host-compile; echo exit:$?'
# exit:139 (segfault)

Done when

Labels

suggested: self-host, bootstrap, IMPORTANT

Links

#1492 · #2769 · #2771

Activity

  1. PurHur commented on May 27, 2026

    @PurHur
    OwnerAuthor

    Fixed in #2797: native argv bridge (jit_global_argv + DECLARE_GLOBAL binding).

  2. added a commit that references this issue on May 27, 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