Skip to content

php-in-php: drop always-on LibcExtern strncasecmp after Object_ Type routes via __compiler_strncasecmp (#31655 shape) #31682

Description

@PurHur

Category

php-in-php · runtime-shrink (#1492, peer #31655 / #31519 / #15225)

Problem

Always-on LibcExtern still registers libc strncasecmp(3) even though:

  1. User-script strncasecmp() already routes through PHP (CaseCompareJitHelper / __compiler_strncasecmpphp-in-php: strcasecmp()/strncasecmp() JIT via CaseCompareJitHelper PHP — drop libc LLVM (#1492) #15225 / php-in-php: StringCaseCompare NestedJIT → JitVmHelperLink::ensureCompiled (#1492) #23862 / Regression: AOT password_hash(PASSWORD_BCRYPT) segfaults after build — VM/JIT match Zend (re-#26773, ext/standard/password.c) #26861).
  2. The sole NestedJIT lookupFunction('strncasecmp') consumer is lib/JIT/Builtin/Type/Object_::classIdFromRuntimeName, which already calls StringCaseCompare::ensureStrncasecmpLinked but then looks up libc strncasecmp (always-on) instead of the linked __compiler_strncasecmp ABI.
Symbol Sole lookupFunction consumer Target
strncasecmp Type/Object_::classIdFromRuntimeName call __compiler_strncasecmp (already ensured)
Path Today Target
User-script strncasecmp() CaseCompareJitHelper / __compiler_* unchanged
LibcExtern always-on strncasecmp drop row
Object_::classIdFromRuntimeName ensure CaseCompare + lookup libc strncasecmp ensure + lookup __compiler_strncasecmp

php-src reference

PHP implementation target

  • lib/JIT/Builtin/Type/Object_.php — lookup StringCaseCompare::ABI_STRNCASECMP
  • lib/JIT/LibcExtern.php — drop always-on 'strncasecmp' row
  • test/unit/LibcExternDeadDeclsRuntimeShrinkTest.php + StrcasecmpRuntimeShrinkTest.php guards

Done when

  • LibcExtern has no 'strncasecmp' => row
  • Object_.php looks up __compiler_strncasecmp (not libc strncasecmp)
  • User-script strncasecmp() still matches Zend via VM/JIT
  • No new lib/AOT/runtime/*.c
  • php-src-strict; no php-compiler-strict shortcut

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 / JITenhancementNew feature or requestimplementation-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