Skip to content

FTBFS php 8.5.6 with GCC 16 #22206

Closed

Description

@P3p111n0

Description

Hi,
when building php 8.5.6 with GCC 16, I get the following error:

[  220s] In file included from /home/abuild/rpmbuild/BUILD/php8-8.5.6-build/php-8.5.6/ext/opcache/jit/zend_jit.c:43:
[  220s] /home/abuild/rpmbuild/BUILD/php8-8.5.6-build/php-8.5.6/ext/opcache/jit/zend_jit.c: In function ‘zend_runtime_jit’:
[  220s] ext/opcache/jit/zend_jit_internal.h:215:70: error: cannot tail-call: caller uses setjmp
[  220s]   215 | # define ZEND_OPCODE_RETURN()                  ZEND_OPCODE_TAIL_CALL((zend_vm_opcode_handler_t)opline->handler)
[  220s]       |                                                                      ^
[  220s] ext/opcache/jit/zend_jit_internal.h:213:39: note: in definition of macro ‘ZEND_OPCODE_TAIL_CALL’
[  220s]   213 |                 ZEND_MUSTTAIL return (handler)(ZEND_OPCODE_HANDLER_ARGS_PASSTHRU); \
[  220s]       |                                       ^~~~~~~
[  220s] /home/abuild/rpmbuild/BUILD/php8-8.5.6-build/php-8.5.6/ext/opcache/jit/zend_jit.c:3140:9: note: in expansion of macro ‘ZEND_OPCODE_RETURN’
[  220s]  3140 |         ZEND_OPCODE_RETURN();
[  220s]       |         ^~~~~~~~~~~~~~~~~~
[  220s] make: *** [Makefile:2301: ext/opcache/jit/zend_jit.lo] Error 1
[  220s] make: *** Waiting for unfinished jobs....

I am aware of issue #21960, but the fix mentioned there doesn't work for me (the error above is with LTO disabled). Full build log attached.

build_nolto.log

PHP Version

PHP 8.5.6

Operating System

openSUSE Tumbleweed

Activity

  1. P3p111n0 commented on Jun 3, 2026

    @P3p111n0
    ContributorAuthor

    Building without -Werror=return-type fixes the build for me. Not really sure why.

  2. added a commit that references this issue on Jun 4, 2026
    39c6782
  3. henderkes commented on Jun 7, 2026

    @henderkes
    Contributor

    Does gcc support preserve_none musttails now? I'm confused why it would even take this path.

  4. P3p111n0 commented on Jun 8, 2026

    @P3p111n0
    ContributorAuthor

    Does gcc support preserve_none musttails now? I'm confused why it would even take this path.

    Yes, preserve_none support was added in GCC 16.

  5. petk commented on Jun 17, 2026

    @petk
    Member

    The linked pull request that should fix this has been merged to PHP-8.4 and up. Thanks!

  6. added a commit that references this issue on Jun 17, 2026
  7. arjendekorte commented on Jun 17, 2026

    @arjendekorte
    Contributor

    Even with the linked pull-request, the build still fails when --disable-gcc-global-regs is used.

  8. reopened this on Jun 17, 2026
  9. arjendekorte commented on Jun 18, 2026

    @arjendekorte
    Contributor

    Basically b0c7865 is a fix for the global register detection and is consistent with what is mentioned in #21960 so that the build is succesful with GCC 16 and --enable-gcc-global-regs.

    And shamanzpua@39c6782 will fix the build with GCC 16 and --disable-gcc-global-regs.

  10. P3p111n0 commented on Jun 22, 2026

    @P3p111n0
    ContributorAuthor

    If there are no performance side effects, then removing the musttail is certainly the simplest way to fix this. I opened a bug in the GCC bugzilla: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125874. The analysis on GCC might get more refined to the point that the removal of the musttail is not needed, though it is unclear if/when that's going to happen.

  11. added 2 commits that reference this issue on Aug 6, 2026
    5c3d09a
    d118828
  12. added a commit that references this issue on Aug 6, 2026
    9491846
  13. added a commit that references this issue on Aug 6, 2026
    2cb2846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions