lists.openwall.net   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  linux-cve-announce  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]
Message-ID: <e78c3b86-78ab-2b2e-d8be-e9118d7d2392@linuxfoundation.org>
Date:   Thu, 10 Dec 2020 17:31:55 -0700
From:   Shuah Khan <skhan@...uxfoundation.org>
To:     Andrew Delgadillo <adelg@...gle.com>,
        Nick Desaulniers <ndesaulniers@...gle.com>
Cc:     Shuah Khan <shuah@...nel.org>,
        Nathan Chancellor <natechancellor@...il.com>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        clang-built-linux <clang-built-linux@...glegroups.com>,
        Shuah Khan <skhan@...uxfoundation.org>
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
> <ndesaulniers@...gle.com> wrote:
>>
>> On Thu, Dec 3, 2020 at 2:10 PM Andrew Delgadillo <adelg@...gle.com> wrote:
>>>
>>> lib.mk 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 <adelg@...gle.com>
>>
>> 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.

thanks,
-- Shuah

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ