Fix: AOT link memcpy.1 undefined — duplicate decl peers of #31894 (#31910) - #31911
Merged
Conversation
…1910) #31894 fixed memset versioning in GcCollectCyclesRuntime only. ObStorageLlvm, OutputRewriteVarsStorage, UrlRewriterApplyRuntime, StringSscanfByRef, and StringZlibJit still called addFunction('memcpy') when lookupFunction threw while LibcExtern already owned the module symbol — LLVM silently versioned to memcpy.N with no body and every default-cache AOT link failed. Add LibcExtern::ensureExternalDecl() (getNamedFunction-first) and delegate peer ensureExternal helpers. Refresh three prelinked helper units that embed the stale memcpy.1 references. Verified in php-compiler:22.04-dev: ./script/aot-smoke.sh → 8 passed, 0 failed (cold, no local helper cache) php bin/compile.php -o /tmp/x test/repro/dom_xpath_relative_aot_31738.php → ok maintainer_gap_dom_contains_null_aot_31791.php AOT → 0\n0 Co-authored-by: Cursor <cursoragent@cursor.com>
Closed
2 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::ensureExternalDecl()— getNamedFunction-first pattern from Fix: AOT link fails for EVERY binary — duplicate memset declaration #31894, shared by peerensureExternal()helpersmemcpy/memsetdeclarations that LLVM silently versioned tomemcpy.Nwith no bodymemcpy.1referencesCloses #31910
Context
#31894 fixed
memset.1inGcCollectCyclesRuntimeonly. Master still failedaot-smoke0/8 withundefined reference to memcpy.1when using the committed helper-runtime tier — blocking all DOM/XML AOT verification.Test plan
Verified in
php-compiler:22.04-devvia./script/docker-exec.sh:Not covered: full helper-runtime
--prelinksweep (409 units; only 3 refreshed).check-helper-runtime-prelink --strictreports 409 fresh, 1 unrelated stale (InfoJitHelper). Compliance suites not run.Made with Cursor