Stdlib AOT: link file_get_contents() for user-script standalone (#9308) - #16710
Merged
Merged
Conversation
…one (#9308) User-script AOT defers Type/String_.php helper emit (#13571), leaving __compiler_file_get_contents as an unresolved stub at link time. Register StringFileGetContents/StringReadfile in ensureMinimalUserStandaloneBodies, save/restore LLVM insertion during bridge emit, and restore the thin libc open/read bridge for minimal standalone AOT where nested PHP JIT is unavailable. php-src: ext/standard/streamsfuncs.c — php_stream_copy_to_mem Co-authored-by: Cursor <cursoragent@cursor.com>
Use __mm__free for chunk buffer teardown and pin REQUEST_METHOD= empty so AotTest does not inject GET (which tripped munmap on web refresh). Co-authored-by: Cursor <cursoragent@cursor.com>
PurHur
force-pushed
the
agent/stdlib-file-get-contents-aot-link
branch
from
July 6, 2026 02:00
f63d662 to
95db2ca
Compare
Owner
Author
Additional verification (2026-07-06)./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/aot/AotTest.php --filter "testCases with data set \"file_get_contents\""'
# OK (1 test, 5 assertions)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/unit/FileGetContentsRuntimeShrinkTest.php'
# OK (3 tests, 9 assertions)
./script/docker-exec.sh -- bash -lc 'source script/php-env.sh && vendor/bin/phpunit test/compliance/JITTest.php --filter file_get_contents'
# OK (9 tests, 9 assertions)Follow-up commit: Known remaining gap: |
This was referenced Jul 6, 2026
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
StringFileGetContents/StringReadfileinContext::ensureMinimalUserStandaloneBodies()so user-script AOT no longer fails link withundefined reference to __compiler_file_get_contentsStreamReadRuntime)open/readbridge (StringFileGetContentsLibc) for minimal standalone AOT whereType/String_.phpdefers nested PHP JIT (Release v1.1.0: fix examples 000–009 AOT smoke (exit 139 on 000-HelloWorld phpc build) #13571, php-in-php: __compiler_file_get_contents JIT via FileGetContentsJitHelper PHP — drop open/read LLVM (#1492) #15309)php-src reference
ext/standard/streamsfuncs.c—php_stream_copy_to_memVerification
Known gaps (not merge-ready)
vendor/bin/phpunit test/aot/AotTest.php --filter file_get_contents— links but PHPUnitproc_openrun aborts (munmap_chunk(): invalid pointer); directphp bin/compile.phppath is greenfile_get_contents_offsetAOT fixture — compile SIGSEGV; needs__compiler_file_put_contents+ offset slicereadfileAOT — still returns 0; needsStringReadfileLibcparityCloses #9308 when AOT fixtures above are green.
Made with Cursor