linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Desaulniers <ndesaulniers@google.com>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
	Miguel Ojeda <ojeda@kernel.org>,
	Fangrui Song <maskray@google.com>,
	Michal Marek <michal.lkml@markovi.net>,
	Arnd Bergmann <arnd@kernel.org>,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	clang-built-linux@googlegroups.com,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	Christoph Hellwig <hch@infradead.org>,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [PATCH v3 2/2] Makefile: infer CROSS_COMPILE from SRCARCH for CC=clang LLVM_IAS=1
Date: Thu, 29 Jul 2021 17:19:03 -0700	[thread overview]
Message-ID: <CAKwvOdm0xs4ikb0K0_b8Az0T=Kxu_-6AHjWHOhjsKZb3hTrH2A@mail.gmail.com> (raw)
In-Reply-To: <44117d0c-51b7-1f68-f752-ba53de503b14@kernel.org>

On Thu, Jul 29, 2021 at 2:00 PM Nathan Chancellor <nathan@kernel.org> wrote:
>
> While I understand that the LLVM=1 LLVM_IAS=1 case works perfectly fine
> with this series, I am of the belief that making it work for CC=clang
> LLVM_IAS=1 is a mistake because there is no way for that configuration
> to work for cross compiling without CROSS_COMPILE.

So with v3 of this change, rather than:

$ ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang -j72

If you wanted to omit CROSS_COMPILE, you'd need:

$ ARCH=arm64 make CC=clang LLVM_IAS=1 LD=ld.lld OBJCOPY=llvm-objcopy
STRIP=llvm-strip

or

$ ARCH=arm64 make CC=clang LLVM_IAS=1 LD=aarch64-linux-gnu-ld
OBJCOPY=aarch64-linux-gnu-objcopy STRIP=aarch64-linux-gnu-strip

That's straight up worse IMO and defeats the purpose of "shortening
the command line," which should be the goal.  Not "making CC=clang
maximally flexible."  We don't want folks generally using CC=clang;
preferably they'd use LLVM=1.  I need to rewrite our docs to make that
more explicit and straightforward.  And if folks would prefer to use
CC=clang for whatever reason, let them explicitly state CROSS_COMPILE
then.

So I agree with Nathan, and hope Masahiro will reconsider that perhaps
the v2 variant that required LLVM=1 maybe makes more sense.

Either way, I need to fix the comment in the new script, commit
message, and docs, so v4 is necessary.

I'm tempted to add a rewrite of our docs to say "just use LLVM=1"
front and center, then get into finer grain details below, moving this
second patch to be the third in a series.  Let's see what Masahiro's
thoughts are though first. (I do appreciate them, even when I
disagree).
-- 
Thanks,
~Nick Desaulniers

  reply	other threads:[~2021-07-30  0:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 16:50 [PATCH v3 0/2] infer CROSS_COMPILE from SRCARCH for CC=clang LLVM_IAS=1 Nick Desaulniers
2021-07-29 16:50 ` [PATCH v3 1/2] Makefile: move initial clang flag handling into scripts/Makefile.clang Nick Desaulniers
2021-07-29 16:50 ` [PATCH v3 2/2] Makefile: infer CROSS_COMPILE from SRCARCH for CC=clang LLVM_IAS=1 Nick Desaulniers
2021-07-29 19:40   ` Arnd Bergmann
2021-07-29 21:00   ` Nathan Chancellor
2021-07-30  0:19     ` Nick Desaulniers [this message]
2021-07-30  6:50       ` Miguel Ojeda
2021-07-30 15:15       ` Masahiro Yamada
2021-07-30 15:10     ` 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='CAKwvOdm0xs4ikb0K0_b8Az0T=Kxu_-6AHjWHOhjsKZb3hTrH2A@mail.gmail.com' \
    --to=ndesaulniers@google.com \
    --cc=arnd@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=geert@linux-m68k.org \
    --cc=hch@infradead.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masahiroy@kernel.org \
    --cc=maskray@google.com \
    --cc=michal.lkml@markovi.net \
    --cc=nathan@kernel.org \
    --cc=ojeda@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).