Skip to contentSkip to conversation

objtool: minor fixes

PATCH Applied Josh Poimboeuf 2 participants 7 messages Jan 20, 2020 – Jan 22, 2020 objtool

lore
Share & tools
lore
#5 lore raw

PATCH 3/3 objtool: Skip samples subdirectory

In reply to Josh Poimboeuf

The code in the 'samples' subdirectory isn't part of the kernel, so there's no need to validate it.

---
 samples/Makefile | 1 +
 1 file changed, 1 insertion(+)
samples/Makefile +1 -0
index a1848d674e9d..53867d9af971 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 # Makefile for Linux samples code
+OBJECT_FILES_NON_STANDARD := y
 
 obj-$(CONFIG_SAMPLE_ANDROID_BINDERFS)	+= binderfs/
 obj-$(CONFIG_SAMPLE_CONFIGFS)		+= configfs/
Signature · 1 line
2.21.1
#0 lore raw

cover objtool: minor fixes

Three minor fixes which help objtool integrate better with the kernel build.

Josh Poimboeuf (1):
objtool: Skip samples subdirectory

Olof Johansson (1):
objtool: Silence build output

Shile Zhang (1):
objtool: Fix ARCH=x86_64 build error

 samples/Makefile            | 1 +
 tools/objtool/Makefile      | 6 +-----
 tools/objtool/sync-check.sh | 2 --
 3 files changed, 2 insertions(+), 7 deletions(-)
Signature · 1 line
2.21.1
#3 lore raw

PATCH 2/3 objtool: Fix ARCH=x86_64 build error

From: Shile Zhang <[email protected]>

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'.

---
 tools/objtool/Makefile | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
tools/objtool/Makefile +1 -5
index d2a19b0bc05a..ee08aeff30a1 100644
@@ -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)
Signature · 1 line
2.21.1
#1 lore raw

PATCH 1/3 objtool: Silence build output

In reply to Josh Poimboeuf

From: Olof Johansson <[email protected]>

The sync-check.sh script prints out the path due to a "cd -" at the end of the script, even on silent builds. This isn't even needed, since the script is executed in our build instead of sourced (so it won't change the working directory of the surrounding build anyway).

Just remove the cd to make the build silent.

Fixes 2ffd84ae973b ("objtool: Update sync-check.sh from perf's check-headers.sh")
---
 tools/objtool/sync-check.sh | 2 --
 1 file changed, 2 deletions(-)
tools/objtool/sync-check.sh +0 -2
index 9bd04bbed01e..2a1261bfbb62 100755
@@ -48,5 +48,3 @@ check arch/x86/include/asm/inat.h     '-I "^#include [\"<]\(asm/\)*inat_types.h[
 check arch/x86/include/asm/insn.h     '-I "^#include [\"<]\(asm/\)*inat.h[\">]"'
 check arch/x86/lib/inat.c             '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"'
 check arch/x86/lib/insn.c             '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"'
-
-cd -
Signature · 1 line
2.21.1
merge bot Applied
#2 lore raw

[tip: core/urgent] objtool: Silence build output

The following commit has been merged into the core/urgent branch of tip:

The following commit has been merged into the core/urgent branch of tip:

Commit-ID:     6ec14aa7a58a1c2fb303692f8cb1ff82d9abd10a
Gitweb:        https://git.kernel.org/tip/6ec14aa7a58a1c2fb303692f8cb1ff82d9abd10a
Author:        Olof Johansson <[email protected]>
AuthorDate:    Mon, 20 Jan 2020 12:14:07 -06:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Wed, 22 Jan 2020 07:54:34 +01:00

objtool: Silence build output

The sync-check.sh script prints out the path due to a "cd -" at the end of the script, even on silent builds. This isn't even needed, since the script is executed in our build instead of sourced (so it won't change the working directory of the surrounding build anyway).

Just remove the cd to make the build silent.

---
 tools/objtool/sync-check.sh | 2 --
 1 file changed, 2 deletions(-)
tools/objtool/sync-check.sh +0 -2
index 9bd04bb..2a1261b 100755
@@ -48,5 +48,3 @@ check arch/x86/include/asm/inat.h     '-I "^#include [\"<]\(asm/\)*inat_types.h[
 check arch/x86/include/asm/insn.h     '-I "^#include [\"<]\(asm/\)*inat.h[\">]"'
 check arch/x86/lib/inat.c             '-I "^#include [\"<]\(../include/\)*asm/insn.h[\">]"'
 check arch/x86/lib/insn.c             '-I "^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]" -I "^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]"'
-
-cd -
merge bot Applied
#6 lore raw

[tip: core/urgent] objtool: Skip samples subdirectory

In reply to Josh Poimboeuf
The following commit has been merged into the core/urgent branch of tip:

The following commit has been merged into the core/urgent branch of tip:

Commit-ID:     8728497895794d1f207a836e02dae762ad175d56
Gitweb:        https://git.kernel.org/tip/8728497895794d1f207a836e02dae762ad175d56
Author:        Josh Poimboeuf <[email protected]>
AuthorDate:    Mon, 20 Jan 2020 12:14:09 -06:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Wed, 22 Jan 2020 07:55:02 +01:00

objtool: Skip samples subdirectory

The code in the 'samples' subdirectory isn't part of the kernel, so there's no need to validate it.

---
 samples/Makefile | 1 +
 1 file changed, 1 insertion(+)
samples/Makefile +1 -0
index 5ce50ef..f8f847b 100644
@@ -1,5 +1,6 @@
 # SPDX-License-Identifier: GPL-2.0
 # Makefile for Linux samples code
+OBJECT_FILES_NON_STANDARD := y
 
 obj-$(CONFIG_SAMPLE_ANDROID_BINDERFS)	+= binderfs/
 obj-$(CONFIG_SAMPLE_CONFIGFS)		+= configfs/
merge bot Applied
#4 lore raw

[tip: core/urgent] objtool: Fix ARCH=x86_64 build error

In reply to Josh Poimboeuf
The following commit has been merged into the core/urgent branch of tip:

The following commit has been merged into the core/urgent branch of tip:

Commit-ID:     8580bed7e751e6d4f17881e059daf3cb37ba4717
Gitweb:        https://git.kernel.org/tip/8580bed7e751e6d4f17881e059daf3cb37ba4717
Author:        Shile Zhang <[email protected]>
AuthorDate:    Mon, 20 Jan 2020 12:14:08 -06:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Wed, 22 Jan 2020 07:54:57 +01:00

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'.

---
 tools/objtool/Makefile | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)
tools/objtool/Makefile +1 -5
index d2a19b0..ee08aef 100644
@@ -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)