Skip to content

__builtin_cpu_init configure check relies on void return value #12273

Closed

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

Activity

  1. devnexen commented on Sep 22, 2023

    @devnexen
    Member

    Would you mind creating a PR ?

  2. added a commit that references this issue on Sep 22, 2023
    da2c4d1
  3. Freaky commented on Sep 22, 2023

    @Freaky
    ContributorAuthor

    Created as #12274. Looks like the return is superfluous.

  4. devnexen commented on Sep 23, 2023

    @devnexen
    Member

    Seeing what you've done in the bugzilla ticket, do you think it would be possible to make a more targeted version ? meaning still disabling ifunc for freebsd but release < 12 ? I think it would be good to have it here instead but just few months ago we had an user using freebsd 9.2.

  5. Freaky commented on Sep 23, 2023

    @Freaky
    ContributorAuthor

    I just created #12288.

  6. added 2 commits that reference this issue on Sep 24, 2023
    d93800e
    66a33db
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