[Buildroot] [RFC PATCH] package/libiberty: use the same version as binutils

John Keeping john at metanate.com
Wed Feb 23 16:39:15 UTC 2022


On Wed, Feb 23, 2022 at 04:17:32PM +0100, Yann E. MORIN wrote:
> Thomas, All,
> 
> On 2022-02-23 15:51 +0100, Thomas Petazzoni spake thusly:
> > On Wed, 23 Feb 2022 15:27:31 +0100
> > "Yann E. MORIN" <yann.morin.1998 at free.fr> wrote:
> > > Although this works, this is by pure chance: binutils is included before
> > > libiberty, so BINUTILS_VERSION is defined. But we try and avoid such a
> > > situation, unless we explicitly guarantee the include ordering (eg. gcc,
> > > fftw, util-linux, or previously, qt5).
> > > Instead, in such a case, we prefer that the version strin is duplicated,
> > > and a comment added above to note that both shoujld be updated in sync.
> > > See for example bluez5_utils and bluez5_utils-headers, mesa3d and
> > > mesa3d-headers.
> > libiberty/binutils is different than mesa3d or bluez5_utils, as the
> > version is user-selectable, or even different depending on the selected
> > CPU architecture.
> 
> Right, I forgot about that... But still, I don't like that we rely on
> the implied include order here, as we try and avoid that elsewhere...
> 
> > So we would have to replicate all the version selection logic (like we
> > admittedly do for linux vs. linux-headers).
> 
> That would not be very convenient and maintainable in the long run, as
> we update binutils to newer versions with various arch support changes:
> indeed, as we can see here, we'd eventually forget to update libibert in
> sync.
> 
> Unless we move libiberty as a sub-directory in pacage/binutils/libiberty/
> (like for util-linux-libs) to make it obvious that we need to share the
> version... That'd be my favourite option.

If we're doing that, should it be in gdb instead of binutils?

The gdb and binutils source all comes from the same repository but gdb
is the one package for which we actually use host-libiberty so tying
this in to the gdb version seems more sensible than using the binutils
version.

For example, given the default versions of binutils and gdb gives:

    $ git log --left-right --oneline binutils-2_36_1...gdb-10.2-release -- libiberty/
    > f42f69f6f38 libiberty: Support the new ("v0") mangling scheme in rust-demangle
    < d750c713c9a Update libiberty with latest sources from gcc mainline
    < f9a6a8f09dc PR27116, Spelling errors found by Debian style checker
    < 250d07de5cf Update year range in copyright notice of binutils files
    < d7b477c541b Sync libiberty and include with GCC for get_DW_UT_name.

so the GDB branch has a new feature (not included in the binutils
branch) whereas binutils has some updates not included for GDB.

It's a bit of a mess, but given where we need libiberty (for
prelink-cross) and what uses the package version (host-gdb) it looks
like it would make more sense to move this to the gdb package source.

What do you think?


John



More information about the buildroot mailing list