Skip to content

Regression: AOT stream_isatty() link fails — undefined __compiler_stream_isatty (re-#6035, ext/standard/streamsfuncs.c) #27657

Description

@PurHur

Category

Regression · php-src-strict · AOT · pillar 4

Problem

VM/JIT stream_isatty(STDOUT) match Zend (false for non-TTY / harness). Thin AOT fails to link with undefined __compiler_stream_isatty — the symbol is declared in lib/JIT/Builtin/Type.php / JitStreamIsatty but not emitted into the linked object under helper-runtime cache. Prior #6035 closed VM registration only. Probed 2026-08-04 @ 4639761bd.

Repro Zend / VM / JIT AOT (phpc build)
stream_isatty(STDOUT) false (non-TTY) link error: undefined reference to __compiler_stream_isatty

php-src reference

PHP implementation target

  • Ensure __compiler_stream_isatty body is emitted/linked for thin AOT (ext/standard/StreamCapsJitHelper.php, JitStreamIsatty.php, lib/JIT/Builtin/StreamCaps*.php) — PHP-in-PHP; no new runtime/*.c
  • Prefer fixing helper-runtime / NestedJIT registration so the declared LLVM symbol has a real definition

Repro

./script/docker-exec.sh -- bash -lc '
cat > /tmp/isatty.php <<'"'"'PHP'"'"'
<?php
var_export(stream_isatty(STDOUT));
echo "\n";
PHP
php bin/vm.php /tmp/isatty.php
php bin/jit.php /tmp/isatty.php
php bin/compile.php -o /tmp/isatty.bin /tmp/isatty.php
'

Done when

  • AOT links and prints same as VM/JIT for STDOUT / php://memory (non-TTY → false)
  • stream_isatty(null) catchable TypeError under AOT (same message as VM)
  • Targeted repro/compliance guard; php-src-strict; no new C in runtime/

Gate context (same machine, 2026-08-04)

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-4:stdlibPhase 4 – stdlib for web appsstdlib

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions