Skip to content

Fix: AOT link memcpy.1 undefined — duplicate decl peers of #31894 (lib/JIT/LibcExtern.php) #31910

Description

@PurHur

Category

Foundation · AOT link · sibling to #31894

Problem

#31894 fixed memset.1 duplicate declarations in GcCollectCyclesRuntime::ensureExternal(), but the same pattern remained in ObStorageLlvm, OutputRewriteVarsStorage, UrlRewriterApplyRuntime, StringSscanfByRef, StringZlibJit — each calling module->addFunction('memcpy', …) when lookupFunction() threw while LibcExtern already had memcpy in the MODULE.

Gate Before After fix
script/aot-smoke.sh (default helper cache) 0/8 — undefined reference to memcpy.1 8/8
php bin/compile.php -o /tmp/x test/repro/dom_xpath_relative_aot_31738.php link fail ok

Prelinked helper units referencing stale memcpy.1/memset.2 must be refreshed (IniJitHelper, AssertOptionsJitHelper, DomStandaloneAotInitJitHelper minimum).

php-src reference

N/A — compiler link infrastructure.

PHP implementation target

  • lib/JIT/LibcExtern.php — public ensureExternalDecl() (getNamedFunction-first)
  • Peer ensureExternal() helpers delegate to it
  • Refresh stale prelinked/helper-runtime/ units

Repro

./script/docker-exec.sh -- bash -lc './script/aot-smoke.sh'

Done when

  • aot-smoke 8/8 with committed prelinked tier (no local cache)
  • DOM AOT repro dom_xpath_relative_aot_31738.php links and runs

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:compilerCompiler / CFG / JITbugSomething isn't workingimplementation-readySpec complete: repro, php-src ref, done-when — safe for workers to claimphase-0:FoundationPhase 0 – foundation & DevEx

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions