php-in-php: drop always-on LibcExtern printf (#31706) - #31708
Merged
Conversation
NestedJIT header/cookie/echo emitters declare printf(3) module-locally via ensurePrintf(); user-script printf() stays on JitPrintf / __compiler_printf. Co-authored-by: Cursor <cursoragent@cursor.com>
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
LibcExtern'printf'row after NestedJIT consumers declareprintf(3)module-locally viaLibcExtern::ensurePrintf().JitHeader,JitSetcookie,JitSessionStorageKernel(session Set-Cookie),ScriptExit::echoString.printf()unchanged (JitPrintf/__compiler_printf/printf_— Stdlib: printf() — formatted output to stdout (ext/standard/formatted_print.c parity) #3681).Closes #31706
C / always-on shrink
lib/JIT/LibcExtern.php(printf).lib/AOT/runtime/*.cstill empty (no new C).Test plan
./script/phpunit.sh --filter 'LibcExternDeadDeclsRuntimeShrinkTest|LibcNameCollisionRuntimeShrinkTest|PrintfBuiltinTest::testVm'→ OK (20 tests, 191 assertions)./script/docker-exec.sh -- bash -lc 'php bin/vm.php -r '\''printf("%s\n", "ok");'\'''→okphp bin/jit.php→okprintfnative binary still segfaults on master too (RUN:139) — not a regression from this drop;PrintfBuiltinTest::testAotNativeBinaryMatchesPhpSubsetpre-existingphp-src reference
ext/standard/formatted_print.c—PHP_FUNCTION(printf)(user-script semantics stay in PHP)Made with Cursor