Category
php-in-php · runtime-shrink (#1492, peer #31637 / #31606 / #31458)
Problem
Always-on LibcExtern still registers libc mkstemp(3) and memchr(3) even though the sole NestedJIT lookupFunction consumer (JitTempnamKernel::ensureLibc) already declares both module-locally. User-script tempnam() routes through PHP (TempnamJitHelper / StringTempnam / VmFsTempnam*) — not these always-on rows.
| Symbol |
Sole lookupFunction consumers |
Already module-local |
mkstemp |
JitTempnamKernel |
yes (ensureLibc) |
memchr |
JitTempnamKernel |
yes (ensureLibc) |
| Path |
Today |
Target |
User-script tempnam() |
PHP helpers (already) |
unchanged |
LibcExtern |
always-on mkstemp memchr |
drop both rows |
JitTempnamKernel |
ensureLibc already declares |
unchanged (cite this issue) |
| MCJIT host pin list |
McjitEmbedRuntime may keep memchr for reloc |
unchanged (not LibcExtern) |
php-src reference
PHP implementation target
lib/JIT/LibcExtern.php — drop 'mkstemp' and 'memchr' rows; cite this issue
ext/standard/JitTempnamKernel.php — cite this issue on the existing ensureLibc decls
test/unit/LibcExternDeadDeclsRuntimeShrinkTest.php — flip keep→drop for mkstemp; add memchr to deletedDecls
test/unit/TempnamRuntimeShrinkTest.php — assert kernel still looks up mkstemp after ensure
Repro / verify
./script/phpunit.sh --filter 'LibcExternDeadDeclsRuntimeShrinkTest|TempnamRuntimeShrinkTest|VmFsTouchTempnamRuntimeShrinkTest|StrrchrRuntimeShrinkTest'
./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r '\''$p=tempnam(sys_get_temp_dir(),"phpc"); echo is_string($p)?1:0; @unlink($p);'\'''
Done when
Category
php-in-php· runtime-shrink (#1492, peer #31637 / #31606 / #31458)Problem
Always-on
LibcExternstill registers libcmkstemp(3)andmemchr(3)even though the sole NestedJITlookupFunctionconsumer (JitTempnamKernel::ensureLibc) already declares both module-locally. User-scripttempnam()routes through PHP (TempnamJitHelper/StringTempnam/VmFsTempnam*) — not these always-on rows.lookupFunctionconsumersmkstempJitTempnamKernelensureLibc)memchrJitTempnamKernelensureLibc)tempnam()LibcExternmkstempmemchrJitTempnamKernelensureLibcalready declaresMcjitEmbedRuntimemay keepmemchrfor relocphp-src reference
ext/standard/file.c—PHP_FUNCTION(tempnam)(semantics stay in PHP; libc is thin ABI inside NestedJIT leaf only)PHP implementation target
lib/JIT/LibcExtern.php— drop'mkstemp'and'memchr'rows; cite this issueext/standard/JitTempnamKernel.php— cite this issue on the existingensureLibcdeclstest/unit/LibcExternDeadDeclsRuntimeShrinkTest.php— flip keep→drop formkstemp; addmemchrto deletedDeclstest/unit/TempnamRuntimeShrinkTest.php— assert kernel still looks up mkstemp after ensureRepro / verify
Done when
LibcExternhas no'mkstemp' =>or'memchr' =>rowJitTempnamKernel::ensureLibcstill declares both beforelookupFunctiontempnam()still works on VMLibcExternDeadDeclsRuntimeShrinkTest+TempnamRuntimeShrinkTestgreen