mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] objtool: use $(SRCARCH) to avoid compile error with ARCH=x86_64
@ 2019-12-27  2:29 Shile Zhang
  2020-01-03 12:48 ` Kamalesh Babulal
  2020-01-17 16:44 ` Josh Poimboeuf
  0 siblings, 2 replies; 3+ messages in thread
From: Shile Zhang @ 2019-12-27  2:29 UTC (permalink / raw)
  To: Josh Poimboeuf, Peter Zijlstra; +Cc: linux-kernel, Shile Zhang

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] objtool: use $(SRCARCH) to avoid compile error with ARCH=x86_64
  2019-12-27  2:29 [PATCH] objtool: use $(SRCARCH) to avoid compile error with ARCH=x86_64 Shile Zhang
@ 2020-01-03 12:48 ` Kamalesh Babulal
  2020-01-17 16:44 ` Josh Poimboeuf
  1 sibling, 0 replies; 3+ messages in thread
From: Kamalesh Babulal @ 2020-01-03 12:48 UTC (permalink / raw)
  To: Shile Zhang, Josh Poimboeuf, Peter Zijlstra; +Cc: linux-kernel

On 12/27/19 7:59 AM, Shile Zhang wrote:
> 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>

Reviewed-by: Kamalesh Babulal <kamalesh@linux.vnet.ibm.com>


-- 
Kamalesh


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] objtool: use $(SRCARCH) to avoid compile error with ARCH=x86_64
  2019-12-27  2:29 [PATCH] objtool: use $(SRCARCH) to avoid compile error with ARCH=x86_64 Shile Zhang
  2020-01-03 12:48 ` Kamalesh Babulal
@ 2020-01-17 16:44 ` Josh Poimboeuf
  1 sibling, 0 replies; 3+ messages in thread
From: Josh Poimboeuf @ 2020-01-17 16:44 UTC (permalink / raw)
  To: Shile Zhang; +Cc: Peter Zijlstra, linux-kernel

On Fri, Dec 27, 2019 at 10:29:31AM +0800, Shile Zhang wrote:
> 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>

Thanks.  I'll submit it to the -tip tree.

-- 
Josh


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-01-17 16:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-27  2:29 [PATCH] objtool: use $(SRCARCH) to avoid compile error with ARCH=x86_64 Shile Zhang
2020-01-03 12:48 ` Kamalesh Babulal
2020-01-17 16:44 ` Josh Poimboeuf

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®