From: Shile Zhang <shile.zhang@linux.alibaba.com>
To: Josh Poimboeuf <jpoimboe@redhat.com>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-kernel@vger.kernel.org,
Shile Zhang <shile.zhang@linux.alibaba.com>
Subject: [PATCH] objtool: use $(SRCARCH) to avoid compile error with ARCH=x86_64
Date: Fri, 27 Dec 2019 10:29:31 +0800 [thread overview]
Message-ID: <20191227022931.142690-1-shile.zhang@linux.alibaba.com> (raw)
To build objtool with ARCH=x86_64 will failed as:
$make ARCH=x86_64 -C tools/objtool
...
CC arch/x86/decode.o
arch/x86/decode.c:10:22: fatal error: asm/insn.h: No such file or directory
#include <asm/insn.h>
^
compilation terminated.
mv: cannot stat ‘arch/x86/.decode.o.tmp’: No such file or directory
make[2]: *** [arch/x86/decode.o] Error 1
...
The root cause is the command-line variable 'ARCH' cannot be overridden.
It can be replaced by the one 'SRCARCH' defined in
'tools/scripts/Makefile.arch'.
Signed-off-by: Shile Zhang <shile.zhang@linux.alibaba.com>
---
tools/objtool/Makefile | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index d2a19b0bc05a..ee08aeff30a1 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -2,10 +2,6 @@
include ../scripts/Makefile.include
include ../scripts/Makefile.arch
-ifeq ($(ARCH),x86_64)
-ARCH := x86
-endif
-
# always use the host compiler
HOSTAR ?= ar
HOSTCC ?= gcc
@@ -33,7 +29,7 @@ all: $(OBJTOOL)
INCLUDES := -I$(srctree)/tools/include \
-I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \
- -I$(srctree)/tools/arch/$(ARCH)/include
+ -I$(srctree)/tools/arch/$(SRCARCH)/include
WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed
CFLAGS := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS)
LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)
--
2.24.0.rc2
next reply other threads:[~2019-12-27 2:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-27 2:29 Shile Zhang [this message]
2020-01-03 12:48 ` Kamalesh Babulal
2020-01-17 16:44 ` Josh Poimboeuf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191227022931.142690-1-shile.zhang@linux.alibaba.com \
--to=shile.zhang@linux.alibaba.com \
--cc=jpoimboe@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®