From 734f686ac4708abc1606a0661ce435d1a7851152 Mon Sep 17 00:00:00 2001 From: Peter Kokot Date: Sat, 2 Mar 2024 22:48:41 +0100 Subject: [PATCH] Simplify UFFDIO_WRITEPROTECT_MODE_WP Autoconf check (#13564) AC_CHECK_DECL can check whether preprocessor macro is defined in the given includes. --- sapi/phpdbg/config.m4 | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/sapi/phpdbg/config.m4 b/sapi/phpdbg/config.m4 index 0e4a24a5af7..a6b3a28f2d3 100644 --- a/sapi/phpdbg/config.m4 +++ b/sapi/phpdbg/config.m4 @@ -45,13 +45,7 @@ if test "$PHP_PHPDBG" != "no"; then AC_MSG_RESULT([disabled]) fi - AC_CACHE_CHECK([for userfaultfd faulting on write-protected memory support], ac_cv_phpdbg_userfaultfd_writefault, AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ - #include - #ifndef UFFDIO_WRITEPROTECT_MODE_WP - # error userfaults on write-protected memory not supported - #endif - ]])], [ac_cv_phpdbg_userfaultfd_writefault=yes], [ac_cv_phpdbg_userfaultfd_writefault=no])) - if test "$ac_cv_phpdbg_userfaultfd_writefault" = "yes"; then + AC_CHECK_DECL([UFFDIO_WRITEPROTECT_MODE_WP], [ if test "$enable_zts" != "yes"; then CFLAGS_SAVE="$CFLAGS" LIBS_SAVE="$LIBS" @@ -73,7 +67,7 @@ if test "$PHP_PHPDBG" != "no"; then else AC_DEFINE(HAVE_USERFAULTFD_WRITEFAULT, 1, [Whether faulting on write-protected memory support can be compiled for userfaultfd]) fi - fi + ],,[#include ]) PHP_SUBST(PHPDBG_EXTRA_LIBS)