[Buildroot] generic code with i7 bootlin toolchain?

stsp stsp2 at yandex.ru
Thu Nov 4 10:02:23 UTC 2021


Giulio Benetti <giulio.benetti at benettiengineering.com> wrote:
> Unfortunately some package(I would say many) has theirself a broken way to correctly pass external C/CXX/LDFLAGS.
> Usually they internally override some flag that makes null what we pass or worse they completely ignore them by using hard coded flags.
> To fix this specific problem we should go through every package and fix the package build system itself(a huge work).
I initially thought the same way.
But it seems to be after some more
investigation the other way:
$ file 
/home/stas/src/fdpp-buildroot/buildroot/output/host/bin/x86_64-linux-gcc
/home/stas/src/fdpp-buildroot/buildroot/output/host/bin/x86_64-linux-gcc: 
symbolic link to toolchain-wrapper
$ file 
/home/stas/src/fdpp-buildroot/buildroot/output/host/bin/toolchain-wrapper
/home/stas/src/fdpp-buildroot/buildroot/output/host/bin/toolchain-wrapper: 
ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, 
interpreter /lib64/ld-linux-x86-64.so.2, 
BuildID[sha1]=965fad722d4737f4373924e5b37b0973c0cd5f46, for GNU/Linux 
3.2.0, stripped

So it looks like buildroot creates
the toolchain-wrapper binary as
a replacement of gcc, and that
binary would invoke gcc (and
perhaps ccache too) with the
needed flags.
So such scheme should resist to
the "bad" packages you mention
because it doesn't rely on them
handling CFLAGS correctly.
There might be some other explanation
to the problem I see.

Thinking more about this - maybe
libgcc or some other lib from the
bootlin toolchain is over-optimized?
In that case I should ask at bootlin
perhaps instead...

Please CC me the replies if possible.




More information about the buildroot mailing list