Skip to contentSkip to conversation

package/libiberty: use the same version as binutils

RFC PATCH In review John Keeping 3 participants 5 messages Feb 23, 2022

lore
Share & tools
lore
#0 lore raw

RFC PATCH 1/1 package/libiberty: use the same version as binutils

libiberty is built from the binutils source but this package has languished on version 2.32 while the binutils package now uses 2.36.1 by default.

Even between the 2.32 version and GDB 10.2 which is the default (and where host-libiberty is used instead of a version bundled in the GDB source) there are memory leak fixes and several improvements to demangling.

Update the libiberty package to simply use the same version as binutils so that there is no need to remember to update this package in the future. Replace the .hash file with a symlink so that the binutils hashes are used automatically.

---
I'm not sure if this is this is the best way to improve the situation here - it's the smallest change to get something a bit more modern (in most circumstances), but I wonder if libiberty should use the GDB source instead as that's the one package we know both bundles libiberty source and will use host-libiberty in preference.

 package/libiberty/libiberty.hash | 6 +-----
 package/libiberty/libiberty.mk   | 4 ++--
 2 files changed, 3 insertions(+), 7 deletions(-)
 mode change 100644 => 120000 package/libiberty/libiberty.hash
package/libiberty/libiberty.hash deleted +0 -5
deleted file mode 100644
index 0dafcea520..0000000000
@@ -1,5 +0,0 @@
-# From ftp://gcc.gnu.org/pub/binutils/releases/sha512.sum
-sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a  binutils-2.32.tar.xz
-
-# Locally computed, same as binutils.hash
-sha256  56bdea73b6145ef6ac5259b3da390b981d840c24cb03b8e1cbc678de7ecfa18d  COPYING.LIB
package/libiberty/libiberty.hash new file +1 -0
new file mode 120000
index 0000000000..e0655d3af3
@@ -0,0 +1 @@
+../binutils/binutils.hash
\ No newline at end of file
package/libiberty/libiberty.mk +2 -2
index 6235a8b956..d0847bf298 100644
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-LIBIBERTY_VERSION = 2.32
-LIBIBERTY_SOURCE = binutils-$(LIBIBERTY_VERSION).tar.xz
+LIBIBERTY_VERSION = $(BINUTILS_VERSION)
+LIBIBERTY_SOURCE = $(BINUTILS_SOURCE)
 LIBIBERTY_SITE = $(BR2_GNU_MIRROR)/binutils
 HOST_LIBIBERTY_DL_SUBDIR = binutils
 
Signature · 6 lines
2.35.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

John, All,

On 2022-02-23 11:55 +0000, John Keeping spake thusly:

Quoted 51 lines

libiberty is built from the binutils source but this package has languished on version 2.32 while the binutils package now uses 2.36.1 by default.

Even between the 2.32 version and GDB 10.2 which is the default (and where host-libiberty is used instead of a version bundled in the GDB source) there are memory leak fixes and several improvements to demangling.

Update the libiberty package to simply use the same version as binutils so that there is no need to remember to update this package in the future. Replace the .hash file with a symlink so that the binutils hashes are used automatically.

---
I'm not sure if this is this is the best way to improve the situation here - it's the smallest change to get something a bit more modern (in most circumstances), but I wonder if libiberty should use the GDB source instead as that's the one package we know both bundles libiberty source and will use host-libiberty in preference.

 package/libiberty/libiberty.hash | 6 +-----
 package/libiberty/libiberty.mk   | 4 ++--
 2 files changed, 3 insertions(+), 7 deletions(-)
 mode change 100644 => 120000 package/libiberty/libiberty.hash
package/libiberty/libiberty.hash deleted +0 -5
deleted file mode 100644
index 0dafcea520..0000000000
@@ -1,5 +0,0 @@
-# From ftp://gcc.gnu.org/pub/binutils/releases/sha512.sum
-sha512  d326408f12a03d9a61a9de56584c2af12f81c2e50d2d7e835d51565df8314df01575724afa1e43bd0db45cfc9916b41519b67dfce03232aa4978704492a6994a  binutils-2.32.tar.xz
-
-# Locally computed, same as binutils.hash
-sha256  56bdea73b6145ef6ac5259b3da390b981d840c24cb03b8e1cbc678de7ecfa18d  COPYING.LIB
package/libiberty/libiberty.hash new file +1 -0
new file mode 120000
index 0000000000..e0655d3af3
@@ -0,0 +1 @@
+../binutils/binutils.hash
\ No newline at end of file
package/libiberty/libiberty.mk +0 -0
index 6235a8b956..d0847bf298 100644

package/libiberty/libiberty.mk line 8

Quoted 7 lines
package/libiberty/libiberty.mk +2 -2
@@ -4,8 +4,8 @@
 #
 ################################################################################
 
-LIBIBERTY_VERSION = 2.32
-LIBIBERTY_SOURCE = binutils-$(LIBIBERTY_VERSION).tar.xz
+LIBIBERTY_VERSION = $(BINUTILS_VERSION)
+LIBIBERTY_SOURCE = $(BINUTILS_SOURCE)

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.

Regards,
Yann E. MORIN.

Quoted 6 lines
package/libiberty/libiberty.mk +0 -0
 LIBIBERTY_SITE = $(BR2_GNU_MIRROR)/binutils
 HOST_LIBIBERTY_DL_SUBDIR = binutils
 
Signature · 1 line
2.35.1
Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw
Quoted 9 lines · On Wed, 23 Feb 2022 15:27:31 +0100 "Yann E. MORIN" <[email protected]>…

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.

So we would have to replicate all the version selection logic (like we admittedly do for linux vs. linux-headers).

Thomas

Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin
Embedded Linux and Kernel engineering and training
https://bootlin.com
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#3 lore raw

Thomas, All,

On 2022-02-23 15:51 +0100, Thomas Petazzoni spake thusly:

Quoted 10 lines
Quoted 8 lines · On Wed, 23 Feb 2022 15:27:31 +0100 "Yann E. MORIN" <[email protected]>…

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.

Quoted 3 lines

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...

Quoted 2 lines

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.

Regards,
Yann E. MORIN.

Signature · 10 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#4 lore raw
Quoted 23 lines · Yann E. MORIN

Thomas, All,

On 2022-02-23 15:51 +0100, Thomas Petazzoni spake thusly:

Quoted 10 lines
Quoted 8 lines · On Wed, 23 Feb 2022 15:27:31 +0100 "Yann E. MORIN" <[email protected]>…

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.

Quoted 3 lines

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...

Quoted 2 lines

So we would have to replicate all the version selection logic (like we admittedly do for linux vs. linux-headers).

Quoted 8 lines

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/
Quoted 1 line

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
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot