From 8d32588077bdc390420cfa6946f407033a20d7a8 Mon Sep 17 00:00:00 2001 From: Mark Rutland Date: Tue, 4 Sep 2018 11:48:29 +0100 Subject: locking/atomics: Check generated headers are up-to-date Now that all the generated atomic headers are in place, it would be good to ensure that: a) the headers are up-to-date when scripting changes. b) developers don't directly modify the generated headers. To ensure both of these properties, let's add a Kbuild step to check that the generated headers are up-to-date. Signed-off-by: Mark Rutland Signed-off-by: Peter Zijlstra (Intel) Cc: linux-arm-kernel@lists.infradead.org Cc: catalin.marinas@arm.com Cc: Will Deacon Cc: linuxdrivers@attotech.com Cc: dvyukov@google.com Cc: Boqun Feng Cc: arnd@arndb.de Cc: aryabinin@virtuozzo.com Cc: glider@google.com Link: http://lkml.kernel.org/r/20180904104830.2975-6-mark.rutland@arm.com Signed-off-by: Ingo Molnar --- Kbuild | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) (limited to 'Kbuild') diff --git a/Kbuild b/Kbuild index 005304205482..47c9fe175bd9 100644 --- a/Kbuild +++ b/Kbuild @@ -6,7 +6,8 @@ # 2) Generate timeconst.h # 3) Generate asm-offsets.h (may need bounds.h and timeconst.h) # 4) Check for missing system calls -# 5) Generate constants.py (may need bounds.h) +# 5) check atomics headers are up-to-date +# 6) Generate constants.py (may need bounds.h) ##### # 1) Generate bounds.h @@ -72,7 +73,20 @@ missing-syscalls: scripts/checksyscalls.sh $(offsets-file) FORCE $(call cmd,syscalls) ##### -# 5) Generate constants for Python GDB integration +# 5) Check atomic headers are up-to-date +# + +always += old-atomics +targets += old-atomics + +quiet_cmd_atomics = CALL $< + cmd_atomics = $(CONFIG_SHELL) scripts/atomic/check-atomics.sh + +old-atomics: scripts/atomic/check-atomics.sh FORCE + $(call cmd,atomics) + +##### +# 6) Generate constants for Python GDB integration # extra-$(CONFIG_GDB_SCRIPTS) += build_constants_py -- cgit v1.2.3 From bdf37b4dd35d2517cadc10735cd33022da7df133 Mon Sep 17 00:00:00 2001 From: Borislav Petkov Date: Thu, 8 Nov 2018 20:41:28 +0100 Subject: locking/atomics: Fix out-of-tree build Building a kernel out of tree with: make O=/tmp/b oldconfig cd /tmp/b make gives this error: CALL /mnt/kernel/kernel/linux/scripts/atomic/check-atomics.sh /bin/bash: scripts/atomic/check-atomics.sh: No such file or directory make[3]: *** [/mnt/kernel/kernel/linux/./Kbuild:86: old-atomics] Error 127 make[3]: *** Waiting for unfinished jobs.... Make the command use the proper build prerequisite which is the absolute path to the script. Reported-by: Stephen Rothwell Signed-off-by: Borislav Petkov Cc: Boqun Feng Cc: Linus Torvalds Cc: Mark Rutland Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Will Deacon Cc: arnd@arndb.de Cc: aryabinin@virtuozzo.com Cc: catalin.marinas@arm.com Cc: dvyukov@google.com Cc: glider@google.com Cc: linux-arm-kernel@lists.infradead.org Cc: linuxdrivers@attotech.com Fixes: 8d32588077bd ("locking/atomics: Check generated headers are up-to-date") Link: http://lkml.kernel.org/r/20181108194128.13368-1-bp@alien8.de Signed-off-by: Ingo Molnar --- Kbuild | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Kbuild') diff --git a/Kbuild b/Kbuild index 47c9fe175bd9..780048056ac5 100644 --- a/Kbuild +++ b/Kbuild @@ -80,7 +80,7 @@ always += old-atomics targets += old-atomics quiet_cmd_atomics = CALL $< - cmd_atomics = $(CONFIG_SHELL) scripts/atomic/check-atomics.sh + cmd_atomics = $(CONFIG_SHELL) $< old-atomics: scripts/atomic/check-atomics.sh FORCE $(call cmd,atomics) -- cgit v1.2.3