Skip to content

Self-host: JIT/AOT process builtins for Linker (escapeshellarg, phpc_run_command) - #2786

Merged
PurHur merged 1 commit into
masterfrom
agent/selfhost-linker-process-lower
May 27, 2026
Merged

PurHur merged 1 commit into
masterfrom
agent/selfhost-linker-process-lower

Conversation

@PurHur

@PurHur PurHur commented May 27, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add real LLVM lowering for escapeshellarg() and phpc_run_command() via lib/AOT/runtime/phpc_process.c (__compiler_escapeshellarg, __compiler_phpc_run_command).
  • Route lib/AOT/Linker.php subprocess capture through phpc_run_command() so compiled spine bundles avoid unstubs for proc_open / stream_get_contents.
  • Keep Zend bin/compile.php link working with a narrow LinkerProcessPolyfill loaded only at emit time.

Closes #2779

Test plan

  • php bin/compile.php -l test/bootstrap-aot/linker_process_smoke.php
  • AOT link + run test/bootstrap-aot/linker_process_smoke.php (exit 0)
  • make bootstrap-selfhost-link
  • BOOTSTRAP_LIB_SPINE_SMOKE=1 make bootstrap-selfhost-lib-spine-smoke
  • PHPUnit InventoryBlockerLoweringTest + SelfHostBuiltinPolicyTest

Made with Cursor

Real lowering for escapeshellarg and phpc_run_command replaces proc_open in lib/AOT/Linker.php for compiled bundles; Zend compile keeps a narrow polyfill loaded from bin/compile.php.

Co-authored-by: Cursor <cursoragent@cursor.com>
@PurHur
PurHur merged commit ab90e44 into master May 27, 2026
@PurHur
PurHur deleted the agent/selfhost-linker-process-lower branch May 27, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant