[PATCH] x86/headers: Fix (old) header file dependency bug in uapi/asm/sigcontext32.h

From: Ingo Molnar
Date: Thu Sep 03 2015 - 03:35:19 EST

Mikko Rapeli reported that the following standalone user-space header does not compile:

#include <asm/sigcontext32.h>

Due to undefined 'struct __fpx_sw_bytes' which is defined in asm/sigcontext.h.

The following header order works:

#include <asm/sigcontext.h>
#include <asm/sigcontext32.h>

and that's probably how everyone's been using these headers for the past decade or
so, but it's a legit header file dependency bug, so include asm/sigcontext.h in
sigcontext32.h to allow it to be built standlone.

Reported-by: Mikko Rapeli <mikko.rapeli@xxxxxx>
Cc: Andy Lutomirski <luto@xxxxxxxxxxxxxx>
Cc: Borislav Petkov <bp@xxxxxxxxx>
Cc: Brian Gerst <brgerst@xxxxxxxxx>
Cc: Denys Vlasenko <dvlasenk@xxxxxxxxxx>
Cc: H. Peter Anvin <hpa@xxxxxxxxx>
Cc: Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
Cc: Thomas Gleixner <tglx@xxxxxxxxxxxxx>
Cc: linux-kernel@xxxxxxxxxxxxxxx
Signed-off-by: Ingo Molnar <mingo@xxxxxxxxxx>
arch/x86/include/uapi/asm/sigcontext32.h | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/x86/include/uapi/asm/sigcontext32.h b/arch/x86/include/uapi/asm/sigcontext32.h
index ad1478c4ae12..ff7826c41a1c 100644
--- a/arch/x86/include/uapi/asm/sigcontext32.h
+++ b/arch/x86/include/uapi/asm/sigcontext32.h
@@ -3,6 +3,8 @@

#include <linux/types.h>

+#include <asm/sigcontext.h>
/* signal context for 32bit programs. */

#define X86_FXSR_MAGIC 0x0000

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/