[Buildroot] [PATCH] package/clang: default linker to GNU

Matthew Weber matthew.weber at rockwellcollins.com
Sun Oct 21 11:53:45 UTC 2018


Romain, Valentin,

On Sun, Oct 21, 2018 at 10:49 AM Romain Naour <romain.naour at gmail.com> wrote:
>
> Hi Matt,
>
> Adding Valentin in Cc.
>
> Le 21/10/2018 à 11:09, Matt Weber a écrit :
> > By default clang is assuming the system linker /usr/bin/ld.  This
> > patchset updates the default to point at the cross toolchain ld.
> >
> > Previously clang had been used on target only, this update is
> > required for host clang/clang++ to be used as a frontend for
> > cross-compiling.
>
> As we discuss during the meeting, we should probably wrap clang and clang++ in
> order to pass the path to the sysroot like we do in the toolchain wrapper for
> gcc (and other options when needed).

Since there isn't a package yet that has the need for this wrapper,
would it be something that we could add to toolchain/helpers.mk?
For this patch, maybe I just updated the commit message with and
example of how you'd call clang w/o the wrapper?

>
> >
> > Signed-off-by: Matthew Weber <matthew.weber at rockwellcollins.com>
> > ---
> >  package/clang/clang.mk | 3 ++-
> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >
> > diff --git a/package/clang/clang.mk b/package/clang/clang.mk
> > index 52e0b98..e2d4a08 100644
> > --- a/package/clang/clang.mk
> > +++ b/package/clang/clang.mk
> > @@ -42,7 +42,8 @@ CLANG_CONF_OPTS += -DCLANG_BUILD_TOOLS=ON
> >  HOST_CLANG_CONF_OPTS += \
> >       -DCLANG_BUILD_EXAMPLES=OFF \
> >       -DCLANG_INCLUDE_DOCS=OFF \
> > -     -DCLANG_INCLUDE_TESTS=OFF
> > +     -DCLANG_INCLUDE_TESTS=OFF \
> > +     -DCLANG_DEFAULT_LINKER=$(TARGET_LD)
>
> I would put it with this line:
> HOST_CLANG_CONF_OPTS += -DLLVM_CONFIG:FILEPATH=$(HOST_DIR)/bin/llvm-config
>

Sounds good.

> Otherwise:
> Reviewed-by: Romain Naour <romain.naour at gmail.com>
>
> Best regards,
> Romain
>
> >
> >  CLANG_CONF_OPTS += \
> >       -DCLANG_BUILD_EXAMPLES=OFF \
> >
>


-- 
Matthew L Weber / Pr Software Engineer
Airborne Information Systems / RC Linux Secure Platforms
MS 131-100, C Ave NE, Cedar Rapids, IA, 52498, USA
www.rockwellcollins.com

Note: Any Export License Required Information and License Restricted
Third Party Intellectual Property (TPIP) content must be encrypted and
sent to matthew.weber at corp.rockwellcollins.com.



More information about the buildroot mailing list