2020-09-04 15:32:36

by Julien Thierry

[permalink] [raw]
Subject: [PATCH v3 02/10] objtool: Make sync-check consider the target architecture

Do not take into account outdated headers unrelated to the build of the
current architecture.

Reviewed-by: Miroslav Benes <[email protected]>
Signed-off-by: Julien Thierry <[email protected]>
---
tools/objtool/Makefile | 2 +-
tools/objtool/sync-check.sh | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index 33d1e3ca8efd..20df5541ca43 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -64,7 +64,7 @@ export srctree OUTPUT CFLAGS SRCARCH AWK
include $(srctree)/tools/build/Makefile.include

$(OBJTOOL_IN): fixdep FORCE
- @$(CONFIG_SHELL) ./sync-check.sh
+ @$(CONFIG_SHELL) ./sync-check.sh $(SRCARCH)
@$(MAKE) $(build)=objtool

$(OBJTOOL): $(LIBSUBCMD) $(OBJTOOL_IN)
diff --git a/tools/objtool/sync-check.sh b/tools/objtool/sync-check.sh
index c9674877419c..07249900db1c 100755
--- a/tools/objtool/sync-check.sh
+++ b/tools/objtool/sync-check.sh
@@ -1,6 +1,9 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0

+TARGET_ARCH=$1
+
+if [ "$TARGET_ARCH" == "x86" ]; then
FILES="
arch/x86/include/asm/inat_types.h
arch/x86/include/asm/orc_types.h
@@ -12,6 +15,7 @@ arch/x86/include/asm/insn.h -I '^#include [\"<]\(asm/\)*inat.h[\">]'
arch/x86/lib/inat.c -I '^#include [\"<]\(../include/\)*asm/insn.h[\">]'
arch/x86/lib/insn.c -I '^#include [\"<]\(../include/\)*asm/in\(at\|sn\).h[\">]' -I '^#include [\"<]\(../include/\)*asm/emulate_prefix.h[\">]'
"
+fi

check_2 () {
file1=$1
--
2.21.3


2020-09-04 18:26:14

by Josh Poimboeuf

[permalink] [raw]
Subject: Re: [PATCH v3 02/10] objtool: Make sync-check consider the target architecture

On Fri, Sep 04, 2020 at 04:30:20PM +0100, Julien Thierry wrote:
> Do not take into account outdated headers unrelated to the build of the
> current architecture.
>
> Reviewed-by: Miroslav Benes <[email protected]>
> Signed-off-by: Julien Thierry <[email protected]>
> ---
> tools/objtool/Makefile | 2 +-
> tools/objtool/sync-check.sh | 4 ++++
> 2 files changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
> index 33d1e3ca8efd..20df5541ca43 100644
> --- a/tools/objtool/Makefile
> +++ b/tools/objtool/Makefile
> @@ -64,7 +64,7 @@ export srctree OUTPUT CFLAGS SRCARCH AWK
> include $(srctree)/tools/build/Makefile.include
>
> $(OBJTOOL_IN): fixdep FORCE
> - @$(CONFIG_SHELL) ./sync-check.sh
> + @$(CONFIG_SHELL) ./sync-check.sh $(SRCARCH)
> @$(MAKE) $(build)=objtool

SRCARCH is already exported by the Makefile, so should sync-check.sh
just check $SRCARCH directly (and error out if it doesn't exist)?

--
Josh