lkml.org 
[lkml]   [2021]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v5 3/3] Documentation/llvm: update CROSS_COMPILE inferencing
On Fri, Jul 30, 2021 at 5:05 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> On Sat, Jul 31, 2021 at 8:12 AM Fangrui Song <maskray@google.com> wrote:
> >
> > On 2021-07-30, Nick Desaulniers wrote:
> > >+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

Perhaps it's just muscle memory from when I started working on Nexus
phone kernels ~5 years ago; that's how our build scripts invoked make
(with ARCH and CROSS_COMPILE as env vars).

IIRC, GNU make has the notion of `origin` for variables.
https://www.gnu.org/software/make/manual/html_node/Origin-Function.html
So "before `make`" would be "environment" and "after `make`" would be
"command line."

I'm rereading the section on assignment to see if one of the
assignment operators was affected by origin.
https://www.gnu.org/software/make/manual/html_node/Setting.html
https://www.gnu.org/software/make/manual/html_node/Flavors.html#Flavors

I could have sworn that due to one of the assignment operators
(perhaps `?=`) that the orderings weren't commutative.
$ make ARCH=arm64 LLVM=1 LLVM_IAS=1 -j72
works
$ ARCH=arm64 LLVM=1 LLVM_IAS=1 make -j72
also works. Hmm...maybe I misremembered the issue then.

Ok, I will reorder all instances to use the command line rather than
env vars in v6.
--
Thanks,
~Nick Desaulniers

\
 
 \ /
  Last update: 2021-08-02 20:30    [W:1.465 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site