Skip to content

Simplify prctl and procctl Autoconf checks #13450

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 0 additions & 26 deletions build/php.m4
Original file line number Diff line number Diff line change
Expand Up @@ -2679,32 +2679,6 @@ AC_DEFUN([PHP_PATCH_CONFIG_HEADERS], [
> $srcdir/$1.tmp && mv $srcdir/$1.tmp $srcdir/$1
])

dnl Check if we have prctl
AC_DEFUN([PHP_CHECK_PRCTL],
[
AC_MSG_CHECKING([for prctl])

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/prctl.h>]], [[prctl(0, 0, 0, 0, 0);]])], [
AC_DEFINE([HAVE_PRCTL], 1, [do we have prctl?])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
])

dnl Check if we have procctl
AC_DEFUN([PHP_CHECK_PROCCTL],
[
AC_MSG_CHECKING([for procctl])

AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/procctl.h>]], [[procctl(0, 0, 0, 0);]])], [
AC_DEFINE([HAVE_PROCCTL], 1, [do we have procctl?])
AC_MSG_RESULT([yes])
], [
AC_MSG_RESULT([no])
])
])

dnl
dnl PHP_CHECK_AVX512_SUPPORTS
dnl
Expand Down
9 changes: 4 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,6 @@ sys/file.h \
sys/mman.h \
sys/mount.h \
sys/poll.h \
sys/procctl.h \
sys/resource.h \
sys/select.h \
sys/socket.h \
Expand Down Expand Up @@ -515,10 +514,6 @@ dnl Check __builtin_cpu_supports
PHP_CHECK_BUILTIN_CPU_SUPPORTS
dnl Check __builtin_frame_address
PHP_CHECK_BUILTIN_FRAME_ADDRESS
dnl Check prctl
PHP_CHECK_PRCTL
dnl Check procctl
PHP_CHECK_PROCCTL
dnl Check AVX512
PHP_CHECK_AVX512_SUPPORTS
dnl Check AVX512 VBMI
Expand Down Expand Up @@ -643,6 +638,10 @@ AC_CHECK_FUNC([inet_pton],,[AC_MSG_ERROR([Required inet_pton not found.])])
dnl Check for strerror_r, and if its a POSIX-compatible or a GNU specific version.
AC_FUNC_STRERROR_R

dnl Check for functions inside their belonging headers.
AC_CHECK_HEADER([sys/prctl.h], [AC_CHECK_FUNCS([prctl])])
AC_CHECK_HEADER([sys/procctl.h], [AC_CHECK_FUNCS([procctl])])

AX_FUNC_WHICH_GETHOSTBYNAME_R

dnl Some systems (like OpenSolaris) do not have nanosleep in libc.
Expand Down
2 changes: 1 addition & 1 deletion ext/opcache/shared_alloc_mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#endif

#include "zend_execute.h"
#ifdef HAVE_SYS_PROCCTL_H
#ifdef HAVE_PROCCTL
#include <sys/procctl.h>
#endif

Expand Down