Skip to content

Commit

Permalink
x86/asm: Guard against building the 32/64-bit versions of the asm-off…
Browse files Browse the repository at this point in the history
…sets*.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>
  • Loading branch information
suryasaimadhu authored and Ingo Molnar committed Dec 11, 2014
1 parent f647d7c commit 5de2b61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions arch/x86/kernel/asm-offsets_32.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#ifndef __LINUX_KBUILD_H
# error "Please do not build this file directly, build asm-offsets.c instead"
#endif

#include <asm/ucontext.h>

#include <linux/lguest.h>
Expand Down
4 changes: 4 additions & 0 deletions arch/x86/kernel/asm-offsets_64.c
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
#ifndef __LINUX_KBUILD_H
# error "Please do not build this file directly, build asm-offsets.c instead"
#endif

#include <asm/ia32.h>

#define __SYSCALL_64(nr, sym, compat) [nr] = 1,
Expand Down

0 comments on commit 5de2b61

Please sign in to comment.