[Buildroot] [PATCH] toolchain: improve musl check to support static toolchains

Thomas Petazzoni thomas.petazzoni at bootlin.com
Fri Jul 6 07:36:23 UTC 2018


Hello,

On Fri, 6 Jul 2018 00:25:11 +0200, Arnout Vandecappelle wrote:

>  Well, the most obvious indicator is the output of gcc -dumpmachine... Is there
> any reason why we wouldn't be able to treat that as reliable? AFAIU, hundreds of
> autotools package will fail if the dumpmachine tuple is not something sane...
> 
>  BTW, we do all these checks for libc etc., but we don't even check for the
> architecture... E.g. trying to use an arm compiler with BR2_armeb gives the
> rather unhelpful:
> 
> Cannot execute cross-compiler '.../opt/ext-toolchain/bin/armeb-linux-gcc.br_real'
> 
> So, if you're a little bit savvy, you notice that the toolchain prefix is wrong,
> so you set BR2_TOOLCHAIN_EXTERNAL_CUSTOM_PREFIX to arm-linux- instead of
> $(ARCH)-linux. And it all works! Happily generating little-endian binaries...
> 
>  Bottom line: perhaps we should just check the tuple. That way we check the
> arch, we check that it's a hosted linux toolchain, we check libc, and we can
> even check the ARM ABI, all in one fell swoop...

That's a good idea indeed.

Another thing I noticed is that we don't check the static/shared
capabilities of the toolchain. For example if you try to use a
static-only external toolchain, by you keep the default of
BR2_SHARED_LIBS=y, things don't work very well.

Best regards,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com



More information about the buildroot mailing list