From: Fangrui Song <maskray@google.com>
To: Masahiro Yamada <masahiroy@kernel.org>
Cc: "Nick Desaulniers" <ndesaulniers@google.com>,
"Linux Kbuild mailing list" <linux-kbuild@vger.kernel.org>,
"Nathan Chancellor" <natechancellor@gmail.com>,
clang-built-linux <clang-built-linux@googlegroups.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Michal Marek" <michal.lkml@markovi.net>,
"Linux Doc Mailing List" <linux-doc@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
"Matthias Männich" <maennich@google.com>,
"Sandeep Patil" <sspatil@google.com>
Subject: Re: [PATCH] kbuild: support 'LLVM' to switch the default tools to Clang/LLVM
Date: Sun, 5 Apr 2020 20:14:42 -0700 [thread overview]
Message-ID: <20200406031442.2yrjtjp476qzjbqs@google.com> (raw)
In-Reply-To: <CAK7LNAS_SQg2nhJ8HKBTq3+dziGpaJZ87fOBRS-ZMdUpKGhX9Q@mail.gmail.com>
On 2020-04-06, Masahiro Yamada wrote:
>On Mon, Apr 6, 2020 at 8:55 AM 'Fangrui Song' via Clang Built Linux
><clang-built-linux@googlegroups.com> wrote:
>>
>> On 2020-04-06, Masahiro Yamada wrote:
>> >On Sat, Apr 4, 2020 at 3:24 AM Nick Desaulniers <ndesaulniers@google.com> wrote:
>> >>
>> >> On Thu, Apr 2, 2020 at 10:17 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>> >> >
>> >> > As Documentation/kbuild/llvm.rst implies, building the kernel with a
>> >> > full set of LLVM tools gets very verbose and unwieldy.
>> >> >
>> >> > Provide a single switch 'LLVM' to use Clang and LLVM tools instead of
>> >> > GCC and Binutils. You can pass LLVM=1 from the command line or as an
>> >> > environment variable. Then, Kbuild will use LLVM toolchains in your
>> >> > PATH environment.
>> >> >
>> >> > Please note LLVM=1 does not turn on the LLVM integrated assembler.
>> >> > You need to explicitly pass AS=clang to use it. When the upstream
>> >> > kernel is ready for the integrated assembler, I think we can make
>> >> > it default.
>> >>
>> >> Having this behavior change over time may be surprising. I'd rather
>> >> that if you want to not use the integrated assembler, you explicitly
>> >> negate it, or just don't use the LLVM=1 syntax, ie. `make CC=clang
>> >> LD=ld.lld ...`.
>> >>
>> >> We could modify how `-no-integrated-as` is chosen when LLVM=1.
>> >>
>> >> make LLVM=1 LLVMIA=0 ... # add `-no-integrated-as`
>> >> # what the flag is doesn't really matter to me, something shorter might be nice.
>> >> make LLVM=1 # use all LLVM tools
>> >>
>> >> Since we got rid of $(AS), it would be appropriate to remove/change it
>> >> there, since no one really relies on AS=clang right now. (We do have 1
>> >> of our 60+ CI targets using it, but we can also change that trivially.
>> >> So I think we have a lot of freedom to change how `-no-integrated-as`
>> >> is set.
>> >>
>> >> This could even be independent of this patch.
>> >
>> >
>> >I also thought a boolean flag is preferred.
>> >
>> >AS=clang will not live long anyway, and
>> >I hesitated to break the compatibility
>> >for the short-term workaround.
>> >
>> >But, if this is not a big deal, I can
>> >replace AS=clang with LLVMIA=1.
>>
>> My mere complaint is that it may be difficult to infer the intention (integrated
>> assembler) from the abbreviation "IA" in "LLVMIA" :/
>>
>> Something with "AS" in the name may be easier for a user to understand,
>> e.g. CLANG_AS or LLVM_AS.
>
>I see 'llvm-as' in my PATH,
>but it is a different kind of tool, right?
>(converter from LLVM assembler *.ll to LLVM bit code *.bc)
>
>So, I thought "LLVM_AS" might be confusing.
You are right. llvm-as converts a textual form of LLVM IR (.ll) to
a binary form bitcode (.bc). LLVM_AS is confusing. CLANG_AS/CLANGAS might be
suitable.
clang a.c '-###' => clang -cc1 # like gcc invokes cc1
clang a.s '-###' => clang -cc1as # this invokes the integrated assembler
next prev parent reply other threads:[~2020-04-06 3:14 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-04-03 5:17 [PATCH] kbuild: support 'LLVM' to switch the default tools to Clang/LLVM Masahiro Yamada
2020-04-03 8:57 ` Nathan Chancellor
2020-04-03 9:26 ` Masahiro Yamada
2020-04-03 18:23 ` Nick Desaulniers
2020-04-05 16:45 ` Masahiro Yamada
2020-04-05 23:55 ` Fangrui Song
2020-04-06 1:33 ` Masahiro Yamada
2020-04-06 3:14 ` Fangrui Song [this message]
2020-04-06 9:12 ` Sedat Dilek
2020-04-06 11:22 ` Matthias Maennich
2020-04-07 16:16 ` Masahiro Yamada
2020-04-07 17:01 ` Nick Desaulniers
2020-04-07 17:46 ` Masahiro Yamada
2020-04-07 17:53 ` Nick Desaulniers
2020-04-07 19:19 ` Fangrui Song
2020-04-08 1:23 ` Masahiro Yamada
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=20200406031442.2yrjtjp476qzjbqs@google.com \
--to=maskray@google.com \
--cc=clang-built-linux@googlegroups.com \
--cc=corbet@lwn.net \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maennich@google.com \
--cc=masahiroy@kernel.org \
--cc=michal.lkml@markovi.net \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=sspatil@google.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