[PATCH] Raise the minimum binutils version to 2.39

Stefan Liebler stli@linux.ibm.com
Mon Apr 14 09:32:58 GMT 2025


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



More information about the Libc-alpha mailing list