toolchain/helpers: make sure we bail out when kernel headers check fails
authorThomas Petazzoni <thomas.petazzoni@bootlin.com>
Tue, 12 Nov 2019 20:21:17 +0000 (21:21 +0100)
committerYann E. MORIN <yann.morin.1998@free.fr>
Wed, 13 Nov 2019 21:39:53 +0000 (22:39 +0100)
In commit 6136765b23abd9faba610dd54ed276a777811575 ("toolchain:
generate check-headers program under $(BUILD_DIR)"), the
check_kernel_headers_version function was simplified to not check the
return value of the check-kernel-headers.sh script, assuming that
"make" does bail out on the first failing command.

However, check_kernel_headers_version when used in $(2)_CONFIGURE_CMDS
from pkg-toolchain-external.mk, is called in a sequence of commands,
where the return value of each command is not checked. Therefore, a
failure of check-kernel-headers.sh no longer aborts the build.

Since all other macros are using this principle of calling "exit 1",
we revert back to the same for check_kernel_headers_version, as it was
done prior to 6136765b23abd9faba610dd54ed276a777811575.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Cc: Carlos Santos <unixmania@gmail.com>
Reviewed-by: Carlos Santos <unixmania@gmail.com>
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
toolchain/helpers.mk

index 42e55220605a04bfcbbd9702177cd93ee5deccf8..996cc70d441b107b2df3df38d522da87aa3f234f 100644 (file)
@@ -163,7 +163,9 @@ copy_toolchain_sysroot = \
 # $3: kernel version string, in the form: X.Y
 #
 check_kernel_headers_version = \
-       support/scripts/check-kernel-headers.sh $(1) $(2) $(3)
+       if ! support/scripts/check-kernel-headers.sh $(1) $(2) $(3); then \
+               exit 1; \
+       fi
 
 #
 # Check the specific gcc version actually matches the version in the