[Buildroot] Can we build static host tools (e.g. tar)?

Grant Edwards grant.b.edwards at gmail.com
Thu Jan 23 17:40:41 UTC 2025


On 2025-01-23, Arnout Vandecappelle via buildroot <buildroot at buildroot.org> wrote:

> On 14/01/2025 17:24, Grant Edwards wrote:
>> I'm having problems with the SDK that Buildroot builds.  Things like
>> opkg-build are failing because they're using buildroot's SDK version
>> of tar, and the glibc version isn't compatible between the host where
>> the sdk was built and the devleoper host where the sdk is being used.
>
>   The SDK is meant to be relocatable, but it is very hard to make it possible to 
> just run anywhere. Static linking can help but even with -static you may still 
> get a shared binary. So even if we do that, there's no guarantee that it will 
> work on another build machine.

Right, but it should reduce the areas that could cause problems
(though static binaries would probably end up being absurding large).

>   BTW I'm surprised you complain about tar - the compiler should have the same 
> issue, no?

The change that's tripping us up was at glibc 2.38.  So far, the only
change we've run into using the SDK that wasn't compatible was in
libacl, and the only thing that uses that in the SDK (at least for us)
is tar.

Our temporary work-around is to go into the sdk tree on the affected
hosts and replace 'tar' with a symlink to the host's native
tar. Eventually those hosts will get OS updates that will allow the
SDK's tar to work again.

--
Grant



More information about the buildroot mailing list