Re: [PATCH v6 3/3] Documentation/llvm: update CROSS_COMPILE inferencing
From: Nick Desaulniers
Date: Thu Aug 05 2021 - 14:29:18 EST
On Thu, Aug 5, 2021 at 11:27 AM Nick Desaulniers
> On Thu, Aug 5, 2021 at 6:58 AM Masahiro Yamada <masahiroy@xxxxxxxxxx> wrote:
> > On Tue, Aug 3, 2021 at 3:39 AM 'Nick Desaulniers' via Clang Built
> > Linux <clang-built-linux@xxxxxxxxxxxxxxxx> wrote:
> > > diff --git a/Documentation/kbuild/llvm.rst b/Documentation/kbuild/llvm.rst
> > > index b18401d2ba82..f8a360958f4c 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 linker.
> > Is there any place where we rely on --prefix
> > to search for the linker?
> > In general, the compiler stops after generating an object
> > since it is passed with the -c option.
> > The linking stage is separated.
> > In the old days, VDSO was an exceptional case
> > where $(CC) was used as the linker driver, but
> > commit fe00e50b2db8c60e4ec90befad1f5bab8ca2c800 fixed it.
> See my previous reply to Fangrui.
> To be more specific, I believe this is still a problem for ppc vdso.
> I had sent patches for that, but binutils 2.26 would crash (IIUC,
> newer GNU binutils are ok). See this thread:
> So "we'd prefer the linker was used as the driver, but there's at
> least one place I know of in the tree where that's not currently the
Also, I think the CC_CAN_LINK functionality also fits the bill.