The objtool build fails in a cross-compiled environment on a non-x86
host with "ARCH=x86_64":
tools/objtool/objtool-in.o: In function `decode_instructions':
tools/objtool/builtin-check.c:276: undefined reference to `arch_decode_instruction'
We could override the ARCH environment variable and change it back to
x86, similar to what the objtool Makefile was doing before; but it's
tricky to override environment variables consistently.
Instead, take a similar approach used by the Linux top-level Makefile
and introduce a SRCARCH Makefile variable which evaluates to "x86" when
ARCH is either "x86_64" or "x86".
Reported-by: Stephen Rothwell <firstname.lastname@example.org>
Signed-off-by: Josh Poimboeuf <email@example.com>
Cc: Andy Lutomirski <firstname.lastname@example.org>
Cc: H. Peter Anvin <email@example.com>
Cc: Peter Zijlstra <firstname.lastname@example.org>
Cc: Thomas Gleixner <email@example.com>
Link: http://lkml.kernel.org/r/20160722191920.ej62fnspnqurbaa7@trebleSigned-off-by: Arnaldo Carvalho de Melo <firstname.lastname@example.org>