public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Fix: rseq uapi: Adapt header includes to follow glibc header changes
@ 2023-10-25 21:48 Mathieu Desnoyers
  2023-10-26  1:05 ` Rik van Riel
  2023-10-27  7:53 ` kernel test robot
  0 siblings, 2 replies; 6+ messages in thread
From: Mathieu Desnoyers @ 2023-10-25 21:48 UTC (permalink / raw)
  To: Peter Zijlstra; +Cc: linux-kernel, Mathieu Desnoyers, Steven Rostedt

With "recent" glibc headers, using <sys/types.h> with __GNU_SOURCE fails
to have __u32 and others types needed by the rseq.h uapi header file.
Include ctype.h and asm/types.h to fix this. Add a __KERNEL__ #ifdef to
select the kernel vs userspace header includes.

Also, remove the now unneeded asm/byteorder.h include, since it also
causes its own build issues with "recent" glibc headers.

I'm cautiously using the term "recent" glibc here because I don't know
exactly in which glibc versions those changes happened. Steven
reproduced this issue with glibc 2.37 on Debian.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reported-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Cc: Peter Zijlstra (Intel) <peterz@infradead.org>
---
 include/uapi/linux/rseq.h | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/rseq.h b/include/uapi/linux/rseq.h
index c233aae5eac9..0f9cd8211ff0 100644
--- a/include/uapi/linux/rseq.h
+++ b/include/uapi/linux/rseq.h
@@ -10,8 +10,12 @@
  * Copyright (c) 2015-2018 Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
  */
 
-#include <linux/types.h>
-#include <asm/byteorder.h>
+#ifdef __KERNEL__
+# include <linux/types.h>
+#else
+# include <ctype.h>
+# include <asm/types.h>
+#endif
 
 enum rseq_cpu_id_state {
 	RSEQ_CPU_ID_UNINITIALIZED		= -1,
-- 
2.39.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-01 20:51 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-25 21:48 [PATCH] Fix: rseq uapi: Adapt header includes to follow glibc header changes Mathieu Desnoyers
2023-10-26  1:05 ` Rik van Riel
2023-10-27  7:53 ` kernel test robot
     [not found]   ` <81d2fd04-572d-48cd-bb5c-9a77937a79a0@efficios.com>
     [not found]     ` <20231027100641.52fbee5d@gandalf.local.home>
2023-11-01 20:10       ` Mathieu Desnoyers
2023-11-01 20:44         ` Steven Rostedt
2023-11-01 20:51           ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox