blob: b9ef79f67424b0fd177261f7074baed263f324ee (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
From 95531dcc36c2453b9242e0de17b8fedb20ce48ca Mon Sep 17 00:00:00 2001
From: Adrian Reber <areber@redhat.com>
Date: Tue, 3 Mar 2026 06:29:53 +0000
Subject: [PATCH] rseq: use kernel rseq.h when glibc detects it
Compilation fails with the latest glibc-devel in Fedora rawhide.
Recent glibc conditionally includes the kernel's linux/rseq.h
when __GLIBC_HAVE_KERNEL_RSEQ is defined, but CRIU's own copy
of the rseq definitions does not account for this and conflicts
with the kernel header which has additional information.
Check if __GLIBC_HAVE_KERNEL_RSEQ is defined and if so include
the kernel header directly using angle brackets (which bypasses
-iquote and finds the real kernel header instead of CRIU's
copy). Otherwise fall back to CRIU's own definitions.
Generated with Claude Code (https://claude.ai/code)
Signed-off-by: Adrian Reber <areber@redhat.com>
---
criu/include/linux/rseq.h | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/criu/include/linux/rseq.h b/criu/include/linux/rseq.h
index 5ceefbf8e1..d7f81e9a2e 100644
--- a/criu/include/linux/rseq.h
+++ b/criu/include/linux/rseq.h
@@ -14,6 +14,16 @@
#include "common/config.h"
+/*
+ * If glibc detected that the kernel rseq.h header exists, include
+ * it directly using angle brackets (which bypasses -iquote and finds
+ * the real kernel header). Otherwise fall back to our own copy of
+ * the definitions.
+ */
+#ifdef __GLIBC_HAVE_KERNEL_RSEQ
+#include <linux/rseq.h>
+#else /* !__GLIBC_HAVE_KERNEL_RSEQ */
+
#ifdef CONFIG_HAS_NO_LIBC_RSEQ_DEFS
/*
* linux/rseq.h
@@ -45,6 +55,8 @@ enum rseq_cs_flags {
};
#endif /* CONFIG_HAS_NO_LIBC_RSEQ_DEFS */
+#endif /* !__GLIBC_HAVE_KERNEL_RSEQ */
+
/*
* Let's use our own definition of struct rseq_cs because some distros
* (for example Mariner GNU/Linux) declares this structure their-own way.
|