[PATCH v3 1/2] configure: Disable SFrame backtracing
claudiu.zissulescu-ianculescu@oracle.com
claudiu.zissulescu-ianculescu@oracle.com
Thu Jul 17 13:43:27 GMT 2025
From: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
The SFrame backtracing is experimental, disable it by default. SFrame
backtracing can be enabled using "--enable-sframe" while configuring
glibc.
Signed-off-by: Claudiu Zissulescu <claudiu.zissulescu-ianculescu@oracle.com>
---
INSTALL | 9 +++++----
NEWS | 7 ++++---
config.make.in | 1 -
configure | 19 ++++++++++---------
configure.ac | 16 ++++++++--------
manual/install.texi | 9 +++++----
6 files changed, 32 insertions(+), 29 deletions(-)
diff --git a/INSTALL b/INSTALL
index cf60e1a380..7d55d87c6c 100644
--- a/INSTALL
+++ b/INSTALL
@@ -291,10 +291,11 @@ passed to 'configure'. For example:
Default is to disable fortification.
-'--disable-sframe'
- By default, the GNU C Library is built with '-Wa,--gsframe' if the
- current GNU 'binutils' supports it. You may want to use this
- option if you don't plan to use SFrame stack tracer.
+'--enable-sframe'
+ Experimental option supported by selected architectures (e.g.
+ x86_64 and AArch64), the GNU C Library is built with
+ '-Wa,--gsframe' if the current GNU 'binutils' supports it. You may
+ want to use this option if you plan to use SFrame stack tracer.
To build the library and related programs, type 'make'. This will
produce a lot of output, some of which may look like errors from 'make'
diff --git a/NEWS b/NEWS
index 9a92dd098a..0ef13600d5 100644
--- a/NEWS
+++ b/NEWS
@@ -31,9 +31,10 @@ Major new features:
glibc.malloc.tcache_max to a larger value (max 4194304).
Tcache is also significantly faster for small sizes.
-* New stack tracer using SFrame. Introducing --disable-sframe a new
- configuration flag. Building glibc using sframe is automatically
- enabled when the build system supports it.
+* A new stack tracer based on SFrame format has been added for x86_64
+ and AArch64 architectures. It requires Binutils version >= 2.45. To
+ enable compilation with SFrame support in glibc, use "--enable-sframe"
+ configuration option.
Deprecated and removed features, and other changes affecting compatibility:
diff --git a/config.make.in b/config.make.in
index 382e003d87..59897eaec2 100644
--- a/config.make.in
+++ b/config.make.in
@@ -51,7 +51,6 @@ c++-cstdlib-header = @CXX_CSTDLIB_HEADER@
c++-cmath-header = @CXX_CMATH_HEADER@
c++-bits-std_abs-h = @CXX_BITS_STD_ABS_H@
enable-werror = @enable_werror@
-enable-gsframe = @enable_gsframe@
have-z-execstack = @libc_cv_z_execstack@
have-no-error-execstack = @libc_cv_no_error_execstack@
diff --git a/configure b/configure
index 6595d6be54..0afb8a19f2 100755
--- a/configure
+++ b/configure
@@ -620,7 +620,6 @@ DEFINES
static_nss
profile
libc_cv_multidir
-enable_gsframe
READELF_SFRAME
libc_cv_test_x86_have_amx_tile
test_enable_cet
@@ -1510,8 +1509,8 @@ Optional Features:
Use -D_FORTIFY_SOURCE=[1|2|3] to control code
hardening, defaults to highest possible value
supported by the build compiler.
- --disable-sframe Disable building with SFrame stack trace information
- [default=yes if GNU as is 2.41 or older]
+ --enable-sframe Enable building with SFrame stack trace information
+ [default=no]
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -4895,7 +4894,7 @@ if test ${enable_sframe+y}
then :
enableval=$enable_sframe; use_sframe=$enableval
else case e in #(
- e) use_sframe=notset ;;
+ e) use_sframe=no ;;
esac
fi
@@ -9416,7 +9415,7 @@ printf %s "checking version of $READELF_SFRAME... " >&6; }
ac_prog_version=`$READELF_SFRAME --version 2>&1 | sed -n 's/^.*GNU readelf.* \([0-9][0-9]*\.[0-9.]*\).*$/\1/p'`
case $ac_prog_version in
'') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
- 2.4[1-9]*|2.[5-9][0-9]*|[3-9].*|[1-9][0-9][0-9]*)
+ 2.4[5-9]*|2.[5-9][0-9]*|[3-9].*|[1-9][0-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;;
@@ -9459,16 +9458,18 @@ fi
# Prevent enabling sframe on non-supporting toolchains
enable_gsframe=no
-if test $use_sframe$libc_cv_default_sframe = yesyes || \
- test $use_sframe$libc_cv_default_sframe = notsetyes; then
- enable_gsframe=yes
+if test $use_sframe$libc_cv_default_sframe = yesyes; then
+ enable_gsframe=yes
+ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ...and using SFrame for this build" >&5
+printf "%s\n" "...and using SFrame for this build" >&6; }
elif test $use_sframe = yes; then
{ { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in '$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in '$ac_pwd':" >&2;}
as_fn_error $? "toolchain doesn't support SFrame v2 or higher
See 'config.log' for more details" "$LINENO" 5; }
fi
-
+config_vars="$config_vars
+enable-gsframe = $enable_gsframe"
# Set the `multidir' variable by grabbing the variable from the compiler.
# We do it once and save the result in a generated makefile.
diff --git a/configure.ac b/configure.ac
index 25b80e34e4..97ec2ace93 100644
--- a/configure.ac
+++ b/configure.ac
@@ -441,10 +441,10 @@ case "$enable_fortify_source" in
esac
AC_ARG_ENABLE([sframe],
- [AS_HELP_STRING([--disable-sframe],
- [Disable building with SFrame stack trace information @<:@default=yes if GNU as is 2.41 or older@:>@])],
+ [AS_HELP_STRING([--enable-sframe],
+ [Enable building with SFrame stack trace information @<:@default=no@:>@])],
[use_sframe=$enableval],
- [use_sframe=notset])
+ [use_sframe=no])
# We keep the original values in `$config_*' and never modify them, so we
# can write them unchanged into config.make. Everything else uses
@@ -2126,7 +2126,7 @@ libc_cv_readelf_version_ok=yes
# SFrame is supported from 2.41 or higher
AC_CHECK_PROG_VER(READELF_SFRAME, $READELF, --version,
[GNU readelf.* \([0-9][0-9]*\.[0-9.]*\)],
- [2.4[1-9]*|2.[5-9][0-9]*|[3-9].*|[1-9][0-9][0-9]*],
+ [2.4[5-9]*|2.[5-9][0-9]*|[3-9].*|[1-9][0-9][0-9]*],
libc_cv_readelf_version_ok=no)
# Check the current toolchain for SFrame support
@@ -2151,13 +2151,13 @@ fi
# Prevent enabling sframe on non-supporting toolchains
enable_gsframe=no
-if test $use_sframe$libc_cv_default_sframe = yesyes || \
- test $use_sframe$libc_cv_default_sframe = notsetyes; then
- enable_gsframe=yes
+if test $use_sframe$libc_cv_default_sframe = yesyes; then
+ enable_gsframe=yes
+ AC_MSG_RESULT(...and using SFrame for this build)
elif test $use_sframe = yes; then
AC_MSG_FAILURE([toolchain doesn't support SFrame v2 or higher])
fi
-AC_SUBST(enable_gsframe)
+LIBC_CONFIG_VAR([enable-gsframe], [$enable_gsframe])
# Set the `multidir' variable by grabbing the variable from the compiler.
# We do it once and save the result in a generated makefile.
diff --git a/manual/install.texi b/manual/install.texi
index 0c8d448362..187f4314cb 100644
--- a/manual/install.texi
+++ b/manual/install.texi
@@ -321,10 +321,11 @@ 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 selected architectures (e.g. x86_64
+and AArch64), @theglibc{} is built with @option{-Wa,--gsframe} if the
+current GNU @code{binutils} supports it. You may want to use this
+option if you plan to use SFrame stack tracer.
@end table
To build the library and related programs, type @code{make}. This will
--
2.50.1
More information about the Libc-alpha
mailing list