From bfd75a5bd2ff2ba5b13515d5dc0bf3bab3b7b5b8 Mon Sep 17 00:00:00 2001 From: Thomas Petazzoni Date: Mon, 18 Aug 2025 10:41:53 +0200 Subject: [PATCH] package/binutils: never build readline to fix GCC 15.x build issue The binutils-gdb code base in Git does have a copy of readline that is used by gdb. The release tarballs of binutils do NOT contain readline as it's not needed for binutils itself (only gdb). However, when we build the ARC binutils, taken from Git, the readline/ folder is present, and therefore readline is built even if it is not actually needed. This causes build failures as the copy of readline in ARC binutils 2024.12 (based on binutils 2.43) does not build with GCC 15.x. To work around this problem, we use a suggestion from Waldemar Brodkorb: pass --with-system-readline. Indeed, this disables the build of readline... but it does not actually check that we have a system readline, since we're not building gdb. Fixes: https://autobuild.buildroot.net/results/976243181f7000fe2790b3450bdae51e8c12769e/ Signed-off-by: Thomas Petazzoni Signed-off-by: Romain Naour --- package/binutils/binutils.mk | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/package/binutils/binutils.mk b/package/binutils/binutils.mk index a9f03225da..c79f3414af 100644 --- a/package/binutils/binutils.mk +++ b/package/binutils/binutils.mk @@ -47,6 +47,13 @@ BINUTILS_DISABLE_GDB_CONF_OPTS = \ --disable-gdb # We need to specify host & target to avoid breaking ARM EABI +# +# --with-system-readline to never build readline, as binutils doesn't +# need it (only gdb does). For binutils release tarballs, readline +# is not shipped, but when we get it from git, it is present and +# gets built which can cause build issues, so force skipping +# it. Note: the configure script will not check for readline as it +# doesn't need it. BINUTILS_CONF_OPTS = \ --disable-multilib \ --disable-werror \ @@ -58,7 +65,8 @@ BINUTILS_CONF_OPTS = \ --disable-gprofng \ $(BINUTILS_DISABLE_GDB_CONF_OPTS) \ $(BINUTILS_EXTRA_CONFIG_OPTIONS) \ - --without-zstd + --without-zstd \ + --with-system-readline ifeq ($(BR2_STATIC_LIBS),y) BINUTILS_CONF_OPTS += --disable-plugins @@ -82,6 +90,13 @@ endif # "host" binutils should actually be "cross" # We just keep the convention of "host utility" for now +# +# --with-system-readline to never build readline, as binutils doesn't +# need it (only gdb does). For binutils release tarballs, readline +# is not shipped, but when we get it from git, it is present and +# gets built which can cause build issues, so force skipping +# it. Note: the configure script will not check for readline as it +# doesn't need it. HOST_BINUTILS_CONF_OPTS = \ --disable-multilib \ --disable-werror \ @@ -95,7 +110,8 @@ HOST_BINUTILS_CONF_OPTS = \ --enable-lto \ $(BINUTILS_DISABLE_GDB_CONF_OPTS) \ $(BINUTILS_EXTRA_CONFIG_OPTIONS) \ - --without-zstd + --without-zstd \ + --with-system-readline ifeq ($(BR2_BINUTILS_GPROFNG),y) HOST_BINUTILS_DEPENDENCIES += host-bison