Skip to content

Self-host M2/M5: shell_exec lowering for lib/AOT/Linker.php honest native link #2779

Description

@PurHur

Milestone

M2/M5 — honest execute for spine-linked Linker.php (parent #1492, #2514)

Problem

lib/AOT/Linker.php is already require_once in test/selfhost/compiler_lib_spine_smoke/main.php and passes M2 link (717/717). Inventory lint warns 14 class methods not lowered; runtime uses real shell_exec for clang discovery and link — currently satisfied via PHP_COMPILER_SELFHOST_AOT / external-method stubs, not honest lowering.

Without shell_exec (or documented external floor), M5 cannot trust native bin/compile.php to link arbitrary AOT output using only lib/AOT/Linker.php.

Scope

Path Work
lib/AOT/Linker.php :188, :209, :263, :267, :310, :320, :390 — shell_exec / command -v
lib/JIT/Call/ExternalMethod.php Runtime-resolved shell_exec if stub path
lib/JIT/SelfHostBuiltinPolicy.php Linker TU policy
lib/Compiler.php Any CFG gaps surfaced by -l lib/AOT/Linker.php

Repro

./script/docker-exec.sh -- bash -lc 'php bin/compile.php -l lib/AOT/Linker.php'
# Review warnings; run with PHP_COMPILER_SELFHOST_AOT=0 for honest lowering attempt

BOOTSTRAP_LIB_SPINE_SMOKE=1 ./script/bootstrap-selfhost-lib-spine-smoke-link.sh
# OK today via stubs — goal is honest execute without SELFHOST_AOT link-only mask

Gate: M2 make bootstrap-selfhost-lib-spine-smoke + future M5 native link step using compiled driver only.

Done when

  • php bin/compile.php -l lib/AOT/Linker.php with honest lowering policy passes without link-only stub mask, or
  • docs/self-host-target.md documents Linker.php as permanent external-clang floor with test asserting runtime behavior

Spine inventory row for lib/AOT/Linker.php shows 0 blockers in bootstrap-inventory.php --check.

Dependencies

#2514 (stale “excluded from spine” text — update/close after this lands)

Labels

self-host, bootstrap, IMPORTANT

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions