From 1e2d53e1d86cb75e8f39b42b9a5c409e5d3261ed Mon Sep 17 00:00:00 2001 From: oli-ben <24815225-oli-ben@users.noreply.gitlab.com> Date: Wed, 27 Nov 2024 20:17:11 +0000 Subject: [PATCH] build-sys: Fix define of HAVE_PIDFD_OPEN Fix cross-compilation issues when using GCC-12.3 * configure fails to detect that the sysroot does support the pidfd_open syscall wrapper * configure fails to define HAVE_PIDFD_OPEN which is used in pgrep.c, so it fails building, because __NR_pidfd_open is then undefined Upstream: https://gitlab.com/procps-ng/procps/-/commit/587efb47df7ddbfda4e6abdd1e7792a2531a238f Signed-off-by: Scott Fan [Scott: backported to version 4.0.4] --- configure.ac | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 0719fcd1..6242a8f8 100644 --- a/configure.ac +++ b/configure.ac @@ -317,8 +317,8 @@ AC_ARG_ENABLE([pidwait], ) AM_CONDITIONAL(BUILD_PIDWAIT, test "x$enable_pidwait" = xyes) AC_MSG_CHECKING([for pidfd_open()]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[ [pidfd_open(1,1)]]])], - have_pidfd_open=yes; AC_MSG_RESULT([yes]) , +AC_LINK_IFELSE([AC_LANG_PROGRAM([], [[pidfd_open(1,1)]])], + have_pidfd_open=yes; AC_DEFINE(HAVE_PIDFD_OPEN, 1, [pidfd_open is defined]) AC_MSG_RESULT([yes]), have_pidfd_open=no; AC_MSG_RESULT([no]) ) -- 2.43.0