Skip to content

Commit 8580bed

Browse files
shiloongIngo Molnar
authored andcommitted
objtool: Fix ARCH=x86_64 build error
Building objtool with ARCH=x86_64 fails with: $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 that the command-line variable 'ARCH' cannot be overridden. It can be replaced by 'SRCARCH', which is defined in 'tools/scripts/Makefile.arch'. Signed-off-by: Shile Zhang <[email protected]> Signed-off-by: Josh Poimboeuf <[email protected]> Signed-off-by: Ingo Molnar <[email protected]> Reviewed-by: Kamalesh Babulal <[email protected]> Link: https://lore.kernel.org/r/d5d11370ae116df6c653493acd300ec3d7f5e925.1579543924.git.jpoimboe@redhat.com
1 parent 6ec14aa commit 8580bed

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

tools/objtool/Makefile

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
include ../scripts/Makefile.include
33
include ../scripts/Makefile.arch
44

5-
ifeq ($(ARCH),x86_64)
6-
ARCH := x86
7-
endif
8-
95
# always use the host compiler
106
HOSTAR ?= ar
117
HOSTCC ?= gcc
@@ -33,7 +29,7 @@ all: $(OBJTOOL)
3329

3430
INCLUDES := -I$(srctree)/tools/include \
3531
-I$(srctree)/tools/arch/$(HOSTARCH)/include/uapi \
36-
-I$(srctree)/tools/arch/$(ARCH)/include
32+
-I$(srctree)/tools/arch/$(SRCARCH)/include
3733
WARNINGS := $(EXTRA_WARNINGS) -Wno-switch-default -Wno-switch-enum -Wno-packed
3834
CFLAGS := -Werror $(WARNINGS) $(KBUILD_HOSTCFLAGS) -g $(INCLUDES) $(LIBELF_FLAGS)
3935
LDFLAGS += $(LIBELF_LIBS) $(LIBSUBCMD) $(KBUILD_HOSTLDFLAGS)

0 commit comments

Comments
 (0)