lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  3 Dec 2020 22:10:05 +0000
From:   Andrew Delgadillo <>
To:     Shuah Khan <>
Cc:     Nathan Chancellor <>,
        Nick Desaulniers <>,,,,
        Andrew Delgadillo <>
Subject: [PATCH] selftests: propagate CC to selftest submakes defaults to gcc when CC is not set. When building selftests
as part of a kernel compilation, MAKEFLAGS is cleared to allow implicit
build rules to be used. This has the side-effect of clearing the CC
variable, which will cause selftests to be built with gcc regardless of
if we are using gcc or clang. To remedy this, propagate the CC variable
when clearing makeflags to ensure the correct compiler is used.

Signed-off-by: Andrew Delgadillo <>
 tools/testing/selftests/Makefile | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/Makefile b/tools/testing/selftests/Makefile
index d9c283503159..a4dd6d7e8276 100644
--- a/tools/testing/selftests/Makefile
+++ b/tools/testing/selftests/Makefile
@@ -90,10 +90,12 @@ FORCE_TARGETS ?=
 # Clear LDFLAGS and MAKEFLAGS when implicit rules are missing.  This provides
 # implicit rules to sub-test Makefiles which avoids build failures in test
-# Makefile that don't have explicit build rules.
+# Makefile that don't have explicit build rules. Since defaults to
+# using gcc for compilation when the CC variable is not set, we propagate the
+# CC variable so if clang is being used, selftests will build with clang.
 ifeq (,$(LINK.c))
 override LDFLAGS =
-override MAKEFLAGS =
+override MAKEFLAGS = CC=$(CC)
 # Append kselftest to KBUILD_OUTPUT and O to avoid cluttering

Powered by blists - more mailing lists