linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sedat Dilek <sedat.dilek@gmail.com>
To: Kalle Valo <kvalo@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	linux-toolchains@vger.kernel.org, llvm@lists.linux.dev
Subject: Re: Linux 6.3-rc3
Date: Wed, 22 Mar 2023 17:40:15 +0100	[thread overview]
Message-ID: <CA+icZUUYyqhV2HFzVtpi_KjBoYxjk7OB0UBVd2mX6abjmYhDjg@mail.gmail.com> (raw)
In-Reply-To: <87pm91uf9c.fsf@kernel.org>

On Wed, Mar 22, 2023 at 1:49 PM Kalle Valo <kvalo@kernel.org> wrote:
>
> Nathan Chancellor <nathan@kernel.org> writes:
>
> > On Mon, Mar 20, 2023 at 11:26:17AM -0700, Linus Torvalds wrote:
> >> On Mon, Mar 20, 2023 at 11:05 AM Nathan Chancellor <nathan@kernel.org> wrote:
> >> >
> >> > On the clang front, I am still seeing the following warning turned error
> >> > for arm64 allmodconfig at least:
> >> >
> >> >   drivers/gpu/host1x/dev.c:520:6: error: variable 'syncpt_irq' is uninitialized when used here [-Werror,-Wuninitialized]
> >> >           if (syncpt_irq < 0)
> >> >               ^~~~~~~~~~
> >>
> >> Hmm. I do my arm64 allmodconfig builds with gcc, and I'm surprised
> >> that gcc doesn't warn about this.
> >
> > Perhaps these would make doing allmodconfig builds with clang more
> > frequently less painful for you?
> >
> > https://lore.kernel.org/llvm/20230319235619.GA18547@dev-arch.thelio-3990X/
>
> Thank you, at least for me this is really helpful. I tried now clang for
> the first time but seeing a strange problem.
>
> I prefer to define the compiler in GNUmakefile so it's easy to change
> compilers and I don't need to remember the exact command line. So I have
> this in the top level GNUmakefile (all the rest commented out):
>
> LLVM=/opt/clang/llvm-16.0.0/bin/
>

Welcome to the LLVM/Clang world!

First try - First Cry...

In my build-environment I add (export) /path/to/llvm/bin to $PATH and
pass single CC LD AR etc. (what is substituted by LLVM=1):

make CC=clang LD=ld.lld AR=llvm-ar NM=llvm-nm STRIP=llvm-strip \
 OBJCOPY=llvm-objcopy OBJDUMP=llvm-objdump READELF=llvm-readelf \
 HOSTCC=clang HOSTCXX=clang++ HOSTAR=llvm-ar HOSTLD=ld.lld

Equivalent to:

make LLVM=1

I cannot comment on `make LLVM=/path/to/llvm/` and/or combinations
with `LLVM=1` as I have never used it

> If I run 'make oldconfig' it seems to use clang but after I run just
> 'make' it seems to switch back to the host GCC compiler and ask for GCC
> specific config questions again. Workaround for this seems to be adding
> 'export LLVM' to GNUmakefile, after that also 'make' uses clang as
> expected.
>

You have to pass `make LLVM=1` in any case... to `oldconfig` or when
adding any MAKEFLAGS like -j${number-of-available-cpus}.

Hope that helps.

Best regards,
-Sedat-

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/llvm.rst
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/kbuild/llvm.rst#n52

  parent reply	other threads:[~2023-03-22 16:41 UTC|newest]

Thread overview: 34+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-19 20:50 Linux 6.3-rc3 Linus Torvalds
2023-03-20  8:21 ` Build regressions/improvements in v6.3-rc3 Geert Uytterhoeven
2023-03-21  5:38   ` Build regressions/improvements in v6.3-rc3 (drm/msm/) Randy Dunlap
2023-03-21  7:34     ` Geert Uytterhoeven
2023-03-21 15:10       ` Randy Dunlap
2023-03-21 15:33         ` Geert Uytterhoeven
2023-03-20 18:05 ` Linux 6.3-rc3 Nathan Chancellor
2023-03-20 18:26   ` Linus Torvalds
2023-03-20 18:49     ` Linus Torvalds
2023-03-20 18:56       ` Nathan Chancellor
2023-03-20 19:05         ` Linus Torvalds
2023-03-20 18:53     ` Nathan Chancellor
2023-03-20 19:22       ` Nathan Chancellor
2023-03-22 12:44       ` Kalle Valo
2023-03-22 16:36         ` Nathan Chancellor
2023-03-22 20:36           ` Nathan Chancellor
2023-03-24 10:54           ` Kalle Valo
2023-03-24 15:11             ` Nathan Chancellor
2023-03-24 15:23               ` Kalle Valo
2023-03-28 19:07                 ` Nathan Chancellor
2023-03-29  8:39                   ` Kalle Valo
2023-03-22 16:40         ` Sedat Dilek [this message]
2023-03-22 16:55           ` Linus Torvalds
2023-03-22 18:17             ` Nick Desaulniers
2023-03-24 17:16             ` Masahiro Yamada
2023-03-27 16:12               ` Jani Nikula
2023-03-27 17:03                 ` Kalle Valo
2023-03-20 20:04     ` Guenter Roeck
2023-03-20 20:30       ` Linus Torvalds
2023-03-20 22:06         ` Nathan Chancellor
2023-03-20 22:48           ` Segher Boessenkool
2023-03-20 23:41           ` Linus Torvalds
2023-03-24  9:41   ` Daniel Vetter
2023-03-20 20:07 ` Guenter Roeck

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=CA+icZUUYyqhV2HFzVtpi_KjBoYxjk7OB0UBVd2mX6abjmYhDjg@mail.gmail.com \
    --to=sedat.dilek@gmail.com \
    --cc=airlied@gmail.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-toolchains@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=torvalds@linux-foundation.org \
    /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).