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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 10 Dec 2020 17:31:55 -0700
From:   Shuah Khan <>
To:     Andrew Delgadillo <>,
        Nick Desaulniers <>
Cc:     Shuah Khan <>,
        Nathan Chancellor <>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        LKML <>,
        clang-built-linux <>,
        Shuah Khan <>
Subject: Re: [PATCH] selftests: propagate CC to selftest submakes

On 12/10/20 5:10 PM, Andrew Delgadillo wrote:
> On Thu, Dec 10, 2020 at 3:08 PM Nick Desaulniers
> <> wrote:
>> On Thu, Dec 3, 2020 at 2:10 PM Andrew Delgadillo <> wrote:
>>> 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 <>
>> Hi Andrew, thanks for the patch. Can you walk me through how to build
>> the selftests?
>> Documentation/dev-tools/kselftest.rst says:
>> $ make -C tools/testing/selftests
>> And if I do:
>> $ make CC=clang defconfig
>> $ make CC=clang -C tools/testing/selftests -j
>> I observe a spew of errors.  If I apply your patch and rerun the
>> above, I see what looks like the same spew of errors.  Am I "holding
>> it wrong" or could the docs use a refresh?
> Hi Nick, sure thing!
> I also see a slew of errors when building with make -C
> tools/testing/selftests. However, that is not the problem I am trying
> to solve. I believe we are seeing errors building that way because it
> is missing some make variables that are normally set up when building
> from the kernel's top level makefile.

Both options are supported and should work.

make -C tools/testing/selftests
make kselftest

That being said, I use gcc. Can you send the errors you are seeing?
It is possible, a few tests aren't building and need to be fixed
for clang and gcc.

-- Shuah

Powered by blists - more mailing lists