Re: Build regressions/improvements in v4.9-rc1

From: Thomas Petazzoni
Date: Wed Oct 19 2016 - 16:32:08 EST


On Wed, 19 Oct 2016 12:23:12 +0000, Alexey Brodkin wrote:

> > I tried building a new toolchain with buildroot, using the instructions
> > from last time, but the resulting toolchain doesn't relocate, ie. it has
> > hard-coded paths in it. Any ideas?
> Hm... that's strange - it used to work but doesn't work with newer Buildroot...
> Anyways if something very simple (i.e. with no extra libraries) works for you just go
> ahead and grab pre-built image that Thomas Petazzoni builds.
> That's the most recent one:
> If I'm not mistaken Thomas runs some post-processing script to make these toolchains
> relocatable.
> Maybe Thomas may comment on that and even maybe will share his post-processing technique
> so you'll be able to build your customized toolchain.

I simply have two patches on top of Buildroot to build the toolchains
available at :

- One patch that builds mpc, gmp and mpfr statically. This is needed
since the host tools are built with an absolute rpath, so once the
toolchain is moved, it can't find the host shared libraries that
have been built for it. Using static linking is a temporary
work-around, our idea is to fix the rpath to use relative path using
$ORIGIN. There are some patches from Samuel Martin doing this, we
have discussed them during the Buildroot Developers Meeting last
week-end, and we proposed to Samuel to investigate a slightly
different approach (namely add more features to the upstream
patchelf utility).

- One patch that fixes the toolchain wrapper logic so that it works
fine when the toolchain is moved out of the usr/ sub-directory. We
started discussing it during the meeting, but I got drowned into
other discussions, so we haven't had the time to get to the bottom
of it.

If people are interested, I can prepare a tutorial on how to build
re-usable and relocatable toolchains with Buildroot.

Best regards,

Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering