diff options
author | Borislav Petkov <bp@suse.de> | 2014-12-09 10:45:17 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2014-12-11 05:43:56 -0500 |
commit | 5de2b61a63f0982641eb00b9a6a9650f23487eaa (patch) | |
tree | f1361a739a91552a6a77dbe761bc43533b6783ed | |
parent | f647d7c155f069c1a068030255c300663516420e (diff) |
x86/asm: Guard against building the 32/64-bit versions of the asm-offsets*.c file directly
Sometimes it is helpful to build a kernel compilation unit
directly, i.e.:
make .../<filename>.i
in order to look at compiler output.
Since asm-offsets_{32,64}.c are included by asm-offsets.c and
building them directly doesn't evaluate the macros used (thus
making the preprocessor output not very useful), error out when
an attempt is made to build them. Issue a hint for the user to
build asm-offsets.c instead.
Suggested-by: Michael Matz <matz@suse.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Michal Marek <mmarek@suse.cz>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Link: http://lkml.kernel.org/r/1418139917-12722-1-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
-rw-r--r-- | arch/x86/kernel/asm-offsets_32.c | 4 | ||||
-rw-r--r-- | arch/x86/kernel/asm-offsets_64.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/arch/x86/kernel/asm-offsets_32.c b/arch/x86/kernel/asm-offsets_32.c index d67c4be3e8b1..3b3b9d33ac1d 100644 --- a/arch/x86/kernel/asm-offsets_32.c +++ b/arch/x86/kernel/asm-offsets_32.c | |||
@@ -1,3 +1,7 @@ | |||
1 | #ifndef __LINUX_KBUILD_H | ||
2 | # error "Please do not build this file directly, build asm-offsets.c instead" | ||
3 | #endif | ||
4 | |||
1 | #include <asm/ucontext.h> | 5 | #include <asm/ucontext.h> |
2 | 6 | ||
3 | #include <linux/lguest.h> | 7 | #include <linux/lguest.h> |
diff --git a/arch/x86/kernel/asm-offsets_64.c b/arch/x86/kernel/asm-offsets_64.c index e7c798b354fa..4c0c596dfb95 100644 --- a/arch/x86/kernel/asm-offsets_64.c +++ b/arch/x86/kernel/asm-offsets_64.c | |||
@@ -1,3 +1,7 @@ | |||
1 | #ifndef __LINUX_KBUILD_H | ||
2 | # error "Please do not build this file directly, build asm-offsets.c instead" | ||
3 | #endif | ||
4 | |||
1 | #include <asm/ia32.h> | 5 | #include <asm/ia32.h> |
2 | 6 | ||
3 | #define __SYSCALL_64(nr, sym, compat) [nr] = 1, | 7 | #define __SYSCALL_64(nr, sym, compat) [nr] = 1, |