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
php/php-src main/streams/streams.c — stream handle lookup / _php_stream_get (reference only; this ABI is the compiler's FILE* handle table, not php-src C)
Category
php-in-php· runtime-shrink (#1492, peer #32273 malloc / #32092 snprintf / #31885 memcpy)Problem
Always-on
LibcExternstill registers__phpc_resolve_streamon every JIT/AOT module even though:StreamGlobalsJitstandalone /JitStreamLibcHandleKernelembed) — not a libc symbol and not an MCJIT host alias.JitStreamIoKernel/JitStreamSyncKernel) already declare the sameint8*(int64)prototype module-locally, thenlookupFunction. TheirensureExternalcatch path callsaddFunction()withoutgetNamedFunction()— the Fix: AOT link fails for EVERY binary — duplicate memset declaration #31894 / Release v1.1.0: fix cold-build-check compile_failed on hello world (LLVM Module.php line 180; re-#24302) #32122 class (name.1with no body).syscall/__phpc_host_*).__phpc_resolve_streamis leftover.StreamGlobalsJit/JitStreamLibcHandleKernelLibcExtern__phpc_resolve_streamrowaddFunctionLibcExtern::ensureResolveStreamDecl()before lookupsyscall/__phpc_host_*php-src reference
main/streams/streams.c— stream handle lookup /_php_stream_get(reference only; this ABI is the compiler's FILE* handle table, not php-src C)PHP implementation target
lib/JIT/LibcExtern.php— drop'__phpc_resolve_stream'always-on row; addensureResolveStreamDecl()(peerensureMallocFamilyphp-in-php: drop always-on LibcExtern malloc/realloc/free after NestedJIT module-local (#32092 shape) #32273 /ensureMemcpyDeclphp-in-php: drop always-on LibcExtern memcpy after NestedJIT module-local (#31863 shape) #31885) usinggetNamedFunction()firstJitStreamIoKernel/JitStreamSyncKernelcallensureResolveStreamDecl()beforelookupFunction('__phpc_resolve_stream')StreamGlobalsJit/JitStreamLibcHandleKernelkeep implementing the bodytest/unit/LibcExternDeadDeclsRuntimeShrinkTest.php+ dedicated shrink guardruntime/*.clogic (phpc_stream.calready deleted)Repro
./script/phpunit.sh --filter 'LibcExternDeadDeclsRuntimeShrinkTest|ResolveStreamRuntimeShrinkTest|StreamGlobalsRuntimeStandaloneTest'Done when
LibcExternhas no always-on'__phpc_resolve_stream' =>rowlookupFunction('__phpc_resolve_stream')sites callensureResolveStreamDecl()first__phpc_resolve_streamwith a body (StreamGlobalsRuntimeStandaloneTest)syscall/__phpc_host_php_write/__phpc_host_snprintfremain