You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ext/standard/JitEnv.php already calls NestedJIT GetenvJitHelper::putenv, but still emits ~50 LOC of inline libc LLVM (malloc/memcpy/strchr/setenv/free) via emitLibcPutenvMirror and a duplicate path in putenvFromCStringLiteral. That is a hand-written C ABI shortcut beside the PHP helper — same shape as closed rename/unlink defer migrations.
test/unit/PutenvRuntimeShrinkTest.php currently requiresemitLibcPutenvMirror to remain; flip that guard when the PHP path owns process-environ mirroring.
ext/standard/GetenvJitHelper.php — ensure putenv() (or a thin companion) also mirrors into process environ for libc getenv readers (AOT: fix request_parse_body compile/link (#5965) #17316), without JIT-side LibcExtern emission
ext/standard/JitEnv.php — delete emitLibcPutenvMirror; simplify putenvFromCStringLiteral to helper-only
test/unit/PutenvRuntimeShrinkTest.php — assert noemitLibcPutenvMirror / LibcExtern::register in JitEnv.php
Category
php-in-php· runtime-shrink (#1492, peer #19215 / #21023)Problem
ext/standard/JitEnv.phpalready calls NestedJITGetenvJitHelper::putenv, but still emits ~50 LOC of inline libc LLVM (malloc/memcpy/strchr/setenv/free) viaemitLibcPutenvMirrorand a duplicate path inputenvFromCStringLiteral. That is a hand-written C ABI shortcut beside the PHP helper — same shape as closed rename/unlink defer migrations.test/unit/PutenvRuntimeShrinkTest.phpcurrently requiresemitLibcPutenvMirrorto remain; flip that guard when the PHP path owns process-environ mirroring.php-src reference
PHP_FUNCTION(putenv)/ environ updatePHP implementation target
ext/standard/GetenvJitHelper.php— ensureputenv()(or a thin companion) also mirrors into process environ for libcgetenvreaders (AOT: fix request_parse_body compile/link (#5965) #17316), without JIT-sideLibcExternemissionext/standard/JitEnv.php— deleteemitLibcPutenvMirror; simplifyputenvFromCStringLiteralto helper-onlytest/unit/PutenvRuntimeShrinkTest.php— assert noemitLibcPutenvMirror/LibcExtern::registerinJitEnv.phpRepro
Done when
emitLibcPutenvMirrordeleted fromJitEnv.phpputenvFromCStringLiteralhas no inlinemalloc/setenvLLVMputenv→getenvsmoke prints1PutenvRuntimeShrinkTestgreen (guards absence of libc defer)make bootstrap-selfhost-vm-driver-execute-probegreenJitEnv.phpRefs #1492, #17316, #19215, #21023, #20499, #20644, #10533