aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac90
1 files changed, 88 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index 0b0d887..4480ae8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -440,6 +440,12 @@ case "$enable_fortify_source" in
*) AC_MSG_ERROR([Not a valid argument for --enable-fortify-source: "$enable_fortify_source"]);;
esac
+AC_ARG_ENABLE([sframe],
+ [AS_HELP_STRING([--enable-sframe],
+ [Enable building with SFrame support @<:@default=no@:>@])],
+ [use_sframe=$enableval],
+ [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
# $machine, $vendor, and $os, and changes them whenever convenient.
@@ -483,6 +489,9 @@ with_fp_cond=1
# A preconfigure script may define another name to TLS descriptor variant
mtls_descriptor=gnu2
+# A preconfigure script may define another name to traditional TLS variant
+mtls_traditional=gnu
+
dnl Let sysdeps/*/preconfigure act here.
LIBC_PRECONFIGURE([$srcdir], [for sysdeps])
@@ -522,7 +531,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 +552,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
@@ -1401,6 +1410,16 @@ LIBC_TRY_TEST_CC_COMMAND([for tls descriptor support],
LIBC_CONFIG_VAR([have-test-mtls-descriptor],
[$libc_cv_test_mtls_descriptor])
+dnl Check if TEST_CC support traditional tls.
+LIBC_TRY_TEST_CC_COMMAND([for traditional tls support],
+ [$conftest_code],
+ [-fPIC -mtls-dialect=$mtls_traditional -nostdlib -nostartfiles -shared],
+ libc_cv_test_mtls_traditional,
+ [libc_cv_test_mtls_traditional=$mtls_traditional],
+ [libc_cv_test_mtls_traditional=no])
+LIBC_CONFIG_VAR([have-test-mtls-traditional],
+ [$libc_cv_test_mtls_traditional])
+
dnl clang emits an warning for a double alias redirection, to warn the
dnl original symbol is sed even when weak definition overrides it.
dnl It is a usual pattern for weak_alias, where multiple alias point to
@@ -1575,6 +1594,29 @@ LIBC_CONFIG_VAR([cc-option-wimplicit-fallthrough],
[$libc_cv_cc_wimplicit_fallthrough])
AC_SUBST(libc_cv_test_cc_wimplicit_fallthrough)
+LIBC_TRY_CC_AND_TEST_CC_OPTION([for -Wfree-labels],
+ [-Werror -Wfree-labels],
+ libc_cv_cc_wfree_labels,
+ [libc_cv_cc_wfree_labels=-Wfree-labels],
+ [libc_cv_cc_wfree_labels=],
+ libc_cv_test_cc_wfree_labels,
+ [libc_cv_test_cc_wfree_labels=-Wfree-labels],
+ [libc_cv_test_cc_wfree_labels=])
+LIBC_CONFIG_VAR([cc-option-wfree-labels], [$libc_cv_cc_wfree_labels])
+AC_SUBST(libc_cv_test_cc_wfree_labels)
+
+LIBC_TRY_CC_AND_TEST_CC_OPTION([for -Wmissing-parameter-name],
+ [-Werror -Wmissing-parameter-name],
+ libc_cv_cc_wmissing_parameter_name,
+ [libc_cv_cc_wmissing_parameter_name=-Wmissing-parameter-name],
+ [libc_cv_cc_wmissing_parameter_name=],
+ libc_cv_test_cc_wmissing_parameter_name,
+ [libc_cv_test_cc_wmissing_parameter_name=-Wmissing-parameter-name],
+ [libc_cv_test_cc_wmissing_parameter_name=])
+LIBC_CONFIG_VAR([cc-option-wmissing-parameter-name],
+ [$libc_cv_cc_wmissing_parameter_name])
+AC_SUBST(libc_cv_test_cc_wmissing_parameter_name)
+
conftest_code="
void bar (void (*callback) (void));
int foo (void)
@@ -2079,6 +2121,50 @@ AC_SUBST(libc_cv_test_cc_mprefer_vector_width)
AC_SUBST(test_enable_cet)
AC_SUBST(libc_cv_test_x86_have_amx_tile)
+enable_gsframe=no
+if test $use_sframe = yes; then
+ # SFrame requires to be explicit enabled by the architecture
+ if test -z $libc_cv_support_sframe; then
+ AC_MSG_FAILURE([the architecture doesn't support SFrame])
+ fi
+
+ # SFrame requires binutils 2.45 or higher.
+ libc_cv_sframe_readelf_version=yes
+ AC_CHECK_PROG_VER(READELF, $READELF, --version,
+ [GNU readelf.* \([0-9][0-9]*\.[0-9.]*\)],
+ [2.4[5-9]*|2.[5-9][0-9]*|2.[1-9][0-9][0-9]*|[3-9]*|[1-9][0-9]*],
+ libc_cv_sframe_readelf_version=no)
+ if test $libc_cv_sframe_readelf_version = no; then
+ AC_MSG_FAILURE([binutils too old to enable SFrame])
+ fi
+
+ # Check if the current toolchain supports SFrame
+ AC_CACHE_CHECK([for SFrame support], libc_cv_default_sframe,
+ [dnl
+cat > conftest.c <<EOF
+int test_function(void)
+{
+ return 42;
+}
+EOF
+ libc_cv_default_sframe=no
+ if ${CC} -c conftest.c -o conftest.o -Wa,--gsframe >/dev/null 2>&1 && \
+ # Check if .sframe section is present and if version > 1
+ $READELF --sframe conftest.o | grep "SFRAME_VER" | grep -qv "VERSION_1"; then
+ libc_cv_default_sframe=yes
+ fi
+ rm -f conftest.c conftest.o
+ ])
+
+ if test $libc_cv_default_sframe = no; then
+ AC_MSG_FAILURE([toolchain doesn't support SFrame v2 or higher])
+ fi
+
+ enable_gsframe=yes
+ AC_DEFINE(ENABLE_SFRAME)
+fi
+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.
libc_cv_multidir=`${CC-cc} $CFLAGS $CPPFLAGS -print-multi-directory`