Raise the minimum binutils version to 2.39

Message ID 20250404145113.2012199-1-stli@linux.ibm.com (mailing list archive)
State Changes Requested
Headers
Series Raise the minimum binutils version to 2.39 |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-arm success Build passed
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Build passed
linaro-tcwg-bot/tcwg_glibc_check--master-arm success Test passed
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 success Test passed
redhat-pt-bot/TryBot-32bit success Build for i686

Commit Message

Stefan Liebler April 4, 2025, 2:51 p.m. UTC
  The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
GCC version to 12.1 which was released in 2022.

The current minimum bintuils version 2.25 was released end of 2014.  This patch
now raises the minimum binutils version to 2.39 which was also released in 2022.

For ARC and powerpc, the special checks/hints are not needed anymore.

On s390x, the used cfi_escape for cfi_val_offset can now be ommitted.

In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
PIE builds fail on binutils 2.37 and earlier, see:
https://sourceware.org/bugzilla/show_bug.cgi?id=28672
This patch keeps PIE unsupported and let the machine maintainers test and
enable it later.

In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
This patch keeps the check as is and let the machine maintainers check if it
still required.
---
 INSTALL                                   |  9 +--
 NEWS                                      |  4 +-
 configure                                 |  4 +-
 configure.ac                              |  4 +-
 manual/install.texi                       |  8 +--
 sysdeps/generic/sysdep.h                  |  3 +
 sysdeps/powerpc/powerpc64/le/configure    | 70 -----------------------
 sysdeps/powerpc/powerpc64/le/configure.ac |  7 ---
 sysdeps/s390/s390-64/s390x-mcount.h       |  6 +-
 9 files changed, 13 insertions(+), 102 deletions(-)
  

Comments

H.J. Lu April 6, 2025, 3:46 p.m. UTC | #1
On Fri, Apr 4, 2025 at 7:51 AM Stefan Liebler <stli@linux.ibm.com> wrote:
>
> The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
> GCC version to 12.1 which was released in 2022.
>
> The current minimum bintuils version 2.25 was released end of 2014.  This patch
> now raises the minimum binutils version to 2.39 which was also released in 2022.
>
> For ARC and powerpc, the special checks/hints are not needed anymore.
>
> On s390x, the used cfi_escape for cfi_val_offset can now be ommitted.
>
> In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
> PIE builds fail on binutils 2.37 and earlier, see:
> https://sourceware.org/bugzilla/show_bug.cgi?id=28672
> This patch keeps PIE unsupported and let the machine maintainers test and
> enable it later.
>
> In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
> are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
> See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
> This patch keeps the check as is and let the machine maintainers check if it
> still required.

Man files under sysdeps can be simplified after this.  Should we limit the
first patch to generic files and target maintainers can update target sysdeps
files as needed?

> ---
>  INSTALL                                   |  9 +--
>  NEWS                                      |  4 +-
>  configure                                 |  4 +-
>  configure.ac                              |  4 +-
>  manual/install.texi                       |  8 +--
>  sysdeps/generic/sysdep.h                  |  3 +
>  sysdeps/powerpc/powerpc64/le/configure    | 70 -----------------------
>  sysdeps/powerpc/powerpc64/le/configure.ac |  7 ---
>  sysdeps/s390/s390-64/s390x-mcount.h       |  6 +-
>  9 files changed, 13 insertions(+), 102 deletions(-)
>
> diff --git a/INSTALL b/INSTALL
> index d3200f271f..2c39c32d4a 100644
> --- a/INSTALL
> +++ b/INSTALL
> @@ -511,20 +511,13 @@ build the GNU C Library:
>       Check the FAQ for any special compiler issues on particular
>       platforms.
>
> -   * GNU 'binutils' 2.25 or later
> +   * GNU 'binutils' 2.39 or later
>
>       You must use GNU 'binutils' (as and ld) to build the GNU C Library.
>       No other assembler or linker has the necessary functionality at the
>       moment.  As of release time, GNU 'binutils' 2.43.1 is the newest
>       verified to work to build the GNU C Library.
>
> -     For PowerPC 64-bits little-endian (powerpc64le), 'objcopy' is
> -     required to support '--update-section'.  This option requires
> -     binutils 2.26 or newer.
> -
> -     ARC architecture needs 'binutils' 2.32 or higher for TLS related
> -     fixes.
> -
>     * GNU 'texinfo' 4.7 or later
>
>       To correctly translate and install the Texinfo documentation you
> diff --git a/NEWS b/NEWS
> index 52cbf1a989..23f590442f 100644
> --- a/NEWS
> +++ b/NEWS
> @@ -24,7 +24,9 @@ Deprecated and removed features, and other changes affecting compatibility:
>
>  Changes to build and runtime requirements:
>
> -  [Add changes to build and runtime requirements here]
> +* GCC 12.1 or later is now required to build the GNU C Library.
> +
> +* GNU Binutils 2.39 or later is now required to build the GNU C Library.

Please rebase.

>  Security related changes:
>
> diff --git a/configure b/configure
> index 7cda641fce..7decd93baa 100755
> --- a/configure
> +++ b/configure
> @@ -5124,7 +5124,7 @@ fi
>
>
>
> -# Accept binutils 2.25 or newer.
> +# Accept binutils 2.39 or newer.
>  libc_cv_with_lld=no
>  case $($LD --version) in
>    "GNU gold"*)
> @@ -5330,7 +5330,7 @@ printf %s "checking version of $LD... " >&6; }
>    ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
>    case $ac_prog_version in
>      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
> -    2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
> +    2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*)
>         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
>      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
>
> diff --git a/configure.ac b/configure.ac
> index 0b0d8875cc..abd3b238d2 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -522,7 +522,7 @@ AC_PROG_LN_S
>
>  LIBC_PROG_BINUTILS
>
> -# Accept binutils 2.25 or newer.
> +# Accept binutils 2.39 or newer.
>  libc_cv_with_lld=no
>  case $($LD --version) in
>    "GNU gold"*)
> @@ -543,7 +543,7 @@ case $($LD --version) in
>    *)
>      AC_CHECK_PROG_VER(LD, $LD, --version,
>                     [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
> -                   [2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
> +                   [2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*],
>                     LD=: critic_missing="$critic_missing GNU ld")
>      ;;
>  esac
> diff --git a/manual/install.texi b/manual/install.texi
> index 7fcdda9146..006f93bb71 100644
> --- a/manual/install.texi
> +++ b/manual/install.texi
> @@ -552,19 +552,13 @@ You can use whatever compiler you like to compile programs that use
>  Check the FAQ for any special compiler issues on particular platforms.
>
>  @item
> -GNU @code{binutils} 2.25 or later
> +GNU @code{binutils} 2.39 or later
>
>  You must use GNU @code{binutils} (as and ld) to build @theglibc{}.
>  No other assembler or linker has the necessary functionality at the
>  moment. As of release time, GNU @code{binutils} 2.43.1 is the newest
>  verified to work to build @theglibc{}.
>
> -For PowerPC 64-bits little-endian (powerpc64le), @command{objcopy} is required
> -to support @option{--update-section}.  This option requires binutils 2.26 or
> -newer.
> -
> -ARC architecture needs @code{binutils} 2.32 or higher for TLS related fixes.
> -
>  @item
>  GNU @code{texinfo} 4.7 or later
>
> diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h
> index 4c0dda4d23..ef5eba2c87 100644
> --- a/sysdeps/generic/sysdep.h
> +++ b/sysdeps/generic/sysdep.h
> @@ -45,6 +45,7 @@
>  # define cfi_adjust_cfa_offset(off)    .cfi_adjust_cfa_offset off
>  # define cfi_offset(reg, off)          .cfi_offset reg, off
>  # define cfi_rel_offset(reg, off)      .cfi_rel_offset reg, off
> +# define cfi_val_offset(reg, off)      .cfi_val_offset reg, off
>  # define cfi_register(r1, r2)          .cfi_register r1, r2
>  # define cfi_return_column(reg)        .cfi_return_column reg
>  # define cfi_restore(reg)              .cfi_restore reg
> @@ -74,6 +75,8 @@
>     ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
>  # define CFI_REL_OFFSET(reg, off) \
>     ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
> +# define CFI_VAL_OFFSET(reg, off) \
> +   ".cfi_val_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
>  # define CFI_REGISTER(r1, r2) \
>     ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
>  # define CFI_RETURN_COLUMN(reg) \
> diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure
> index 7092f61bd4..ef17f245a1 100644
> --- a/sysdeps/powerpc/powerpc64/le/configure
> +++ b/sysdeps/powerpc/powerpc64/le/configure
> @@ -137,75 +137,5 @@ then :
>    critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."
>  fi
>
> -for ac_prog in $OBJCOPY
> -do
> -  # Extract the first word of "$ac_prog", so it can be a program name with args.
> -set dummy $ac_prog; ac_word=$2
> -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> -printf %s "checking for $ac_word... " >&6; }
> -if test ${ac_cv_prog_OBJCOPY+y}
> -then :
> -  printf %s "(cached) " >&6
> -else case e in #(
> -  e) if test -n "$OBJCOPY"; then
> -  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
> -else
> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> -for as_dir in $PATH
> -do
> -  IFS=$as_save_IFS
> -  case $as_dir in #(((
> -    '') as_dir=./ ;;
> -    */) ;;
> -    *) as_dir=$as_dir/ ;;
> -  esac
> -    for ac_exec_ext in '' $ac_executable_extensions; do
> -  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
> -    ac_cv_prog_OBJCOPY="$ac_prog"
> -    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
> -    break 2
> -  fi
> -done
> -  done
> -IFS=$as_save_IFS
> -
> -fi ;;
> -esac
> -fi
> -OBJCOPY=$ac_cv_prog_OBJCOPY
> -if test -n "$OBJCOPY"; then
> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5
> -printf "%s\n" "$OBJCOPY" >&6; }
> -else
> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
> -printf "%s\n" "no" >&6; }
> -fi
> -
> -
> -  test -n "$OBJCOPY" && break
> -done
> -
> -if test -z "$OBJCOPY"; then
> -  ac_verc_fail=yes
> -else
> -  # Found it, now check the version.
> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking version of $OBJCOPY" >&5
> -printf %s "checking version of $OBJCOPY... " >&6; }
> -  ac_prog_version=`$OBJCOPY --version 2>&1 | sed -n 's/^.*GNU objcopy.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
> -  case $ac_prog_version in
> -    '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
> -    2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
> -       ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
> -    *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
> -
> -  esac
> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
> -printf "%s\n" "$ac_prog_version" >&6; }
> -fi
> -if test $ac_verc_fail = yes; then
> -  AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le"
> -fi
> -
> -
>  test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5
>
> diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac
> index 48d7089b63..79b3d434e8 100644
> --- a/sysdeps/powerpc/powerpc64/le/configure.ac
> +++ b/sysdeps/powerpc/powerpc64/le/configure.ac
> @@ -66,11 +66,4 @@ CFLAGS="$save_CFLAGS"])
>  AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" = "no"],
>        [critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."])
>
> -dnl objcopy (binutils) 2.26 or newer required to support the --update-section
> -dnl feature for fixing up .gnu.attribute section with IEEE ldbl.
> -AC_CHECK_PROG_VER(OBJCOPY, $OBJCOPY, --version,
> -                 [GNU objcopy.* \([0-9]*\.[0-9.]*\)],
> -                 [2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
> -                 AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le")
> -
>  test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])
> diff --git a/sysdeps/s390/s390-64/s390x-mcount.h b/sysdeps/s390/s390-64/s390x-mcount.h
> index b82f1a8e6b..c5bd70d160 100644
> --- a/sysdeps/s390/s390-64/s390x-mcount.h
> +++ b/sysdeps/s390/s390-64/s390x-mcount.h
> @@ -68,11 +68,7 @@ C_LABEL(MCOUNT_SYMBOL)
>         /* Save the caller-clobbered registers.  */
>         aghi  %r15,-224
>         cfi_adjust_cfa_offset (224)
> -       /* binutils 2.28+: .cfi_val_offset r15, -160 */
> -       .cfi_escape \
> -               /* DW_CFA_val_offset */ 0x14, \
> -               /* r15 */               0x0f, \
> -               /* scaled offset */     0x14
> +       cfi_val_offset (r15, -160)
>         stmg  %r14,%r5,160(%r15)
>         cfi_offset (r14, -224)
>         cfi_offset (r0, -224+16)
> --
> 2.47.0
>
  
Stefan Liebler April 7, 2025, 8:18 a.m. UTC | #2
On 4/6/25 17:46, H.J. Lu wrote:
> On Fri, Apr 4, 2025 at 7:51 AM Stefan Liebler <stli@linux.ibm.com> wrote:
>>
>> The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
>> GCC version to 12.1 which was released in 2022.
>>
>> The current minimum bintuils version 2.25 was released end of 2014.  This patch
>> now raises the minimum binutils version to 2.39 which was also released in 2022.
>>
>> For ARC and powerpc, the special checks/hints are not needed anymore.
>>
>> On s390x, the used cfi_escape for cfi_val_offset can now be ommitted.
>>
>> In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
>> PIE builds fail on binutils 2.37 and earlier, see:
>> https://sourceware.org/bugzilla/show_bug.cgi?id=28672
>> This patch keeps PIE unsupported and let the machine maintainers test and
>> enable it later.
>>
>> In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
>> are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
>> See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
>> This patch keeps the check as is and let the machine maintainers check if it
>> still required.
> 
> Man files under sysdeps can be simplified after this.  Should we limit the
> first patch to generic files and target maintainers can update target sysdeps
> files as needed?
Which man-files do you mean? Can you please point me to those?

I'm fine with limiting the first patch to generic files. Shall I then
drop ARC, powerpc and s390x changes?
For ARC, there is no configure-check, but the version is just mentioned
in INSTALL & co.
For powerpc the version is also mentioned there and there is the
configure-check.
But I think it is a bit confusing if version 2.39 is required in INSTALL
and a few lines below, the versions 2.26/2.32 are still mentioned.
Perhaps better keep the ARC/powerpc-stuff in the first patch?

For s390x, if wanted, I can split out the cfi_val_offset stuff and
immediately send a follow-up patch.

Or have you only meant the alpha, hppa, csky and arm stuff which were
only mentioned in the commit-message?
> 
>> ---
>>  INSTALL                                   |  9 +--
>>  NEWS                                      |  4 +-
>>  configure                                 |  4 +-
>>  configure.ac                              |  4 +-
>>  manual/install.texi                       |  8 +--
>>  sysdeps/generic/sysdep.h                  |  3 +
>>  sysdeps/powerpc/powerpc64/le/configure    | 70 -----------------------
>>  sysdeps/powerpc/powerpc64/le/configure.ac |  7 ---
>>  sysdeps/s390/s390-64/s390x-mcount.h       |  6 +-
>>  9 files changed, 13 insertions(+), 102 deletions(-)
>>
>> diff --git a/INSTALL b/INSTALL
>> index d3200f271f..2c39c32d4a 100644
>> --- a/INSTALL
>> +++ b/INSTALL
>> @@ -511,20 +511,13 @@ build the GNU C Library:
>>       Check the FAQ for any special compiler issues on particular
>>       platforms.
>>
>> -   * GNU 'binutils' 2.25 or later
>> +   * GNU 'binutils' 2.39 or later
>>
>>       You must use GNU 'binutils' (as and ld) to build the GNU C Library.
>>       No other assembler or linker has the necessary functionality at the
>>       moment.  As of release time, GNU 'binutils' 2.43.1 is the newest
>>       verified to work to build the GNU C Library.
>>
>> -     For PowerPC 64-bits little-endian (powerpc64le), 'objcopy' is
>> -     required to support '--update-section'.  This option requires
>> -     binutils 2.26 or newer.
>> -
>> -     ARC architecture needs 'binutils' 2.32 or higher for TLS related
>> -     fixes.
>> -
>>     * GNU 'texinfo' 4.7 or later
>>
>>       To correctly translate and install the Texinfo documentation you
>> diff --git a/NEWS b/NEWS
>> index 52cbf1a989..23f590442f 100644
>> --- a/NEWS
>> +++ b/NEWS
>> @@ -24,7 +24,9 @@ Deprecated and removed features, and other changes affecting compatibility:
>>
>>  Changes to build and runtime requirements:
>>
>> -  [Add changes to build and runtime requirements here]
>> +* GCC 12.1 or later is now required to build the GNU C Library.
>> +
>> +* GNU Binutils 2.39 or later is now required to build the GNU C Library.
> 
> Please rebase.
Sure, I've seen your patch - which is committed in the meanwhile - and
just used exactly the same wording. Just rebased locally.
> 
>>  Security related changes:
>>
>> diff --git a/configure b/configure
>> index 7cda641fce..7decd93baa 100755
>> --- a/configure
>> +++ b/configure
>> @@ -5124,7 +5124,7 @@ fi
>>
>>
>>
>> -# Accept binutils 2.25 or newer.
>> +# Accept binutils 2.39 or newer.
>>  libc_cv_with_lld=no
>>  case $($LD --version) in
>>    "GNU gold"*)
>> @@ -5330,7 +5330,7 @@ printf %s "checking version of $LD... " >&6; }
>>    ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
>>    case $ac_prog_version in
>>      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
>> -    2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
>> +    2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*)
>>         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
>>      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
>>
>> diff --git a/configure.ac b/configure.ac
>> index 0b0d8875cc..abd3b238d2 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -522,7 +522,7 @@ AC_PROG_LN_S
>>
>>  LIBC_PROG_BINUTILS
>>
>> -# Accept binutils 2.25 or newer.
>> +# Accept binutils 2.39 or newer.
>>  libc_cv_with_lld=no
>>  case $($LD --version) in
>>    "GNU gold"*)
>> @@ -543,7 +543,7 @@ case $($LD --version) in
>>    *)
>>      AC_CHECK_PROG_VER(LD, $LD, --version,
>>                     [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
>> -                   [2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
>> +                   [2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*],
>>                     LD=: critic_missing="$critic_missing GNU ld")
>>      ;;
>>  esac
>> diff --git a/manual/install.texi b/manual/install.texi
>> index 7fcdda9146..006f93bb71 100644
>> --- a/manual/install.texi
>> +++ b/manual/install.texi
>> @@ -552,19 +552,13 @@ You can use whatever compiler you like to compile programs that use
>>  Check the FAQ for any special compiler issues on particular platforms.
>>
>>  @item
>> -GNU @code{binutils} 2.25 or later
>> +GNU @code{binutils} 2.39 or later
>>
>>  You must use GNU @code{binutils} (as and ld) to build @theglibc{}.
>>  No other assembler or linker has the necessary functionality at the
>>  moment. As of release time, GNU @code{binutils} 2.43.1 is the newest
>>  verified to work to build @theglibc{}.
>>
>> -For PowerPC 64-bits little-endian (powerpc64le), @command{objcopy} is required
>> -to support @option{--update-section}.  This option requires binutils 2.26 or
>> -newer.
>> -
>> -ARC architecture needs @code{binutils} 2.32 or higher for TLS related fixes.
>> -
>>  @item
>>  GNU @code{texinfo} 4.7 or later
>>
>> diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h
>> index 4c0dda4d23..ef5eba2c87 100644
>> --- a/sysdeps/generic/sysdep.h
>> +++ b/sysdeps/generic/sysdep.h
>> @@ -45,6 +45,7 @@
>>  # define cfi_adjust_cfa_offset(off)    .cfi_adjust_cfa_offset off
>>  # define cfi_offset(reg, off)          .cfi_offset reg, off
>>  # define cfi_rel_offset(reg, off)      .cfi_rel_offset reg, off
>> +# define cfi_val_offset(reg, off)      .cfi_val_offset reg, off
>>  # define cfi_register(r1, r2)          .cfi_register r1, r2
>>  # define cfi_return_column(reg)        .cfi_return_column reg
>>  # define cfi_restore(reg)              .cfi_restore reg
>> @@ -74,6 +75,8 @@
>>     ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
>>  # define CFI_REL_OFFSET(reg, off) \
>>     ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
>> +# define CFI_VAL_OFFSET(reg, off) \
>> +   ".cfi_val_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
>>  # define CFI_REGISTER(r1, r2) \
>>     ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
>>  # define CFI_RETURN_COLUMN(reg) \
>> diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure
>> index 7092f61bd4..ef17f245a1 100644
>> --- a/sysdeps/powerpc/powerpc64/le/configure
>> +++ b/sysdeps/powerpc/powerpc64/le/configure
>> @@ -137,75 +137,5 @@ then :
>>    critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."
>>  fi
>>
>> -for ac_prog in $OBJCOPY
>> -do
>> -  # Extract the first word of "$ac_prog", so it can be a program name with args.
>> -set dummy $ac_prog; ac_word=$2
>> -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
>> -printf %s "checking for $ac_word... " >&6; }
>> -if test ${ac_cv_prog_OBJCOPY+y}
>> -then :
>> -  printf %s "(cached) " >&6
>> -else case e in #(
>> -  e) if test -n "$OBJCOPY"; then
>> -  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
>> -else
>> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
>> -for as_dir in $PATH
>> -do
>> -  IFS=$as_save_IFS
>> -  case $as_dir in #(((
>> -    '') as_dir=./ ;;
>> -    */) ;;
>> -    *) as_dir=$as_dir/ ;;
>> -  esac
>> -    for ac_exec_ext in '' $ac_executable_extensions; do
>> -  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
>> -    ac_cv_prog_OBJCOPY="$ac_prog"
>> -    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
>> -    break 2
>> -  fi
>> -done
>> -  done
>> -IFS=$as_save_IFS
>> -
>> -fi ;;
>> -esac
>> -fi
>> -OBJCOPY=$ac_cv_prog_OBJCOPY
>> -if test -n "$OBJCOPY"; then
>> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5
>> -printf "%s\n" "$OBJCOPY" >&6; }
>> -else
>> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
>> -printf "%s\n" "no" >&6; }
>> -fi
>> -
>> -
>> -  test -n "$OBJCOPY" && break
>> -done
>> -
>> -if test -z "$OBJCOPY"; then
>> -  ac_verc_fail=yes
>> -else
>> -  # Found it, now check the version.
>> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking version of $OBJCOPY" >&5
>> -printf %s "checking version of $OBJCOPY... " >&6; }
>> -  ac_prog_version=`$OBJCOPY --version 2>&1 | sed -n 's/^.*GNU objcopy.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
>> -  case $ac_prog_version in
>> -    '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
>> -    2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
>> -       ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
>> -    *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
>> -
>> -  esac
>> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
>> -printf "%s\n" "$ac_prog_version" >&6; }
>> -fi
>> -if test $ac_verc_fail = yes; then
>> -  AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le"
>> -fi
>> -
>> -
>>  test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5
>>
>> diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac
>> index 48d7089b63..79b3d434e8 100644
>> --- a/sysdeps/powerpc/powerpc64/le/configure.ac
>> +++ b/sysdeps/powerpc/powerpc64/le/configure.ac
>> @@ -66,11 +66,4 @@ CFLAGS="$save_CFLAGS"])
>>  AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" = "no"],
>>        [critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."])
>>
>> -dnl objcopy (binutils) 2.26 or newer required to support the --update-section
>> -dnl feature for fixing up .gnu.attribute section with IEEE ldbl.
>> -AC_CHECK_PROG_VER(OBJCOPY, $OBJCOPY, --version,
>> -                 [GNU objcopy.* \([0-9]*\.[0-9.]*\)],
>> -                 [2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
>> -                 AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le")
>> -
>>  test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])
>> diff --git a/sysdeps/s390/s390-64/s390x-mcount.h b/sysdeps/s390/s390-64/s390x-mcount.h
>> index b82f1a8e6b..c5bd70d160 100644
>> --- a/sysdeps/s390/s390-64/s390x-mcount.h
>> +++ b/sysdeps/s390/s390-64/s390x-mcount.h
>> @@ -68,11 +68,7 @@ C_LABEL(MCOUNT_SYMBOL)
>>         /* Save the caller-clobbered registers.  */
>>         aghi  %r15,-224
>>         cfi_adjust_cfa_offset (224)
>> -       /* binutils 2.28+: .cfi_val_offset r15, -160 */
>> -       .cfi_escape \
>> -               /* DW_CFA_val_offset */ 0x14, \
>> -               /* r15 */               0x0f, \
>> -               /* scaled offset */     0x14
>> +       cfi_val_offset (r15, -160)
>>         stmg  %r14,%r5,160(%r15)
>>         cfi_offset (r14, -224)
>>         cfi_offset (r0, -224+16)
>> --
>> 2.47.0
>>
> 
>
  
Florian Weimer April 7, 2025, 1:31 p.m. UTC | #3
* Stefan Liebler:

> The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
> GCC version to 12.1 which was released in 2022.
>
> The current minimum bintuils version 2.25 was released end of 2014.  This patch
> now raises the minimum binutils version to 2.39 which was also released in 2022.
>
> For ARC and powerpc, the special checks/hints are not needed anymore.
>
> On s390x, the used cfi_escape for cfi_val_offset can now be ommitted.
>
> In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
> PIE builds fail on binutils 2.37 and earlier, see:
> https://sourceware.org/bugzilla/show_bug.cgi?id=28672
> This patch keeps PIE unsupported and let the machine maintainers test and
> enable it later.
>
> In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
> are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
> See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
> This patch keeps the check as is and let the machine maintainers check if it
> still required.

The risk here is that this binutils version introduces new relocation
types into the crt*.o files (or libc_nonshared.a or even libc.a) that
cannot be handled by older binutils.  This is different from bumping the
GCC requirement, which usually does not impose a compiler upgrade after
installing glibc.

Certain binutils versions even treat unknown relocation types as type 0,
leading to very difficult-to-debug misbehavior (unless you happen to
recall that you have seen this before …).

Thanks,
Florian
  
H.J. Lu April 7, 2025, 3:26 p.m. UTC | #4
On Mon, Apr 7, 2025 at 1:18 AM Stefan Liebler <stli@linux.ibm.com> wrote:
>
> On 4/6/25 17:46, H.J. Lu wrote:
> > On Fri, Apr 4, 2025 at 7:51 AM Stefan Liebler <stli@linux.ibm.com> wrote:
> >>
> >> The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
> >> GCC version to 12.1 which was released in 2022.
> >>
> >> The current minimum bintuils version 2.25 was released end of 2014.  This patch
> >> now raises the minimum binutils version to 2.39 which was also released in 2022.
> >>
> >> For ARC and powerpc, the special checks/hints are not needed anymore.
> >>
> >> On s390x, the used cfi_escape for cfi_val_offset can now be ommitted.
> >>
> >> In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
> >> PIE builds fail on binutils 2.37 and earlier, see:
> >> https://sourceware.org/bugzilla/show_bug.cgi?id=28672
> >> This patch keeps PIE unsupported and let the machine maintainers test and
> >> enable it later.
> >>
> >> In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
> >> are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
> >> See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
> >> This patch keeps the check as is and let the machine maintainers check if it
> >> still required.
> >
> > Man files under sysdeps can be simplified after this.  Should we limit the
> > first patch to generic files and target maintainers can update target sysdeps
> > files as needed?
> Which man-files do you mean? Can you please point me to those?
>
> I'm fine with limiting the first patch to generic files. Shall I then
> drop ARC, powerpc and s390x changes?
> For ARC, there is no configure-check, but the version is just mentioned
> in INSTALL & co.
> For powerpc the version is also mentioned there and there is the
> configure-check.
> But I think it is a bit confusing if version 2.39 is required in INSTALL
> and a few lines below, the versions 2.26/2.32 are still mentioned.
> Perhaps better keep the ARC/powerpc-stuff in the first patch?
>
> For s390x, if wanted, I can split out the cfi_val_offset stuff and
> immediately send a follow-up patch.
>
> Or have you only meant the alpha, hppa, csky and arm stuff which were
> only mentioned in the commit-message?

If you exclude

sysdeps/powerpc/powerpc64/le/configure*
sysdeps/s390/s390-64/s390x-mcount.h

from the first patch, anyone can review it.

> >
> >> ---
> >>  INSTALL                                   |  9 +--
> >>  NEWS                                      |  4 +-
> >>  configure                                 |  4 +-
> >>  configure.ac                              |  4 +-
> >>  manual/install.texi                       |  8 +--
> >>  sysdeps/generic/sysdep.h                  |  3 +
> >>  sysdeps/powerpc/powerpc64/le/configure    | 70 -----------------------
> >>  sysdeps/powerpc/powerpc64/le/configure.ac |  7 ---
> >>  sysdeps/s390/s390-64/s390x-mcount.h       |  6 +-
> >>  9 files changed, 13 insertions(+), 102 deletions(-)
> >>
> >> diff --git a/INSTALL b/INSTALL
> >> index d3200f271f..2c39c32d4a 100644
> >> --- a/INSTALL
> >> +++ b/INSTALL
> >> @@ -511,20 +511,13 @@ build the GNU C Library:
> >>       Check the FAQ for any special compiler issues on particular
> >>       platforms.
> >>
> >> -   * GNU 'binutils' 2.25 or later
> >> +   * GNU 'binutils' 2.39 or later
> >>
> >>       You must use GNU 'binutils' (as and ld) to build the GNU C Library.
> >>       No other assembler or linker has the necessary functionality at the
> >>       moment.  As of release time, GNU 'binutils' 2.43.1 is the newest
> >>       verified to work to build the GNU C Library.
> >>
> >> -     For PowerPC 64-bits little-endian (powerpc64le), 'objcopy' is
> >> -     required to support '--update-section'.  This option requires
> >> -     binutils 2.26 or newer.
> >> -
> >> -     ARC architecture needs 'binutils' 2.32 or higher for TLS related
> >> -     fixes.
> >> -
> >>     * GNU 'texinfo' 4.7 or later
> >>
> >>       To correctly translate and install the Texinfo documentation you
> >> diff --git a/NEWS b/NEWS
> >> index 52cbf1a989..23f590442f 100644
> >> --- a/NEWS
> >> +++ b/NEWS
> >> @@ -24,7 +24,9 @@ Deprecated and removed features, and other changes affecting compatibility:
> >>
> >>  Changes to build and runtime requirements:
> >>
> >> -  [Add changes to build and runtime requirements here]
> >> +* GCC 12.1 or later is now required to build the GNU C Library.
> >> +
> >> +* GNU Binutils 2.39 or later is now required to build the GNU C Library.
> >
> > Please rebase.
> Sure, I've seen your patch - which is committed in the meanwhile - and
> just used exactly the same wording. Just rebased locally.
> >
> >>  Security related changes:
> >>
> >> diff --git a/configure b/configure
> >> index 7cda641fce..7decd93baa 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -5124,7 +5124,7 @@ fi
> >>
> >>
> >>
> >> -# Accept binutils 2.25 or newer.
> >> +# Accept binutils 2.39 or newer.
> >>  libc_cv_with_lld=no
> >>  case $($LD --version) in
> >>    "GNU gold"*)
> >> @@ -5330,7 +5330,7 @@ printf %s "checking version of $LD... " >&6; }
> >>    ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
> >>    case $ac_prog_version in
> >>      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
> >> -    2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
> >> +    2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*)
> >>         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
> >>      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
> >>
> >> diff --git a/configure.ac b/configure.ac
> >> index 0b0d8875cc..abd3b238d2 100644
> >> --- a/configure.ac
> >> +++ b/configure.ac
> >> @@ -522,7 +522,7 @@ AC_PROG_LN_S
> >>
> >>  LIBC_PROG_BINUTILS
> >>
> >> -# Accept binutils 2.25 or newer.
> >> +# Accept binutils 2.39 or newer.
> >>  libc_cv_with_lld=no
> >>  case $($LD --version) in
> >>    "GNU gold"*)
> >> @@ -543,7 +543,7 @@ case $($LD --version) in
> >>    *)
> >>      AC_CHECK_PROG_VER(LD, $LD, --version,
> >>                     [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
> >> -                   [2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
> >> +                   [2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*],
> >>                     LD=: critic_missing="$critic_missing GNU ld")
> >>      ;;
> >>  esac
> >> diff --git a/manual/install.texi b/manual/install.texi
> >> index 7fcdda9146..006f93bb71 100644
> >> --- a/manual/install.texi
> >> +++ b/manual/install.texi
> >> @@ -552,19 +552,13 @@ You can use whatever compiler you like to compile programs that use
> >>  Check the FAQ for any special compiler issues on particular platforms.
> >>
> >>  @item
> >> -GNU @code{binutils} 2.25 or later
> >> +GNU @code{binutils} 2.39 or later
> >>
> >>  You must use GNU @code{binutils} (as and ld) to build @theglibc{}.
> >>  No other assembler or linker has the necessary functionality at the
> >>  moment. As of release time, GNU @code{binutils} 2.43.1 is the newest
> >>  verified to work to build @theglibc{}.
> >>
> >> -For PowerPC 64-bits little-endian (powerpc64le), @command{objcopy} is required
> >> -to support @option{--update-section}.  This option requires binutils 2.26 or
> >> -newer.
> >> -
> >> -ARC architecture needs @code{binutils} 2.32 or higher for TLS related fixes.
> >> -
> >>  @item
> >>  GNU @code{texinfo} 4.7 or later
> >>
> >> diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h
> >> index 4c0dda4d23..ef5eba2c87 100644
> >> --- a/sysdeps/generic/sysdep.h
> >> +++ b/sysdeps/generic/sysdep.h
> >> @@ -45,6 +45,7 @@
> >>  # define cfi_adjust_cfa_offset(off)    .cfi_adjust_cfa_offset off
> >>  # define cfi_offset(reg, off)          .cfi_offset reg, off
> >>  # define cfi_rel_offset(reg, off)      .cfi_rel_offset reg, off
> >> +# define cfi_val_offset(reg, off)      .cfi_val_offset reg, off
> >>  # define cfi_register(r1, r2)          .cfi_register r1, r2
> >>  # define cfi_return_column(reg)        .cfi_return_column reg
> >>  # define cfi_restore(reg)              .cfi_restore reg
> >> @@ -74,6 +75,8 @@
> >>     ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
> >>  # define CFI_REL_OFFSET(reg, off) \
> >>     ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
> >> +# define CFI_VAL_OFFSET(reg, off) \
> >> +   ".cfi_val_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
> >>  # define CFI_REGISTER(r1, r2) \
> >>     ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
> >>  # define CFI_RETURN_COLUMN(reg) \
> >> diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure
> >> index 7092f61bd4..ef17f245a1 100644
> >> --- a/sysdeps/powerpc/powerpc64/le/configure
> >> +++ b/sysdeps/powerpc/powerpc64/le/configure
> >> @@ -137,75 +137,5 @@ then :
> >>    critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."
> >>  fi
> >>
> >> -for ac_prog in $OBJCOPY
> >> -do
> >> -  # Extract the first word of "$ac_prog", so it can be a program name with args.
> >> -set dummy $ac_prog; ac_word=$2
> >> -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
> >> -printf %s "checking for $ac_word... " >&6; }
> >> -if test ${ac_cv_prog_OBJCOPY+y}
> >> -then :
> >> -  printf %s "(cached) " >&6
> >> -else case e in #(
> >> -  e) if test -n "$OBJCOPY"; then
> >> -  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
> >> -else
> >> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
> >> -for as_dir in $PATH
> >> -do
> >> -  IFS=$as_save_IFS
> >> -  case $as_dir in #(((
> >> -    '') as_dir=./ ;;
> >> -    */) ;;
> >> -    *) as_dir=$as_dir/ ;;
> >> -  esac
> >> -    for ac_exec_ext in '' $ac_executable_extensions; do
> >> -  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
> >> -    ac_cv_prog_OBJCOPY="$ac_prog"
> >> -    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
> >> -    break 2
> >> -  fi
> >> -done
> >> -  done
> >> -IFS=$as_save_IFS
> >> -
> >> -fi ;;
> >> -esac
> >> -fi
> >> -OBJCOPY=$ac_cv_prog_OBJCOPY
> >> -if test -n "$OBJCOPY"; then
> >> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5
> >> -printf "%s\n" "$OBJCOPY" >&6; }
> >> -else
> >> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
> >> -printf "%s\n" "no" >&6; }
> >> -fi
> >> -
> >> -
> >> -  test -n "$OBJCOPY" && break
> >> -done
> >> -
> >> -if test -z "$OBJCOPY"; then
> >> -  ac_verc_fail=yes
> >> -else
> >> -  # Found it, now check the version.
> >> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking version of $OBJCOPY" >&5
> >> -printf %s "checking version of $OBJCOPY... " >&6; }
> >> -  ac_prog_version=`$OBJCOPY --version 2>&1 | sed -n 's/^.*GNU objcopy.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
> >> -  case $ac_prog_version in
> >> -    '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
> >> -    2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
> >> -       ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
> >> -    *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
> >> -
> >> -  esac
> >> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
> >> -printf "%s\n" "$ac_prog_version" >&6; }
> >> -fi
> >> -if test $ac_verc_fail = yes; then
> >> -  AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le"
> >> -fi
> >> -
> >> -
> >>  test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5
> >>
> >> diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac
> >> index 48d7089b63..79b3d434e8 100644
> >> --- a/sysdeps/powerpc/powerpc64/le/configure.ac
> >> +++ b/sysdeps/powerpc/powerpc64/le/configure.ac
> >> @@ -66,11 +66,4 @@ CFLAGS="$save_CFLAGS"])
> >>  AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" = "no"],
> >>        [critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."])
> >>
> >> -dnl objcopy (binutils) 2.26 or newer required to support the --update-section
> >> -dnl feature for fixing up .gnu.attribute section with IEEE ldbl.
> >> -AC_CHECK_PROG_VER(OBJCOPY, $OBJCOPY, --version,
> >> -                 [GNU objcopy.* \([0-9]*\.[0-9.]*\)],
> >> -                 [2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
> >> -                 AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le")
> >> -
> >>  test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])
> >> diff --git a/sysdeps/s390/s390-64/s390x-mcount.h b/sysdeps/s390/s390-64/s390x-mcount.h
> >> index b82f1a8e6b..c5bd70d160 100644
> >> --- a/sysdeps/s390/s390-64/s390x-mcount.h
> >> +++ b/sysdeps/s390/s390-64/s390x-mcount.h
> >> @@ -68,11 +68,7 @@ C_LABEL(MCOUNT_SYMBOL)
> >>         /* Save the caller-clobbered registers.  */
> >>         aghi  %r15,-224
> >>         cfi_adjust_cfa_offset (224)
> >> -       /* binutils 2.28+: .cfi_val_offset r15, -160 */
> >> -       .cfi_escape \
> >> -               /* DW_CFA_val_offset */ 0x14, \
> >> -               /* r15 */               0x0f, \
> >> -               /* scaled offset */     0x14
> >> +       cfi_val_offset (r15, -160)
> >>         stmg  %r14,%r5,160(%r15)
> >>         cfi_offset (r14, -224)
> >>         cfi_offset (r0, -224+16)
> >> --
> >> 2.47.0
> >>
> >
> >
>
  
H.J. Lu April 7, 2025, 3:28 p.m. UTC | #5
On Mon, Apr 7, 2025 at 6:32 AM Florian Weimer <fweimer@redhat.com> wrote:
>
> * Stefan Liebler:
>
> > The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
> > GCC version to 12.1 which was released in 2022.
> >
> > The current minimum bintuils version 2.25 was released end of 2014.  This patch
> > now raises the minimum binutils version to 2.39 which was also released in 2022.
> >
> > For ARC and powerpc, the special checks/hints are not needed anymore.
> >
> > On s390x, the used cfi_escape for cfi_val_offset can now be ommitted.
> >
> > In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
> > PIE builds fail on binutils 2.37 and earlier, see:
> > https://sourceware.org/bugzilla/show_bug.cgi?id=28672
> > This patch keeps PIE unsupported and let the machine maintainers test and
> > enable it later.
> >
> > In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
> > are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
> > See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
> > This patch keeps the check as is and let the machine maintainers check if it
> > still required.
>
> The risk here is that this binutils version introduces new relocation
> types into the crt*.o files (or libc_nonshared.a or even libc.a) that
> cannot be handled by older binutils.  This is different from bumping the
> GCC requirement, which usually does not impose a compiler upgrade after
> installing glibc.

Good point.   Do we have tests to check such things?

> Certain binutils versions even treat unknown relocation types as type 0,
> leading to very difficult-to-debug misbehavior (unless you happen to
> recall that you have seen this before …).
>
> Thanks,
> Florian
>
  
Peter Bergner April 7, 2025, 5:06 p.m. UTC | #6
On 4/4/25 9:51 AM, Stefan Liebler wrote:
> The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
> GCC version to 12.1 which was released in 2022.
> 
> The current minimum bintuils version 2.25 was released end of 2014.  This patch
> now raises the minimum binutils version to 2.39 which was also released in 2022.
> 
> For ARC and powerpc, the special checks/hints are not needed anymore.

If the community decides to move the minimum binutils version to 2.26
or later, then I'm fine with removing the then unneeded powerpc 2.26 or
later version check.

Peter
  
H.J. Lu April 9, 2025, 3:54 p.m. UTC | #7
On Mon, Apr 7, 2025 at 8:28 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Mon, Apr 7, 2025 at 6:32 AM Florian Weimer <fweimer@redhat.com> wrote:
> >
> > * Stefan Liebler:
> >
> > > The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
> > > GCC version to 12.1 which was released in 2022.
> > >
> > > The current minimum bintuils version 2.25 was released end of 2014.  This patch
> > > now raises the minimum binutils version to 2.39 which was also released in 2022.
> > >
> > > For ARC and powerpc, the special checks/hints are not needed anymore.
> > >
> > > On s390x, the used cfi_escape for cfi_val_offset can now be ommitted.
> > >
> > > In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
> > > PIE builds fail on binutils 2.37 and earlier, see:
> > > https://sourceware.org/bugzilla/show_bug.cgi?id=28672
> > > This patch keeps PIE unsupported and let the machine maintainers test and
> > > enable it later.
> > >
> > > In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
> > > are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
> > > See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
> > > This patch keeps the check as is and let the machine maintainers check if it
> > > still required.
> >
> > The risk here is that this binutils version introduces new relocation
> > types into the crt*.o files (or libc_nonshared.a or even libc.a) that
> > cannot be handled by older binutils.  This is different from bumping the
> > GCC requirement, which usually does not impose a compiler upgrade after
> > installing glibc.
>
> Good point.   Do we have tests to check such things?
>
> > Certain binutils versions even treat unknown relocation types as type 0,
> > leading to very difficult-to-debug misbehavior (unless you happen to
> > recall that you have seen this before …).

Is this a real problem?  It can happen without raising the minimum binutils
version since glibc may be built with much newer binutils today.
  
Stefan Liebler April 14, 2025, 9:32 a.m. UTC | #8
On 4/7/25 17:26, H.J. Lu wrote:
> On Mon, Apr 7, 2025 at 1:18 AM Stefan Liebler <stli@linux.ibm.com> wrote:
>>
>> On 4/6/25 17:46, H.J. Lu wrote:
>>> On Fri, Apr 4, 2025 at 7:51 AM Stefan Liebler <stli@linux.ibm.com> wrote:
>>>>
>>>> The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
>>>> GCC version to 12.1 which was released in 2022.
>>>>
>>>> The current minimum bintuils version 2.25 was released end of 2014.  This patch
>>>> now raises the minimum binutils version to 2.39 which was also released in 2022.
>>>>
>>>> For ARC and powerpc, the special checks/hints are not needed anymore.
>>>>
>>>> On s390x, the used cfi_escape for cfi_val_offset can now be ommitted.
>>>>
>>>> In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
>>>> PIE builds fail on binutils 2.37 and earlier, see:
>>>> https://sourceware.org/bugzilla/show_bug.cgi?id=28672
>>>> This patch keeps PIE unsupported and let the machine maintainers test and
>>>> enable it later.
>>>>
>>>> In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
>>>> are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
>>>> See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
>>>> This patch keeps the check as is and let the machine maintainers check if it
>>>> still required.
>>>
>>> Man files under sysdeps can be simplified after this.  Should we limit the
>>> first patch to generic files and target maintainers can update target sysdeps
>>> files as needed?
>> Which man-files do you mean? Can you please point me to those?
>>
>> I'm fine with limiting the first patch to generic files. Shall I then
>> drop ARC, powerpc and s390x changes?
>> For ARC, there is no configure-check, but the version is just mentioned
>> in INSTALL & co.
>> For powerpc the version is also mentioned there and there is the
>> configure-check.
>> But I think it is a bit confusing if version 2.39 is required in INSTALL
>> and a few lines below, the versions 2.26/2.32 are still mentioned.
>> Perhaps better keep the ARC/powerpc-stuff in the first patch?
>>
>> For s390x, if wanted, I can split out the cfi_val_offset stuff and
>> immediately send a follow-up patch.
>>
>> Or have you only meant the alpha, hppa, csky and arm stuff which were
>> only mentioned in the commit-message?
> 
> If you exclude
> 
> sysdeps/powerpc/powerpc64/le/configure*
Peter Bergner has already mentioned that it would be okay for him:
https://sourceware.org/pipermail/libc-alpha/2025-April/165776.html

> sysdeps/s390/s390-64/s390x-mcount.h
I, as machine maintainer of s390, have checked with "objdump -WF" /
"-Wf" that the previous cfi_escape and the new cfi_val_offset are equal.
The changes in sysdeps/generic/sysdep.h are not s390-specific and can be
easily reviewed.
> 
> from the first patch, anyone can review it.
But if you prefer, I can exclude those files.
What about the mentions of powerpc/ARC in INSTALL/install.texi? Shall I
keep or remove those?
>

>>>
>>>> ---
>>>>  INSTALL                                   |  9 +--
>>>>  NEWS                                      |  4 +-
>>>>  configure                                 |  4 +-
>>>>  configure.ac                              |  4 +-
>>>>  manual/install.texi                       |  8 +--
>>>>  sysdeps/generic/sysdep.h                  |  3 +
>>>>  sysdeps/powerpc/powerpc64/le/configure    | 70 -----------------------
>>>>  sysdeps/powerpc/powerpc64/le/configure.ac |  7 ---
>>>>  sysdeps/s390/s390-64/s390x-mcount.h       |  6 +-
>>>>  9 files changed, 13 insertions(+), 102 deletions(-)
>>>>
>>>> diff --git a/INSTALL b/INSTALL
>>>> index d3200f271f..2c39c32d4a 100644
>>>> --- a/INSTALL
>>>> +++ b/INSTALL
>>>> @@ -511,20 +511,13 @@ build the GNU C Library:
>>>>       Check the FAQ for any special compiler issues on particular
>>>>       platforms.
>>>>
>>>> -   * GNU 'binutils' 2.25 or later
>>>> +   * GNU 'binutils' 2.39 or later
>>>>
>>>>       You must use GNU 'binutils' (as and ld) to build the GNU C Library.
>>>>       No other assembler or linker has the necessary functionality at the
>>>>       moment.  As of release time, GNU 'binutils' 2.43.1 is the newest
>>>>       verified to work to build the GNU C Library.
>>>>
>>>> -     For PowerPC 64-bits little-endian (powerpc64le), 'objcopy' is
>>>> -     required to support '--update-section'.  This option requires
>>>> -     binutils 2.26 or newer.
>>>> -
>>>> -     ARC architecture needs 'binutils' 2.32 or higher for TLS related
>>>> -     fixes.
>>>> -
>>>>     * GNU 'texinfo' 4.7 or later
>>>>
>>>>       To correctly translate and install the Texinfo documentation you
>>>> diff --git a/NEWS b/NEWS
>>>> index 52cbf1a989..23f590442f 100644
>>>> --- a/NEWS
>>>> +++ b/NEWS
>>>> @@ -24,7 +24,9 @@ Deprecated and removed features, and other changes affecting compatibility:
>>>>
>>>>  Changes to build and runtime requirements:
>>>>
>>>> -  [Add changes to build and runtime requirements here]
>>>> +* GCC 12.1 or later is now required to build the GNU C Library.
>>>> +
>>>> +* GNU Binutils 2.39 or later is now required to build the GNU C Library.
>>>
>>> Please rebase.
>> Sure, I've seen your patch - which is committed in the meanwhile - and
>> just used exactly the same wording. Just rebased locally.
>>>
>>>>  Security related changes:
>>>>
>>>> diff --git a/configure b/configure
>>>> index 7cda641fce..7decd93baa 100755
>>>> --- a/configure
>>>> +++ b/configure
>>>> @@ -5124,7 +5124,7 @@ fi
>>>>
>>>>
>>>>
>>>> -# Accept binutils 2.25 or newer.
>>>> +# Accept binutils 2.39 or newer.
>>>>  libc_cv_with_lld=no
>>>>  case $($LD --version) in
>>>>    "GNU gold"*)
>>>> @@ -5330,7 +5330,7 @@ printf %s "checking version of $LD... " >&6; }
>>>>    ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
>>>>    case $ac_prog_version in
>>>>      '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
>>>> -    2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
>>>> +    2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*)
>>>>         ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
>>>>      *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
>>>>
>>>> diff --git a/configure.ac b/configure.ac
>>>> index 0b0d8875cc..abd3b238d2 100644
>>>> --- a/configure.ac
>>>> +++ b/configure.ac
>>>> @@ -522,7 +522,7 @@ AC_PROG_LN_S
>>>>
>>>>  LIBC_PROG_BINUTILS
>>>>
>>>> -# Accept binutils 2.25 or newer.
>>>> +# Accept binutils 2.39 or newer.
>>>>  libc_cv_with_lld=no
>>>>  case $($LD --version) in
>>>>    "GNU gold"*)
>>>> @@ -543,7 +543,7 @@ case $($LD --version) in
>>>>    *)
>>>>      AC_CHECK_PROG_VER(LD, $LD, --version,
>>>>                     [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
>>>> -                   [2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
>>>> +                   [2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*],
>>>>                     LD=: critic_missing="$critic_missing GNU ld")
>>>>      ;;
>>>>  esac
>>>> diff --git a/manual/install.texi b/manual/install.texi
>>>> index 7fcdda9146..006f93bb71 100644
>>>> --- a/manual/install.texi
>>>> +++ b/manual/install.texi
>>>> @@ -552,19 +552,13 @@ You can use whatever compiler you like to compile programs that use
>>>>  Check the FAQ for any special compiler issues on particular platforms.
>>>>
>>>>  @item
>>>> -GNU @code{binutils} 2.25 or later
>>>> +GNU @code{binutils} 2.39 or later
>>>>
>>>>  You must use GNU @code{binutils} (as and ld) to build @theglibc{}.
>>>>  No other assembler or linker has the necessary functionality at the
>>>>  moment. As of release time, GNU @code{binutils} 2.43.1 is the newest
>>>>  verified to work to build @theglibc{}.
>>>>
>>>> -For PowerPC 64-bits little-endian (powerpc64le), @command{objcopy} is required
>>>> -to support @option{--update-section}.  This option requires binutils 2.26 or
>>>> -newer.
>>>> -
>>>> -ARC architecture needs @code{binutils} 2.32 or higher for TLS related fixes.
>>>> -
>>>>  @item
>>>>  GNU @code{texinfo} 4.7 or later
>>>>
>>>> diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h
>>>> index 4c0dda4d23..ef5eba2c87 100644
>>>> --- a/sysdeps/generic/sysdep.h
>>>> +++ b/sysdeps/generic/sysdep.h
>>>> @@ -45,6 +45,7 @@
>>>>  # define cfi_adjust_cfa_offset(off)    .cfi_adjust_cfa_offset off
>>>>  # define cfi_offset(reg, off)          .cfi_offset reg, off
>>>>  # define cfi_rel_offset(reg, off)      .cfi_rel_offset reg, off
>>>> +# define cfi_val_offset(reg, off)      .cfi_val_offset reg, off
>>>>  # define cfi_register(r1, r2)          .cfi_register r1, r2
>>>>  # define cfi_return_column(reg)        .cfi_return_column reg
>>>>  # define cfi_restore(reg)              .cfi_restore reg
>>>> @@ -74,6 +75,8 @@
>>>>     ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
>>>>  # define CFI_REL_OFFSET(reg, off) \
>>>>     ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
>>>> +# define CFI_VAL_OFFSET(reg, off) \
>>>> +   ".cfi_val_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
>>>>  # define CFI_REGISTER(r1, r2) \
>>>>     ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
>>>>  # define CFI_RETURN_COLUMN(reg) \
>>>> diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure
>>>> index 7092f61bd4..ef17f245a1 100644
>>>> --- a/sysdeps/powerpc/powerpc64/le/configure
>>>> +++ b/sysdeps/powerpc/powerpc64/le/configure
>>>> @@ -137,75 +137,5 @@ then :
>>>>    critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."
>>>>  fi
>>>>
>>>> -for ac_prog in $OBJCOPY
>>>> -do
>>>> -  # Extract the first word of "$ac_prog", so it can be a program name with args.
>>>> -set dummy $ac_prog; ac_word=$2
>>>> -{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
>>>> -printf %s "checking for $ac_word... " >&6; }
>>>> -if test ${ac_cv_prog_OBJCOPY+y}
>>>> -then :
>>>> -  printf %s "(cached) " >&6
>>>> -else case e in #(
>>>> -  e) if test -n "$OBJCOPY"; then
>>>> -  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
>>>> -else
>>>> -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
>>>> -for as_dir in $PATH
>>>> -do
>>>> -  IFS=$as_save_IFS
>>>> -  case $as_dir in #(((
>>>> -    '') as_dir=./ ;;
>>>> -    */) ;;
>>>> -    *) as_dir=$as_dir/ ;;
>>>> -  esac
>>>> -    for ac_exec_ext in '' $ac_executable_extensions; do
>>>> -  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
>>>> -    ac_cv_prog_OBJCOPY="$ac_prog"
>>>> -    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
>>>> -    break 2
>>>> -  fi
>>>> -done
>>>> -  done
>>>> -IFS=$as_save_IFS
>>>> -
>>>> -fi ;;
>>>> -esac
>>>> -fi
>>>> -OBJCOPY=$ac_cv_prog_OBJCOPY
>>>> -if test -n "$OBJCOPY"; then
>>>> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5
>>>> -printf "%s\n" "$OBJCOPY" >&6; }
>>>> -else
>>>> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
>>>> -printf "%s\n" "no" >&6; }
>>>> -fi
>>>> -
>>>> -
>>>> -  test -n "$OBJCOPY" && break
>>>> -done
>>>> -
>>>> -if test -z "$OBJCOPY"; then
>>>> -  ac_verc_fail=yes
>>>> -else
>>>> -  # Found it, now check the version.
>>>> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking version of $OBJCOPY" >&5
>>>> -printf %s "checking version of $OBJCOPY... " >&6; }
>>>> -  ac_prog_version=`$OBJCOPY --version 2>&1 | sed -n 's/^.*GNU objcopy.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
>>>> -  case $ac_prog_version in
>>>> -    '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
>>>> -    2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
>>>> -       ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
>>>> -    *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
>>>> -
>>>> -  esac
>>>> -  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
>>>> -printf "%s\n" "$ac_prog_version" >&6; }
>>>> -fi
>>>> -if test $ac_verc_fail = yes; then
>>>> -  AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le"
>>>> -fi
>>>> -
>>>> -
>>>>  test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5
>>>>
>>>> diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac
>>>> index 48d7089b63..79b3d434e8 100644
>>>> --- a/sysdeps/powerpc/powerpc64/le/configure.ac
>>>> +++ b/sysdeps/powerpc/powerpc64/le/configure.ac
>>>> @@ -66,11 +66,4 @@ CFLAGS="$save_CFLAGS"])
>>>>  AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" = "no"],
>>>>        [critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."])
>>>>
>>>> -dnl objcopy (binutils) 2.26 or newer required to support the --update-section
>>>> -dnl feature for fixing up .gnu.attribute section with IEEE ldbl.
>>>> -AC_CHECK_PROG_VER(OBJCOPY, $OBJCOPY, --version,
>>>> -                 [GNU objcopy.* \([0-9]*\.[0-9.]*\)],
>>>> -                 [2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
>>>> -                 AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le")
>>>> -
>>>>  test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])
>>>> diff --git a/sysdeps/s390/s390-64/s390x-mcount.h b/sysdeps/s390/s390-64/s390x-mcount.h
>>>> index b82f1a8e6b..c5bd70d160 100644
>>>> --- a/sysdeps/s390/s390-64/s390x-mcount.h
>>>> +++ b/sysdeps/s390/s390-64/s390x-mcount.h
>>>> @@ -68,11 +68,7 @@ C_LABEL(MCOUNT_SYMBOL)
>>>>         /* Save the caller-clobbered registers.  */
>>>>         aghi  %r15,-224
>>>>         cfi_adjust_cfa_offset (224)
>>>> -       /* binutils 2.28+: .cfi_val_offset r15, -160 */
>>>> -       .cfi_escape \
>>>> -               /* DW_CFA_val_offset */ 0x14, \
>>>> -               /* r15 */               0x0f, \
>>>> -               /* scaled offset */     0x14
>>>> +       cfi_val_offset (r15, -160)
>>>>         stmg  %r14,%r5,160(%r15)
>>>>         cfi_offset (r14, -224)
>>>>         cfi_offset (r0, -224+16)
>>>> --
>>>> 2.47.0
>>>>
>>>
>>>
>>
> 
>
  
Stefan Liebler April 14, 2025, 9:33 a.m. UTC | #9
On 4/9/25 17:54, H.J. Lu wrote:
> On Mon, Apr 7, 2025 at 8:28 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>>
>> On Mon, Apr 7, 2025 at 6:32 AM Florian Weimer <fweimer@redhat.com> wrote:
>>>
>>> * Stefan Liebler:
>>>
>>>> The recent commit 27b96e069aad17cefea9437542180bff448ac3a0 raises the minimum
>>>> GCC version to 12.1 which was released in 2022.
>>>>
>>>> The current minimum bintuils version 2.25 was released end of 2014.  This patch
>>>> now raises the minimum binutils version to 2.39 which was also released in 2022.
>>>>
>>>> For ARC and powerpc, the special checks/hints are not needed anymore.
>>>>
>>>> On s390x, the used cfi_escape for cfi_val_offset can now be ommitted.
>>>>
>>>> In sysdeps/[alpha|hppa|csky]/configure.ac, PIE is unsupported with this comment:
>>>> PIE builds fail on binutils 2.37 and earlier, see:
>>>> https://sourceware.org/bugzilla/show_bug.cgi?id=28672
>>>> This patch keeps PIE unsupported and let the machine maintainers test and
>>>> enable it later.
>>>>
>>>> In sysdeps/arm/configure.ac, there is a check whether TPOFF relocs with addends
>>>> are assembled correctly, which is known to be broken in binutils 2.24 and 2.25.
>>>> See: https://sourceware.org/bugzilla/show_bug.cgi?id=18383
>>>> This patch keeps the check as is and let the machine maintainers check if it
>>>> still required.
>>>
>>> The risk here is that this binutils version introduces new relocation
>>> types into the crt*.o files (or libc_nonshared.a or even libc.a) that
>>> cannot be handled by older binutils.  This is different from bumping the
>>> GCC requirement, which usually does not impose a compiler upgrade after
>>> installing glibc.
Thus this case would be if a distribution uses an older binutils version
by default, but a recent glibc version, which was built with a newer not
shipped binutils version? Then there are new relocation types in
crt*.o/... files, which can't be handled by the older system binutils
version.

Do you have specific relocation types in mind? I assume those are then
architecture specific? Perhaps we can at least bump the minimum version
to just before the version where those new relocation types were introduced?

On the other hand, how can we then bump the requirements in future at all?
>>
>> Good point.   Do we have tests to check such things?
>>
>>> Certain binutils versions even treat unknown relocation types as type 0,
>>> leading to very difficult-to-debug misbehavior (unless you happen to
>>> recall that you have seen this before …).
> 
> Is this a real problem?  It can happen without raising the minimum binutils
> version since glibc may be built with much newer binutils today.
True, distributions or others could have this situation even without
this patch.
Are there known reasons why to use newer glibc/gcc versions, but keep an
old binutils version?
  
Florian Weimer April 14, 2025, 10 a.m. UTC | #10
* Stefan Liebler:

> Thus this case would be if a distribution uses an older binutils version
> by default, but a recent glibc version, which was built with a newer not
> shipped binutils version? Then there are new relocation types in
> crt*.o/... files, which can't be handled by the older system binutils
> version.
>
> Do you have specific relocation types in mind? I assume those are then
> architecture specific? Perhaps we can at least bump the minimum version
> to just before the version where those new relocation types were introduced?

Typically, it's for relocations that enable new relaxations.  Completely
new features tend to not be used in glibc .o files that are used for
linking applications.

Come to think of it, the bug we saw once the PCREL relocations were
added to x86-64 was about the wrong strip program being called during
the build (system binutils instead the newer version).  So this
potential glibc linking issue likely isn't a problem in practice.

Thanks,
Florian
  

Patch

diff --git a/INSTALL b/INSTALL
index d3200f271f..2c39c32d4a 100644
--- a/INSTALL
+++ b/INSTALL
@@ -511,20 +511,13 @@  build the GNU C Library:
      Check the FAQ for any special compiler issues on particular
      platforms.
 
-   * GNU 'binutils' 2.25 or later
+   * GNU 'binutils' 2.39 or later
 
      You must use GNU 'binutils' (as and ld) to build the GNU C Library.
      No other assembler or linker has the necessary functionality at the
      moment.  As of release time, GNU 'binutils' 2.43.1 is the newest
      verified to work to build the GNU C Library.
 
-     For PowerPC 64-bits little-endian (powerpc64le), 'objcopy' is
-     required to support '--update-section'.  This option requires
-     binutils 2.26 or newer.
-
-     ARC architecture needs 'binutils' 2.32 or higher for TLS related
-     fixes.
-
    * GNU 'texinfo' 4.7 or later
 
      To correctly translate and install the Texinfo documentation you
diff --git a/NEWS b/NEWS
index 52cbf1a989..23f590442f 100644
--- a/NEWS
+++ b/NEWS
@@ -24,7 +24,9 @@  Deprecated and removed features, and other changes affecting compatibility:
 
 Changes to build and runtime requirements:
 
-  [Add changes to build and runtime requirements here]
+* GCC 12.1 or later is now required to build the GNU C Library.
+
+* GNU Binutils 2.39 or later is now required to build the GNU C Library.
 
 Security related changes:
 
diff --git a/configure b/configure
index 7cda641fce..7decd93baa 100755
--- a/configure
+++ b/configure
@@ -5124,7 +5124,7 @@  fi
 
 
 
-# Accept binutils 2.25 or newer.
+# Accept binutils 2.39 or newer.
 libc_cv_with_lld=no
 case $($LD --version) in
   "GNU gold"*)
@@ -5330,7 +5330,7 @@  printf %s "checking version of $LD... " >&6; }
   ac_prog_version=`$LD --version 2>&1 | sed -n 's/^.*GNU ld.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
   case $ac_prog_version in
     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-    2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
+    2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*)
        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
 
diff --git a/configure.ac b/configure.ac
index 0b0d8875cc..abd3b238d2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -522,7 +522,7 @@  AC_PROG_LN_S
 
 LIBC_PROG_BINUTILS
 
-# Accept binutils 2.25 or newer.
+# Accept binutils 2.39 or newer.
 libc_cv_with_lld=no
 case $($LD --version) in
   "GNU gold"*)
@@ -543,7 +543,7 @@  case $($LD --version) in
   *)
     AC_CHECK_PROG_VER(LD, $LD, --version,
 		    [GNU ld.* \([0-9][0-9]*\.[0-9.]*\)],
-		    [2.1[0-9][0-9]*|2.2[5-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
+		    [2.[1-9][0-9][0-9]*|2.39*|2.[4-9][0-9]*|[3-9].*|[1-9][0-9]*],
 		    LD=: critic_missing="$critic_missing GNU ld")
     ;;
 esac
diff --git a/manual/install.texi b/manual/install.texi
index 7fcdda9146..006f93bb71 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -552,19 +552,13 @@  You can use whatever compiler you like to compile programs that use
 Check the FAQ for any special compiler issues on particular platforms.
 
 @item
-GNU @code{binutils} 2.25 or later
+GNU @code{binutils} 2.39 or later
 
 You must use GNU @code{binutils} (as and ld) to build @theglibc{}.
 No other assembler or linker has the necessary functionality at the
 moment. As of release time, GNU @code{binutils} 2.43.1 is the newest
 verified to work to build @theglibc{}.
 
-For PowerPC 64-bits little-endian (powerpc64le), @command{objcopy} is required
-to support @option{--update-section}.  This option requires binutils 2.26 or
-newer.
-
-ARC architecture needs @code{binutils} 2.32 or higher for TLS related fixes.
-
 @item
 GNU @code{texinfo} 4.7 or later
 
diff --git a/sysdeps/generic/sysdep.h b/sysdeps/generic/sysdep.h
index 4c0dda4d23..ef5eba2c87 100644
--- a/sysdeps/generic/sysdep.h
+++ b/sysdeps/generic/sysdep.h
@@ -45,6 +45,7 @@ 
 # define cfi_adjust_cfa_offset(off)	.cfi_adjust_cfa_offset off
 # define cfi_offset(reg, off)		.cfi_offset reg, off
 # define cfi_rel_offset(reg, off)	.cfi_rel_offset reg, off
+# define cfi_val_offset(reg, off)	.cfi_val_offset reg, off
 # define cfi_register(r1, r2)		.cfi_register r1, r2
 # define cfi_return_column(reg)	.cfi_return_column reg
 # define cfi_restore(reg)		.cfi_restore reg
@@ -74,6 +75,8 @@ 
    ".cfi_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
 # define CFI_REL_OFFSET(reg, off) \
    ".cfi_rel_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
+# define CFI_VAL_OFFSET(reg, off) \
+   ".cfi_val_offset " CFI_STRINGIFY(reg) "," CFI_STRINGIFY(off)
 # define CFI_REGISTER(r1, r2) \
    ".cfi_register " CFI_STRINGIFY(r1) "," CFI_STRINGIFY(r2)
 # define CFI_RETURN_COLUMN(reg) \
diff --git a/sysdeps/powerpc/powerpc64/le/configure b/sysdeps/powerpc/powerpc64/le/configure
index 7092f61bd4..ef17f245a1 100644
--- a/sysdeps/powerpc/powerpc64/le/configure
+++ b/sysdeps/powerpc/powerpc64/le/configure
@@ -137,75 +137,5 @@  then :
   critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."
 fi
 
-for ac_prog in $OBJCOPY
-do
-  # Extract the first word of "$ac_prog", so it can be a program name with args.
-set dummy $ac_prog; ac_word=$2
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
-printf %s "checking for $ac_word... " >&6; }
-if test ${ac_cv_prog_OBJCOPY+y}
-then :
-  printf %s "(cached) " >&6
-else case e in #(
-  e) if test -n "$OBJCOPY"; then
-  ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test.
-else
-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
-for as_dir in $PATH
-do
-  IFS=$as_save_IFS
-  case $as_dir in #(((
-    '') as_dir=./ ;;
-    */) ;;
-    *) as_dir=$as_dir/ ;;
-  esac
-    for ac_exec_ext in '' $ac_executable_extensions; do
-  if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then
-    ac_cv_prog_OBJCOPY="$ac_prog"
-    printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5
-    break 2
-  fi
-done
-  done
-IFS=$as_save_IFS
-
-fi ;;
-esac
-fi
-OBJCOPY=$ac_cv_prog_OBJCOPY
-if test -n "$OBJCOPY"; then
-  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $OBJCOPY" >&5
-printf "%s\n" "$OBJCOPY" >&6; }
-else
-  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5
-printf "%s\n" "no" >&6; }
-fi
-
-
-  test -n "$OBJCOPY" && break
-done
-
-if test -z "$OBJCOPY"; then
-  ac_verc_fail=yes
-else
-  # Found it, now check the version.
-  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking version of $OBJCOPY" >&5
-printf %s "checking version of $OBJCOPY... " >&6; }
-  ac_prog_version=`$OBJCOPY --version 2>&1 | sed -n 's/^.*GNU objcopy.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
-  case $ac_prog_version in
-    '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-    2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*)
-       ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
-    *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
-
-  esac
-  { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_prog_version" >&5
-printf "%s\n" "$ac_prog_version" >&6; }
-fi
-if test $ac_verc_fail = yes; then
-  AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le"
-fi
-
-
 test -n "$critic_missing" && as_fn_error $? "*** $critic_missing" "$LINENO" 5
 
diff --git a/sysdeps/powerpc/powerpc64/le/configure.ac b/sysdeps/powerpc/powerpc64/le/configure.ac
index 48d7089b63..79b3d434e8 100644
--- a/sysdeps/powerpc/powerpc64/le/configure.ac
+++ b/sysdeps/powerpc/powerpc64/le/configure.ac
@@ -66,11 +66,4 @@  CFLAGS="$save_CFLAGS"])
 AS_IF([test "$libc_cv_compiler_powerpc64le_ldbl128_mabi" = "no"],
       [critic_missing="$critic_missing The compiler must support -mabi=ieeelongdouble and -mlong-double-128 simultaneously."])
 
-dnl objcopy (binutils) 2.26 or newer required to support the --update-section
-dnl feature for fixing up .gnu.attribute section with IEEE ldbl.
-AC_CHECK_PROG_VER(OBJCOPY, $OBJCOPY, --version,
-		  [GNU objcopy.* \([0-9]*\.[0-9.]*\)],
-		  [2.1[0-9][0-9]*|2.2[6-9]*|2.[3-9][0-9]*|[3-9].*|[1-9][0-9]*],
-		  AS=: critic_missing="$critic_missing objcopy >= 2.26 is required on powerpc64le")
-
 test -n "$critic_missing" && AC_MSG_ERROR([*** $critic_missing])
diff --git a/sysdeps/s390/s390-64/s390x-mcount.h b/sysdeps/s390/s390-64/s390x-mcount.h
index b82f1a8e6b..c5bd70d160 100644
--- a/sysdeps/s390/s390-64/s390x-mcount.h
+++ b/sysdeps/s390/s390-64/s390x-mcount.h
@@ -68,11 +68,7 @@  C_LABEL(MCOUNT_SYMBOL)
 	/* Save the caller-clobbered registers.  */
 	aghi  %r15,-224
 	cfi_adjust_cfa_offset (224)
-	/* binutils 2.28+: .cfi_val_offset r15, -160 */
-	.cfi_escape \
-		/* DW_CFA_val_offset */ 0x14, \
-		/* r15 */               0x0f, \
-		/* scaled offset */     0x14
+	cfi_val_offset (r15, -160)
 	stmg  %r14,%r5,160(%r15)
 	cfi_offset (r14, -224)
 	cfi_offset (r0, -224+16)