aboutsummaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorEkaitz Zarraga <ekaitz@elenq.tech>2024-10-10 15:14:30 +0200
committerEfraim Flashner <efraim@flashner.co.il>2024-10-10 17:35:23 +0300
commit0a221730a46660d0fc84cf4f6bf65259688178e7 (patch)
tree4f27fa5cb00539cd2b2f610647cb7aee1b343777 /gnu
parent39df1ac928beeeb316980c5ecb5dfaae7053460d (diff)
downloadguix-0a221730a46660d0fc84cf4f6bf65259688178e7.tar
guix-0a221730a46660d0fc84cf4f6bf65259688178e7.tar.gz
gnu: lsof: Fix build with Linux 6.9
* gnu/packages/lsof.scm(lsof)[source]: Add patch. * gnu/packages/patches/lsof-compat-linux-6.9.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. Change-Id: I98b895ecaf1b952bfd33ea7ae3af70b1c39a0a94 Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk1
-rw-r--r--gnu/packages/lsof.scm3
-rw-r--r--gnu/packages/patches/lsof-compat-linux-6.9.patch67
3 files changed, 70 insertions, 1 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index 05a8716063..afff609501 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1739,6 +1739,7 @@ dist_patch_DATA = \
%D%/packages/patches/llvm-9-fix-scev-miscompilation.patch \
%D%/packages/patches/lm-sensors-hwmon-attrs.patch \
%D%/packages/patches/lsh-fix-x11-forwarding.patch \
+ %D%/packages/patches/lsof-compat-linux-6.9.patch \
%D%/packages/patches/lsof-fatal-test-failures.patch \
%D%/packages/patches/lua-CVE-2014-5461.patch \
%D%/packages/patches/lua-pkgconfig.patch \
diff --git a/gnu/packages/lsof.scm b/gnu/packages/lsof.scm
index 7d849c80b5..a6ac0306de 100644
--- a/gnu/packages/lsof.scm
+++ b/gnu/packages/lsof.scm
@@ -46,7 +46,8 @@
(file-name (git-file-name name version))
(sha256
(base32
- "1v32407al4j0hhcph95lv4xvr9h012lii29iyq41iwj39zwfavax"))))
+ "1v32407al4j0hhcph95lv4xvr9h012lii29iyq41iwj39zwfavax"))
+ (patches (search-patches "lsof-compat-linux-6.9.patch"))))
(build-system gnu-build-system)
(native-inputs (list automake
autoconf
diff --git a/gnu/packages/patches/lsof-compat-linux-6.9.patch b/gnu/packages/patches/lsof-compat-linux-6.9.patch
new file mode 100644
index 0000000000..a7c09c7ecf
--- /dev/null
+++ b/gnu/packages/patches/lsof-compat-linux-6.9.patch
@@ -0,0 +1,67 @@
+This commit adds the patch that fixes:
+<https://github.com/lsof-org/lsof/issues/317>
+
+The issue was triggering the following error in the `test` phase that
+resulted in a build failure in Linux 6.9 or higher:
+
+ FAIL: lib/dialects/linux/tests/case-20-pidfd-pid.bash
+
+
+From c1678e3f6e4b4d984cb3078b7bf0c9e24bedb8ca Mon Sep 17 00:00:00 2001
+From: Jiajie Chen <c@jia.je>
+Date: Fri, 17 May 2024 15:22:35 +0800
+Subject: [PATCH] [linux] Maintain original output for pidfd in linux 6.9
+
+---
+ 00DIST | 3 +++
+ lib/dialects/linux/dproc.c | 13 +++++++++++++
+ 2 files changed, 16 insertions(+)
+
+diff --git a/00DIST b/00DIST
+index d5a0349..9a29611 100644
+--- a/00DIST
++++ b/00DIST
+@@ -5605,6 +5605,9 @@ Supplement Regenerated the 4.04 distribution to correct a non-
+
+ [linux] Do not embed kernel version in CFLAGS (#314)
+
++ [linux] Linux 6.9 changed the pidfs appearence in procfs. Try
++ to maintain original output in lsof (#317)
++
+
+ Vic Abell <abe@purdue.edu>
+ July 14, 2018
+diff --git a/lib/dialects/linux/dproc.c b/lib/dialects/linux/dproc.c
+index cb6bb64..3a7a120 100644
+--- a/lib/dialects/linux/dproc.c
++++ b/lib/dialects/linux/dproc.c
+@@ -1273,6 +1273,10 @@ static int process_id(struct lsof_context *ctx, /* context */
+ #endif /* defined(HASEPTOPTS) */
+ if (rest && rest[0] == '[' && rest[1] == 'p')
+ fdinfo_mask |= FDINFO_PID;
++ else if (Lf->ntype == N_REGLR && rest && *rest && strcmp(pbuf, "pidfd") == 0) {
++ // https://github.com/lsof-org/lsof/issues/317
++ fdinfo_mask |= FDINFO_PID;
++ }
+
+ if ((av = get_fdinfo(ctx, pathi, fdinfo_mask, &fi)) &
+ FDINFO_POS) {
+@@ -1338,6 +1342,15 @@ static int process_id(struct lsof_context *ctx, /* context */
+ Lf->sf |= SELPTYINFO;
+ }
+ #endif /* defined(HASEPTOPTS) && defined(HASPTYEPT) */
++ else if (Lf->ntype == N_REGLR && rest && *rest && Lf->nm &&
++ strcmp(Lf->nm, "pidfd") == 0) {
++ // https://github.com/lsof-org/lsof/issues/317
++ // pidfd since Linux 6.9 becomes a regular file:
++ // /proc/PID/fd/FD -> pidfd:[INODE]
++ (void)snpf(rest, sizeof(pbuf) - (rest - pbuf),
++ "[pidfd:%d]", fi.pid);
++ enter_nm(ctx, rest);
++ }
+
+ if (Lf->sf)
+ link_lfile(ctx);
+--
+2.45.2
+