]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Rename have-mtls-descriptor to have-test-mtls-descriptor
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 3 Jan 2025 02:21:56 +0000 (10:21 +0800)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 3 Jan 2025 20:51:21 +0000 (04:51 +0800)
Since have-mtls-descriptor is only used for glibc testing, rename it to
have-test-mtls-descriptor.  Also enable tst-gnu2-tls2-amx only if
$(have-test-mtls-descriptor) == gnu2.

Tested with GCC 14 and Clang 19/18/17 on x86-64.

Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
Reviewed-by: Sam James <sam@gentoo.org>
Makefile.in
configure
configure.ac
elf/Makefile
sysdeps/arm/Makefile
sysdeps/unix/sysv/linux/x86_64/Makefile

index 0aab15ce4d8a98c6d1c579366c6ca65e04d690a4..8b02cc3b0374fdf51c2f12d2a076563796453ec1 100644 (file)
@@ -8,7 +8,6 @@ test-config-cflags-signaling-nans = @libc_cv_test_cc_signaling_nans@
 test-config-cflags-wno-ignored-attributes = @libc_cv_test_wno_ignored_attributes@
 test-enable-cet = @test_enable_cet@
 test-have-mamx-tile = @libc_cv_test_x86_have_amx_tile@
-test-have-mtls-descriptor = @libc_cv_test_mtls_descriptor@
 test-have-static-pie = @libc_cv_test_static_pie@
 test-supported-fortify = @libc_cv_test_supported_fortify_source@
 
@@ -29,7 +28,6 @@ check xcheck test:
                config-cflags-wno-ignored-attributes="$(test-config-cflags-wno-ignored-attributes)" \
                enable-cet="$(test-enable-cet)" \
                have-mamx-tile="$(test-have-mamx-tile)" \
-               have-mtls-descriptor="$(test-have-mtls-descriptor)" \
                have-static-pie="$(test-have-static-pie)" \
                supported-fortify="$(test-supported-fortify)" \
                objdir=`pwd` $@
index 4f77900818b5cc869e53e588833e373e0621ec93..b410ee4bd9dc0d39b5fd0c6e8de05459b9091c93 100755 (executable)
--- a/configure
+++ b/configure
@@ -655,7 +655,6 @@ libc_cv_test_cc_signaling_nans
 libc_cv_cc_submachine
 libc_cv_cc_nofma
 libc_cv_test_wno_ignored_attributes
-libc_cv_test_mtls_descriptor
 libc_cv_has_glob_dat
 libc_cv_fpie
 libc_cv_test_static_pie
@@ -7422,31 +7421,6 @@ void foo (void)
 cat > conftest.c <<EOF
 $conftest_code
 EOF
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for tls descriptor support" >&5
-printf %s "checking for tls descriptor support... " >&6; }
-if test ${libc_cv_mtls_descriptor+y}
-then :
-  printf %s "(cached) " >&6
-else case e in #(
-  e)   if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=$mtls_descriptor -nostdlib -nostartfiles -shared conftest.c -o conftest 1>&5'
-  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
-  (eval $ac_try) 2>&5
-  ac_status=$?
-  printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
-  test $ac_status = 0; }; }
-  then
-    libc_cv_mtls_descriptor=$mtls_descriptor
-  else
-    libc_cv_mtls_descriptor=no
-  fi
- ;;
-esac
-fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mtls_descriptor" >&5
-printf "%s\n" "$libc_cv_mtls_descriptor" >&6; }
-if test "$TEST_CC" = "$CC"; then
-  libc_cv_test_mtls_descriptor=$libc_cv_mtls_descriptor
-else
 
 saved_CC="$CC"
 CC="$TEST_CC"
@@ -7456,17 +7430,17 @@ if test ${libc_cv_test_mtls_descriptor+y}
 then :
   printf %s "(cached) " >&6
 else case e in #(
-  e)       if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=$mtls_descriptor -nostdlib -nostartfiles -shared conftest.c -o conftest 1>&5'
+  e)     if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=$mtls_descriptor -nostdlib -nostartfiles -shared conftest.c -o conftest 1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
-      then
-       libc_cv_test_mtls_descriptor=$mtls_descriptor
-      else
-       libc_cv_test_mtls_descriptor=no
-      fi ;;
+    then
+      libc_cv_test_mtls_descriptor=$mtls_descriptor
+    else
+      libc_cv_test_mtls_descriptor=no
+    fi ;;
 esac
 fi
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_test_mtls_descriptor" >&5
@@ -7474,11 +7448,9 @@ printf "%s\n" "$libc_cv_test_mtls_descriptor" >&6; }
 
 CC="$saved_CC"
 
-fi
 rm -f conftest*
 config_vars="$config_vars
-have-mtls-descriptor = $libc_cv_mtls_descriptor"
-
+have-test-mtls-descriptor = $libc_cv_test_mtls_descriptor"
 
 conftest_code="
 void __foo (void)
index 5f60b523bb2c9eb594bd5db5a1a2dd3672de3a9d..9af8d541e596e2f0b0f61dd750df4c02c7c3c3a8 100644 (file)
@@ -1386,17 +1386,15 @@ void foo (void)
   i = 10;
 }
 "
-LIBC_TRY_CC_AND_TEST_CC_COMMAND([for tls descriptor support],
+dnl Check if TEST_CC support tls descriptor.
+LIBC_TRY_TEST_CC_COMMAND([for tls descriptor support],
   [$conftest_code],
   [-fPIC -mtls-dialect=$mtls_descriptor -nostdlib -nostartfiles -shared],
-  libc_cv_mtls_descriptor,
-  [libc_cv_mtls_descriptor=$mtls_descriptor],
-  [libc_cv_mtls_descriptor=no],
   libc_cv_test_mtls_descriptor,
   [libc_cv_test_mtls_descriptor=$mtls_descriptor],
   [libc_cv_test_mtls_descriptor=no])
-LIBC_CONFIG_VAR([have-mtls-descriptor], [$libc_cv_mtls_descriptor])
-AC_SUBST(libc_cv_test_mtls_descriptor)
+LIBC_CONFIG_VAR([have-test-mtls-descriptor],
+               [$libc_cv_test_mtls_descriptor])
 
 dnl clang emits an warning for a double alias redirection, to warn the
 dnl original symbol is sed even when weak definition overrides it.
index 597bb6cf4b3a6e88569c68564c099fb8729e3547..e3db643a309136c9cc3e23d44f61ce5002312428 100644 (file)
@@ -1106,13 +1106,13 @@ modules-names-tests = $(filter-out ifuncmod% tst-tlsmod% \
 # For +depfiles in Makerules.
 extra-test-objs += tst-auditmod17.os
 
-ifneq (no,$(have-mtls-descriptor))
+ifneq (no,$(have-test-mtls-descriptor))
 tests += tst-gnu2-tls1
 modules-names += tst-gnu2-tls1mod
 $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
 tst-gnu2-tls1mod.so-no-z-defs = yes
-CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=$(have-mtls-descriptor)
-endif # $(have-mtls-descriptor)
+CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=$(have-test-mtls-descriptor)
+endif # $(have-test-mtls-descriptor)
 
 ifeq (yes,$(have-protected-data))
 modules-names += tst-protected1moda tst-protected1modb
@@ -3174,11 +3174,11 @@ $(objpfx)tst-tls-allocation-failure-static-patched.out: \
 $(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
                            $(objpfx)tst-audit-tlsdesc-mod2.so \
                            $(shared-thread-library)
-ifneq (no,$(have-mtls-descriptor))
+ifneq (no,$(have-test-mtls-descriptor))
 # The test is valid for all TLS types, but we want to exercise GNU2
 # TLS if possible.
-CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=$(have-mtls-descriptor)
+CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=$(have-test-mtls-descriptor)
 endif
 $(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
 $(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
@@ -3257,13 +3257,13 @@ $(objpfx)tst-gnu2-tls2.out: \
   $(objpfx)tst-gnu2-tls2mod1.so \
   $(objpfx)tst-gnu2-tls2mod2.so
 
-ifneq (no,$(have-mtls-descriptor))
-CFLAGS-tst-tlsgap-mod0.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-tlsgap-mod1.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-tlsgap-mod2.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-gnu2-tls2mod0.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-gnu2-tls2mod1.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-gnu2-tls2mod2.c += -mtls-dialect=$(have-mtls-descriptor)
+ifneq (no,$(have-test-mtls-descriptor))
+CFLAGS-tst-tlsgap-mod0.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-tlsgap-mod1.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-tlsgap-mod2.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-gnu2-tls2mod0.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-gnu2-tls2mod1.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-gnu2-tls2mod2.c += -mtls-dialect=$(have-test-mtls-descriptor)
 endif
 
 $(objpfx)tst-recursive-tls: $(objpfx)tst-recursive-tlsmallocmod.so
@@ -3342,10 +3342,10 @@ $(objpfx)tst-tls22-mod1-gnu2.so: $(objpfx)tst-tls22-mod1-gnu2.os \
   $(objpfx)tst-tls22-mod1-vars.os $(objpfx)tst-tls22-mod2-gnu2.so
 $(objpfx)tst-tls22-mod2-gnu2.so: $(objpfx)tst-tls22-mod2-gnu2.os \
   $(objpfx)tst-tls22-mod2-vars.os
-ifneq (no,$(have-mtls-descriptor))
-CFLAGS-tst-tls22-gnu2.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-tls22-mod1-gnu2.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-tls22-mod2-gnu2.c += -mtls-dialect=$(have-mtls-descriptor)
+ifneq (no,$(have-test-mtls-descriptor))
+CFLAGS-tst-tls22-gnu2.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-tls22-mod1-gnu2.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-tls22-mod2-gnu2.c += -mtls-dialect=$(have-test-mtls-descriptor)
 endif
 # These reference symbols from the main executable.
 tst-tls22-mod1.so-no-z-defs = yes
index 619474eca94fe8e4787ffbc740760562af2dcab4..9c4fd6b236967d91f8300a9b61aa84d58083c694 100644 (file)
@@ -13,15 +13,15 @@ $(objpfx)libgcc-stubs.a: $(objpfx)aeabi_unwind_cpp_pr1.os
 lib-noranlib: $(objpfx)libgcc-stubs.a
 
 ifeq ($(build-shared),yes)
-ifneq (no,$(have-mtls-descriptor))
+ifneq (no,$(have-test-mtls-descriptor))
 tests += tst-armtlsdescloc tst-armtlsdescextnow tst-armtlsdescextlazy
 modules-names += tst-armtlsdesclocmod
 modules-names += tst-armtlsdescextlazymod tst-armtlsdescextnowmod
 CPPFLAGS-tst-armtlsdescextnowmod.c += -Dstatic=
 CPPFLAGS-tst-armtlsdescextlazymod.c += -Dstatic=
-CFLAGS-tst-armtlsdesclocmod.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-armtlsdescextnowmod.c += -mtls-dialect=$(have-mtls-descriptor)
-CFLAGS-tst-armtlsdescextlazymod.c += -mtls-dialect=$(have-mtls-descriptor)
+CFLAGS-tst-armtlsdesclocmod.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-armtlsdescextnowmod.c += -mtls-dialect=$(have-test-mtls-descriptor)
+CFLAGS-tst-armtlsdescextlazymod.c += -mtls-dialect=$(have-test-mtls-descriptor)
 LDFLAGS-tst-armtlsdescextnowmod.so += -Wl,-z,now
 tst-armtlsdescloc-ENV = LD_BIND_NOW=1
 tst-armtlsdescextnow-ENV = LD_BIND_NOW=1
index fcbffd81cbaa031d7b75ed29e9b374d342ce9bb2..fb834a7089ac3ba2c0fdd1d2135a088d59f40093 100644 (file)
@@ -67,7 +67,7 @@ $(objpfx)libx86-64-isa-level.so: $(objpfx)libx86-64-isa-level-1.so
        cp $< $@
 endif
 
-ifeq (yes,$(have-mamx-tile))
+ifeq (yesgnu2,$(have-mamx-tile)$(have-test-mtls-descriptor))
 tests += \
   tst-gnu2-tls2-amx \
 # tests