[PATCH v3 1/3] Disable SFrame support by default

Andreas K. Huettel dilfridge@gentoo.org
Tue Jul 22 19:44:52 GMT 2025


Am Dienstag, 22. Juli 2025, 17:55:50 Mitteleuropäische Sommerzeit schrieb Adhemerval Zanella:
> And add extra checks to enable for binutils 2.45 and if the archicture
> explicitly enables it.  When SFrame is disabled, all the related code
> is also not enabled for backtrace() and _dl_find_object(), so SFrame
> backtracking is not used even if the binary has the SFrame segment.
> 
> This patch also adds some other related fixes:
> 
>   * Fixed an issue with AC_CHECK_PROG_VER, where the READELF_SFRAME
>     usage prevented specifying a different readelf through READELF
>     environment variable at configure time.
> 
>   * Add an extra arch-specific internal definition,
>     libc_cv_support_sframe, to disable --enable-sframe on architectures
>     that have binutils but not glibc support (s390x).
> 
>   * Renamed the tests without the .sframe segment and move the
>     tst-backtrace1 from pthread to debug.
> 
>   * Use the built compiler strip to remove the .sframe segment,
>     instead of the system one (which might not support SFrame).
> 
> Checked on x86_64-linux-gnu and aarch64-linux-gnu.
> 

Reviewed-by: Andreas K. Huettel <dilfridge@gentoo.org>

(minor nits below)

> Reviewed-by: Sam James <sam@gentoo.org>
> ---
>  INSTALL                                     |  9 +--
>  aclocal.m4                                  |  4 ++
>  config.h.in                                 |  3 +
>  config.make.in                              |  2 +-
>  configure                                   | 68 ++++++++++++---------
>  configure.ac                                | 32 +++++-----
>  debug/Makefile                              | 16 +++--
>  debug/backtrace.c                           |  8 +++
>  {sysdeps/pthread => debug}/tst-backtrace1.c |  0
>  elf/dl-find_object.h                        | 10 +++
>  manual/install.texi                         | 11 ++--
>  sysdeps/aarch64/configure                   |  2 +
>  sysdeps/aarch64/configure.ac                |  2 +
>  sysdeps/generic/Makefile                    |  2 +
>  sysdeps/pthread/Makefile                    |  1 -
>  sysdeps/x86_64/configure                    |  2 +
>  sysdeps/x86_64/configure.ac                 |  2 +
>  17 files changed, 116 insertions(+), 58 deletions(-)
>  rename {sysdeps/pthread => debug}/tst-backtrace1.c (100%)
> 

[...]

> @@ -117,6 +122,9 @@ __backtrace (void **array, int size)
>  
>    /* Try the dwarf unwinder.  */
>    if (arg.unwind_link == NULL)
> +#else
> +  if (arg.unwind_link == NULL)
> +#endif
>      return 0;

why the odd duplication?

[...]

> --- a/manual/install.texi
> +++ b/manual/install.texi
> @@ -321,10 +321,13 @@ the build compiler.
>  
>  Default is to disable fortification.
>  
> -@item --disable-sframe
> -By default, the GNU C Library is built with @option{-Wa,--gsframe} if
> -the current GNU @code{binutils} supports it. You may want to use this
> -option if you don't plan to use SFrame stack tracer.
> +@item --enable-sframe
> +Experimental option supported by some architectures, where @theglibc{}i

Experimental option supported by some architectures, where @theglibc{}
(no i at end)

> +is built with @option{-Wa,--gsframe} if the @code{binutils} supports it.
> +Currently it is only support on x86_64 and aarch64 it is required te
> +enable SFrame support on @code{backtrace} and @code{_dl_find_object}.

is built with @option{-Wa,--gsframe} if @code{binutils} support it.
Currently this is only supported on x86_64 and aarch64. The option
enables SFrame support on @code{backtrace} and @code{_dl_find_object}.

> +
> +Default is to disable SFrame support.
>  @end table
>  


-- 
Andreas K. Hüttel
dilfridge@gentoo.org
Gentoo Linux developer
(council, toolchain, base-system, perl, libreoffice)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 981 bytes
Desc: This is a digitally signed message part.
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20250722/cd88c6a8/attachment.sig>


More information about the Libc-alpha mailing list