summaryrefslogtreecommitdiffstats
path: root/meta/recipes-extended
diff options
context:
space:
mode:
authorRoss Burton <ross.burton@arm.com>2024-06-10 15:36:07 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-06-11 11:41:33 +0100
commit9f48761d686cf6f46e0906e1a09c318f5f4eb6c8 (patch)
tree99008dd7a0b77816335d90147d01369c5d85ead5 /meta/recipes-extended
parentd84084c1ec073592f2c80f4abdda811b35fdffe6 (diff)
downloadpoky-9f48761d686cf6f46e0906e1a09c318f5f4eb6c8.tar.gz
procps: fix build with new glibc but old kernel headers
If you're building procps with a newer glibc (with pidfd_open()) but older kernel headers (say 4.x, before __NR_pidfd_open) then procps will fail to build because of a typo in configure.ac. (From OE-Core rev: b1f522cd659af375828a61de1d0c06ad62398983) Signed-off-by: Ross Burton <ross.burton@arm.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-extended')
-rw-r--r--meta/recipes-extended/procps/procps/pidfd.patch42
-rw-r--r--meta/recipes-extended/procps/procps_4.0.4.bb1
2 files changed, 43 insertions, 0 deletions
diff --git a/meta/recipes-extended/procps/procps/pidfd.patch b/meta/recipes-extended/procps/procps/pidfd.patch
new file mode 100644
index 0000000000..23d1a3cd3e
--- /dev/null
+++ b/meta/recipes-extended/procps/procps/pidfd.patch
@@ -0,0 +1,42 @@
1From c8f625e085b8249cc009e8b19c3a19100217eb35 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@arm.com>
3Date: Thu, 25 Apr 2024 13:33:15 +0000
4Subject: [PATCH] Fix pidfd_open detection
5
6This check for pidfd_open uses AC_CHECK_FUNC which just runs the specified code, but
7src/pgrep.c checks HAVE_PIDFD_OPEN which will only be defined by AC_CHECK_FUNCS.
8
9Also pidfd_open is defined in sys/pidfd.h so that needs including.
10
11Upstream-Status: Submitted [https://gitlab.com/procps-ng/procps/-/merge_requests/229]
12Signed-off-by: Ross Burton <ross.burton@arm.com>
13---
14
15diff --git a/configure.ac b/configure.ac
16index fec27e3f..024731c7 100644
17--- a/configure.ac
18+++ b/configure.ac
19@@ -170,7 +170,7 @@ AC_TRY_COMPILE([#include <errno.h>],
20 AC_MSG_RESULT(yes),
21 AC_MSG_RESULT(no))
22
23-AC_CHECK_FUNC([pidfd_open], [enable_pidwait=yes], [
24+AC_CHECK_FUNCS([pidfd_open], [enable_pidwait=yes], [
25 AC_MSG_CHECKING([for __NR_pidfd_open])
26 AC_COMPILE_IFELSE([AC_LANG_SOURCE([
27 #include <sys/syscall.h>
28diff --git a/src/pgrep.c b/src/pgrep.c
29index d8e57dff..c5211aec 100644
30--- a/src/pgrep.c
31+++ b/src/pgrep.c
32@@ -44,7 +44,9 @@
33
34 #ifdef ENABLE_PIDWAIT
35 #include <sys/epoll.h>
36-#ifndef HAVE_PIDFD_OPEN
37+#ifdef HAVE_PIDFD_OPEN
38+#include <sys/pidfd.h>
39+#else
40 #include <sys/syscall.h>
41 #endif /* !HAVE_PIDFD_OPEN */
42 #endif
diff --git a/meta/recipes-extended/procps/procps_4.0.4.bb b/meta/recipes-extended/procps/procps_4.0.4.bb
index 789e0c2747..b02f74bd6b 100644
--- a/meta/recipes-extended/procps/procps_4.0.4.bb
+++ b/meta/recipes-extended/procps/procps_4.0.4.bb
@@ -14,6 +14,7 @@ inherit autotools gettext pkgconfig update-alternatives
14 14
15SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \ 15SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \
16 file://sysctl.conf \ 16 file://sysctl.conf \
17 file://pidfd.patch \
17 " 18 "
18SRCREV = "4ddcef2fd843170c8e2d59a83042978f41037a2b" 19SRCREV = "4ddcef2fd843170c8e2d59a83042978f41037a2b"
19 20