diff mbox series

[master,scarthgap] procps: fix build with new glibc but old kernel headers

Message ID 20240426104001.3076365-1-ross.burton@arm.com
State Superseded
Delegated to: Steve Sakoman
Headers show
Series [master,scarthgap] procps: fix build with new glibc but old kernel headers | expand

Commit Message

Ross Burton April 26, 2024, 10:40 a.m. UTC
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.

Signed-off-by: Ross Burton <ross.burton@arm.com>
---
 .../procps/procps/pidfd.patch                 | 25 +++++++++++++++++++
 meta/recipes-extended/procps/procps_4.0.4.bb  |  1 +
 2 files changed, 26 insertions(+)
 create mode 100644 meta/recipes-extended/procps/procps/pidfd.patch

Comments

Alexander Kanavin April 26, 2024, 11:05 a.m. UTC | #1
No pending patches please.

Alex

On Fri 26. Apr 2024 at 12.40, Ross Burton via lists.openembedded.org
<ross.burton=arm.com@lists.openembedded.org> wrote:

> 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.
>
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
>  .../procps/procps/pidfd.patch                 | 25 +++++++++++++++++++
>  meta/recipes-extended/procps/procps_4.0.4.bb  |  1 +
>  2 files changed, 26 insertions(+)
>  create mode 100644 meta/recipes-extended/procps/procps/pidfd.patch
>
> diff --git a/meta/recipes-extended/procps/procps/pidfd.patch
> b/meta/recipes-extended/procps/procps/pidfd.patch
> new file mode 100644
> index 00000000000..4c19043496b
> --- /dev/null
> +++ b/meta/recipes-extended/procps/procps/pidfd.patch
> @@ -0,0 +1,25 @@
> +From c8f625e085b8249cc009e8b19c3a19100217eb35 Mon Sep 17 00:00:00 2001
> +From: Ross Burton <ross.burton@arm.com>
> +Date: Thu, 25 Apr 2024 13:33:15 +0000
> +Subject: [PATCH] Fix pidfd_open detection
> +
> +This check for pidfd_open uses AC_CHECK_FUNC which just runs the
> specified code, but
> +src/pgrep.c checks HAVE_PIDFD_OPEN which will only be defined by
> AC_CHECK_FUNCS.
> +
> +Upstream-Status: Pending
> +Signed-off-by: Ross Burton <ross.burton@arm.com>
> +---
> +
> +diff --git a/configure.ac b/configure.ac
> +index fec27e3f..024731c7 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -170,7 +170,7 @@ AC_TRY_COMPILE([#include <errno.h>],
> +               AC_MSG_RESULT(yes),
> +               AC_MSG_RESULT(no))
> +
> +-AC_CHECK_FUNC([pidfd_open], [enable_pidwait=yes], [
> ++AC_CHECK_FUNCS([pidfd_open], [enable_pidwait=yes], [
> +   AC_MSG_CHECKING([for __NR_pidfd_open])
> +   AC_COMPILE_IFELSE([AC_LANG_SOURCE([
> + #include <sys/syscall.h>
> diff --git a/meta/recipes-extended/procps/procps_4.0.4.bb
> b/meta/recipes-extended/procps/procps_4.0.4.bb
> index 800384f22f7..ec8c4b0261b 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
>
>  SRC_URI = "git://
> gitlab.com/procps-ng/procps.git;protocol=https;branch=master \
>             file://sysctl.conf \
> +           file://pidfd.patch \
>             "
>  SRCREV = "4ddcef2fd843170c8e2d59a83042978f41037a2b"
>
> --
> 2.34.1
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#198721):
> https://lists.openembedded.org/g/openembedded-core/message/198721
> Mute This Topic: https://lists.openembedded.org/mt/105747722/1686489
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [
> alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
>
Ross Burton April 26, 2024, 4:58 p.m. UTC | #2
Hold this, v2 incoming.  It breaks on clang which exposes another problem with the current codeā€¦

Ross

> On 26 Apr 2024, at 11:40, Ross Burton via lists.openembedded.org <ross.burton=arm.com@lists.openembedded.org> wrote:
> 
> 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.
> 
> Signed-off-by: Ross Burton <ross.burton@arm.com>
> ---
> .../procps/procps/pidfd.patch                 | 25 +++++++++++++++++++
> meta/recipes-extended/procps/procps_4.0.4.bb  |  1 +
> 2 files changed, 26 insertions(+)
> create mode 100644 meta/recipes-extended/procps/procps/pidfd.patch
> 
> diff --git a/meta/recipes-extended/procps/procps/pidfd.patch b/meta/recipes-extended/procps/procps/pidfd.patch
> new file mode 100644
> index 00000000000..4c19043496b
> --- /dev/null
> +++ b/meta/recipes-extended/procps/procps/pidfd.patch
> @@ -0,0 +1,25 @@
> +From c8f625e085b8249cc009e8b19c3a19100217eb35 Mon Sep 17 00:00:00 2001
> +From: Ross Burton <ross.burton@arm.com>
> +Date: Thu, 25 Apr 2024 13:33:15 +0000
> +Subject: [PATCH] Fix pidfd_open detection
> +
> +This check for pidfd_open uses AC_CHECK_FUNC which just runs the specified code, but 
> +src/pgrep.c checks HAVE_PIDFD_OPEN which will only be defined by AC_CHECK_FUNCS.
> +
> +Upstream-Status: Pending
> +Signed-off-by: Ross Burton <ross.burton@arm.com>
> +---
> +
> +diff --git a/configure.ac b/configure.ac
> +index fec27e3f..024731c7 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -170,7 +170,7 @@ AC_TRY_COMPILE([#include <errno.h>],
> + AC_MSG_RESULT(yes),
> + AC_MSG_RESULT(no))
> + 
> +-AC_CHECK_FUNC([pidfd_open], [enable_pidwait=yes], [
> ++AC_CHECK_FUNCS([pidfd_open], [enable_pidwait=yes], [
> +   AC_MSG_CHECKING([for __NR_pidfd_open])
> +   AC_COMPILE_IFELSE([AC_LANG_SOURCE([
> + #include <sys/syscall.h>
> diff --git a/meta/recipes-extended/procps/procps_4.0.4.bb b/meta/recipes-extended/procps/procps_4.0.4.bb
> index 800384f22f7..ec8c4b0261b 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
> 
> SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \
>            file://sysctl.conf \
> +           file://pidfd.patch \
>            "
> SRCREV = "4ddcef2fd843170c8e2d59a83042978f41037a2b"
> 
> -- 
> 2.34.1
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#198721): https://lists.openembedded.org/g/openembedded-core/message/198721
> Mute This Topic: https://lists.openembedded.org/mt/105747722/6875888
> Group Owner: openembedded-core+owner@lists.openembedded.org
> Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [ross.burton@arm.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
diff mbox series

Patch

diff --git a/meta/recipes-extended/procps/procps/pidfd.patch b/meta/recipes-extended/procps/procps/pidfd.patch
new file mode 100644
index 00000000000..4c19043496b
--- /dev/null
+++ b/meta/recipes-extended/procps/procps/pidfd.patch
@@ -0,0 +1,25 @@ 
+From c8f625e085b8249cc009e8b19c3a19100217eb35 Mon Sep 17 00:00:00 2001
+From: Ross Burton <ross.burton@arm.com>
+Date: Thu, 25 Apr 2024 13:33:15 +0000
+Subject: [PATCH] Fix pidfd_open detection
+
+This check for pidfd_open uses AC_CHECK_FUNC which just runs the specified code, but 
+src/pgrep.c checks HAVE_PIDFD_OPEN which will only be defined by AC_CHECK_FUNCS.
+
+Upstream-Status: Pending
+Signed-off-by: Ross Burton <ross.burton@arm.com>
+---
+
+diff --git a/configure.ac b/configure.ac
+index fec27e3f..024731c7 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -170,7 +170,7 @@ AC_TRY_COMPILE([#include <errno.h>],
+ 		AC_MSG_RESULT(yes),
+ 		AC_MSG_RESULT(no))
+ 
+-AC_CHECK_FUNC([pidfd_open], [enable_pidwait=yes], [
++AC_CHECK_FUNCS([pidfd_open], [enable_pidwait=yes], [
+   AC_MSG_CHECKING([for __NR_pidfd_open])
+   AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+ #include <sys/syscall.h>
diff --git a/meta/recipes-extended/procps/procps_4.0.4.bb b/meta/recipes-extended/procps/procps_4.0.4.bb
index 800384f22f7..ec8c4b0261b 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
 
 SRC_URI = "git://gitlab.com/procps-ng/procps.git;protocol=https;branch=master \
            file://sysctl.conf \
+           file://pidfd.patch \
            "
 SRCREV = "4ddcef2fd843170c8e2d59a83042978f41037a2b"