Skip to content

__builtin_cpu_init configure check relies on void return value #12273

Closed
@Freaky

Description

@Freaky

Description

Testing enabling ifunc support on FreeBSD, alongside having to remove the hardcoded check that disables it I also run into:

  checking for __builtin_cpu_init... no

return __builtin_cpu_init()? 1 : 0;

  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
    return __builtin_cpu_init()? 1 : 0;
  ]])], [

While this does technically appear to return int on gcc, it's documented as void __builtin_cpu_init (void), and indeed returns such on clang. Changing this to:

  AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[
    __builtin_cpu_init(); return 1;
  ]])], [

Results in a successful check and much faster addslashes, base64_encode, etc.

PHP Version

PHP 8.1.23

Operating System

FreeBSD 13.2-RELEASE

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