linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuah Khan <skhan@linuxfoundation.org>
To: Nick Desaulniers <ndesaulniers@google.com>,
	Muhammad Usama Anjum <usama.anjum@collabora.com>
Cc: Gustavo Padovan <gus@collabora.com>,
	llvm@lists.linux.dev, kernelci@lists.linux.dev,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel@collabora.com, Mark Brown <broonie@kernel.org>,
	Justin Stitt <justinstitt@google.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Bill Wendling <morbo@google.com>,
	Shuah Khan <skhan@linuxfoundation.org>
Subject: Re: [Bug Report] selftests: Clang: kselftests build errors in KernelCI
Date: Thu, 4 Apr 2024 10:38:14 -0600	[thread overview]
Message-ID: <d84a8714-89e0-4ac0-b42c-02e8c4920e32@linuxfoundation.org> (raw)
In-Reply-To: <CAKwvOd=ueTmUThCOkBGUjhMGr6mKDtbTt-d7tHKe7A2nrchWMw@mail.gmail.com>

On 4/4/24 10:34, Nick Desaulniers wrote:
> Thanks for the report.  We've been tracking getting this working for a
> while: https://github.com/ClangBuiltLinux/linux/issues/1698.  Other
> fires have continued to take priority.
> 
> On Thu, Apr 4, 2024 at 9:30 AM Muhammad Usama Anjum
> <usama.anjum@collabora.com> wrote:
>>
>> Hi,
>>
>> We have caught bugs in kselftest suites on linux-next and on stable-RCs etc
>> when using clang. There are two types of bugs (logs with clang-17 are
>> attached.):
>> As usually people use GCC, there are GCC-specific flags added to the
>> Makefiles that clang doesn't recognize. For example:
>> * clang: error: argument unused during compilation: '-pie'
>> [-Werror,-Wunused-command-line-argument]
>> * clang: error: unknown argument '-static-libasan'; did you mean
>> '-static-libsan'?
>> * clang: error: cannot specify -o when generating multiple output files
>>
>> Clang has best static analysis tools. It is reporting static errors. For
>> example:
>> * test_execve.c:121:13: warning: variable 'have_outer_privilege' is used
>> uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
>> * test_execve.c:121:9: note: remove the 'if' if its condition is always true
>> * test_memcontrol.c:727:6: warning: variable 'fd' is used uninitialized
>> whenever 'if' condition is true [-Wsometimes-uninitialized]
>>
>> We have found these issues through our new KernelCI system when enabling
>> kselftest and clang there. The new system dashboard is a WIP, so It is not
>> the web dashboard you are used-to with in KernelCI. We can show you ways of
>> pulling the data if you are interest into.
>>
>> Unless the above is some sort of false-positive or misconfiguration, it
>> would be great to support clang for kselftests. What we can do from our
>> side is that clang kselftests builds should be enabled on KernelCI to find
>> and fix the errors. What is your stance about this?
> 
> As with anything kernel related; help send patches for obvious fixes.
> Or provide steps to reproduce in
> https://github.com/ClangBuiltLinux/linux/issues/1698.
> 

+1 on this. Please send patches to fixes as you find them. We have
been taking fixes found by clang and -Wformat-security, -Werror
checks.

thanks,
-- Shuah


      reply	other threads:[~2024-04-04 16:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-04 16:31 [Bug Report] selftests: Clang: kselftests build errors in KernelCI Muhammad Usama Anjum
2024-04-04 16:34 ` Nick Desaulniers
2024-04-04 16:38   ` Shuah Khan [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d84a8714-89e0-4ac0-b42c-02e8c4920e32@linuxfoundation.org \
    --to=skhan@linuxfoundation.org \
    --cc=broonie@kernel.org \
    --cc=gus@collabora.com \
    --cc=justinstitt@google.com \
    --cc=keescook@chromium.org \
    --cc=kernel@collabora.com \
    --cc=kernelci@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=usama.anjum@collabora.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).