OSDN Git Service

x86/asm: Make <asm/asm.h> valid on cross-builds as well
authorIngo Molnar <mingo@kernel.org>
Thu, 13 May 2021 11:41:41 +0000 (13:41 +0200)
committerIngo Molnar <mingo@kernel.org>
Fri, 14 May 2021 06:50:28 +0000 (08:50 +0200)
commit41f45fb045bcc20e71eb705b361356e715682162
tree8686bfcdc92bf180c7127d6ba0a0c94f049245a8
parent9ddcb87b9218dec760e8d8a780bc8ad514c3d36a
x86/asm: Make <asm/asm.h> valid on cross-builds as well

Stephen Rothwell reported that the objtool cross-build breaks on
non-x86 hosts:

  > tools/arch/x86/include/asm/asm.h:185:24: error: invalid register name for 'current_stack_pointer'
  >   185 | register unsigned long current_stack_pointer asm(_ASM_SP);
  >       |                        ^~~~~~~~~~~~~~~~~~~~~

The PowerPC host obviously doesn't know much about x86 register names.

Protect the kernel-specific bits of <asm/asm.h>, so that it can be
included by tooling and cross-built.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Reviewed-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/include/asm/asm.h
tools/arch/x86/include/asm/asm.h