[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNASSpc8JBivPGFSvxMdgh6+emwav9YPmnygrdPkX-Q1a+A@mail.gmail.com>
Date: Sat, 31 Jul 2021 09:04:13 +0900
From: Masahiro Yamada <masahiroy@...nel.org>
To: Fangrui Song <maskray@...gle.com>
Cc: Nick Desaulniers <ndesaulniers@...gle.com>,
Miguel Ojeda <ojeda@...nel.org>,
Michal Marek <michal.lkml@...kovi.net>,
Arnd Bergmann <arnd@...nel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
clang-built-linux <clang-built-linux@...glegroups.com>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Christoph Hellwig <hch@...radead.org>,
Linus Torvalds <torvalds@...ux-foundation.org>
Subject: Re: [PATCH v5 3/3] Documentation/llvm: update CROSS_COMPILE inferencing
On Sat, Jul 31, 2021 at 8:12 AM Fangrui Song <maskray@...gle.com> wrote:
>
> On 2021-07-30, Nick Desaulniers wrote:
> >As noted by Masahiro, document how we can generally infer CROSS_COMPILE
> >(and the more specific details about --target and --prefix) based on
> >ARCH.
> >
> >Suggested-by: Masahiro Yamada <masahiroy@...nel.org>
> >Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
> >---
> > Documentation/kbuild/llvm.rst | 17 +++++++++++++++++
> > 1 file changed, 17 insertions(+)
> >
> >diff --git a/Documentation/kbuild/llvm.rst b/Documentation/kbuild/llvm.rst
> >index b18401d2ba82..4292f0686316 100644
> >--- a/Documentation/kbuild/llvm.rst
> >+++ b/Documentation/kbuild/llvm.rst
> >@@ -63,6 +63,23 @@ They can be enabled individually. The full list of the parameters: ::
> > Currently, the integrated assembler is disabled by default. You can pass
> > ``LLVM_IAS=1`` to enable it.
> >
> >+Omitting CROSS_COMPILE
> >+----------------------
> >+
> >+As explained above, ``CROSS_COMPILE`` is used to set ``--target=<triple>``.
> >+
> >+Unless ``LLVM_IAS=1`` is specified, ``CROSS_COMPILE`` is also used to derive
> >+``--prefix=<path>`` to search for the GNU assembler.
>
> and the GNU linker.
>
> Reviewed-by: Fangrui Song <maskray@...gle.com>
>
> >+If ``CROSS_COMPILE`` is not specified, the ``--target=<triple>`` is inferred
> >+from ``ARCH``.
> >+
> >+That means if you use only LLVM tools, ``CROSS_COMPILE`` becomes unnecessary.
> >+
> >+For example, to cross-compile the arm64 kernel::
> >+
> >+ ARCH=arm64 make LLVM=1 LLVM_IAS=1
>
> Is ARCH=arm64 make LLVM=1 LLVM_IAS=1
>
> preferred over
>
> make ARCH=arm64 LLVM=1 LLVM_IAS=1
>
> ?
I do not think so.
For consistency,
make ARCH=arm64 LLVM=1 LLVM_IAS=1
or
ARCH=arm64 LLVM=1 LLVM_IAS=1 make
might be preferred.
But, in the same doc, I see an example, which
mixes up the env variables and a make variable.
ARCH=arm64 CROSS_COMPILE=aarch64-linux-gnu- make CC=clang
--
Best Regards
Masahiro Yamada
Powered by blists - more mailing lists