public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
* [PATCH 0/3] Extending TLS testing and fixing TLS gnu2 for ARM
@ 2024-02-29 19:46 Adhemerval Zanella
  2024-02-29 19:46 ` [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2 Adhemerval Zanella
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2024-02-29 19:46 UTC (permalink / raw)
  To: libc-alpha; +Cc: Szabolcs Nagy, H . J . Lu

A recent x86 fix for TLS descriptors [1] uncovered an ARM issue on
_dl_tlsdesc_dynamic where it fails to save/restore all possible
register.

And checking if aarch64 is also affected, I noted that the TLS
descriptor tests are only enabled iff -mtls-dialect= accepts 'gnu2'.
Since aarch64 uses a different naming for the TLS abi
(traditional/desc), some tests are not enabled.  The last patch fixes
it by parametrizing the TLS descriptor dialect name.

[1] https://sourceware.org/pipermail/libc-alpha/2024-February/154995.html

Adhemerval Zanella (3):
  Ignore undefined symbols for -mtls-dialect=gnu2
  arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ
    31372)
  elf: Enable TLS descriptor tests on aarch64

 config.h.in                  |  3 ++
 configure                    | 25 +++++-----
 configure.ac                 | 17 ++++---
 elf/Makefile                 | 30 +++++------
 elf/tst-gnu2-tls2.h          |  4 ++
 elf/tst-gnu2-tls2mod0.c      |  3 +-
 elf/tst-gnu2-tls2mod1.c      |  3 +-
 elf/tst-gnu2-tls2mod2.c      |  3 +-
 sysdeps/aarch64/preconfigure |  1 +
 sysdeps/arm/Makefile         |  8 +--
 sysdeps/arm/configure        | 32 ++++++++++++
 sysdeps/arm/configure.ac     | 15 ++++++
 sysdeps/arm/dl-tlsdesc.S     | 70 +++++++++++++++++++++++---
 sysdeps/arm/tst-gnu2-tls2.h  | 96 ++++++++++++++++++++++++++++++++++++
 14 files changed, 260 insertions(+), 50 deletions(-)
 create mode 100644 sysdeps/arm/tst-gnu2-tls2.h

-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2
  2024-02-29 19:46 [PATCH 0/3] Extending TLS testing and fixing TLS gnu2 for ARM Adhemerval Zanella
@ 2024-02-29 19:46 ` Adhemerval Zanella
  2024-03-05 20:07   ` H.J. Lu
  2024-02-29 19:46 ` [PATCH 2/3] arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ 31372) Adhemerval Zanella
  2024-02-29 19:46 ` [PATCH 3/3] elf: Enable TLS descriptor tests on aarch64 Adhemerval Zanella
  2 siblings, 1 reply; 9+ messages in thread
From: Adhemerval Zanella @ 2024-02-29 19:46 UTC (permalink / raw)
  To: libc-alpha; +Cc: Szabolcs Nagy, H . J . Lu

So it is not fail for arm config that defaults to -mtp=soft (which
issues a call to __aeabi_read_tp).
---
 configure    | 2 +-
 configure.ac | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 59ff1e415d..ab8a10ed92 100755
--- a/configure
+++ b/configure
@@ -7020,7 +7020,7 @@ void foo (void)
 }
 EOF
 if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
-		   conftest.c -o conftest 1>&5'
+		   -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
   ac_status=$?
diff --git a/configure.ac b/configure.ac
index 65799e5685..4bb9aeef95 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1297,7 +1297,7 @@ void foo (void)
 }
 EOF
 if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
-		   conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD])
+		   -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD])
 then
   libc_cv_mtls_dialect_gnu2=yes
 else
-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 2/3] arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ 31372)
  2024-02-29 19:46 [PATCH 0/3] Extending TLS testing and fixing TLS gnu2 for ARM Adhemerval Zanella
  2024-02-29 19:46 ` [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2 Adhemerval Zanella
@ 2024-02-29 19:46 ` Adhemerval Zanella
  2024-02-29 19:46 ` [PATCH 3/3] elf: Enable TLS descriptor tests on aarch64 Adhemerval Zanella
  2 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella @ 2024-02-29 19:46 UTC (permalink / raw)
  To: libc-alpha; +Cc: Szabolcs Nagy, H . J . Lu

ARM _dl_tlsdesc_dynamic slow path shows two issues:

  * The ip/r12 is defined by AAPCS as a scratch register, and gcc is
    used
    to save the stack pointer before on some function calls.  So it
    should also be saved/restored as well.  It fixes the tst-gnu2-tls2.

  * None of the possible VFP registers are saved/restored.  ARM has the
    additional complexity to have different VFP bank sizes (depending of
    VFP support by the chip).

The tst-gnu2-tls2 test is extended to check for VFP registers, although
only for HWCAP_ARM_VFP | HWCAP_ARM_VFPD32.  Different than setcontext,
this does not have HWCAP_ARM_IWMMXT (I don't have a way to properly test
it and it is almost a decade since newer hardware was released).

With this patch there is no need to mark tst-gnu2-tls2 as XFAIL.

Checked on arm-linux-gnueabihf.
---
 config.h.in                 |  3 ++
 elf/Makefile                |  4 --
 elf/tst-gnu2-tls2.h         |  4 ++
 elf/tst-gnu2-tls2mod0.c     |  3 +-
 elf/tst-gnu2-tls2mod1.c     |  3 +-
 elf/tst-gnu2-tls2mod2.c     |  3 +-
 sysdeps/arm/configure       | 32 +++++++++++++
 sysdeps/arm/configure.ac    | 15 ++++++
 sysdeps/arm/dl-tlsdesc.S    | 70 +++++++++++++++++++++++----
 sysdeps/arm/tst-gnu2-tls2.h | 96 +++++++++++++++++++++++++++++++++++++
 10 files changed, 218 insertions(+), 15 deletions(-)
 create mode 100644 sysdeps/arm/tst-gnu2-tls2.h

diff --git a/config.h.in b/config.h.in
index 2f0669e19b..cf4212f5eb 100644
--- a/config.h.in
+++ b/config.h.in
@@ -141,6 +141,9 @@
 /* LOONGARCH floating-point ABI for ld.so.  */
 #undef LOONGARCH_ABI_FRLEN
 
+/* Define whether ARM used hard-float and support VFPvX-D32.  */
+#undef HAVE_ARM_PCS_VFP_D32
+
 /* Linux specific: minimum supported kernel version.  */
 #undef	__LINUX_KERNEL_VERSION
 
diff --git a/elf/Makefile b/elf/Makefile
index 02dc476e27..a300cf2602 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -3056,10 +3056,6 @@ $(objpfx)tst-gnu2-tls2.out: \
   $(objpfx)tst-gnu2-tls2mod2.so
 
 ifeq (yes,$(have-mtls-dialect-gnu2))
-# This test fails if dl_tlsdesc_dynamic doesn't preserve all caller-saved
-# registers.  See https://sourceware.org/bugzilla/show_bug.cgi?id=31372
-test-xfail-tst-gnu2-tls2 = yes
-
 CFLAGS-tst-tlsgap-mod0.c += -mtls-dialect=gnu2
 CFLAGS-tst-tlsgap-mod1.c += -mtls-dialect=gnu2
 CFLAGS-tst-tlsgap-mod2.c += -mtls-dialect=gnu2
diff --git a/elf/tst-gnu2-tls2.h b/elf/tst-gnu2-tls2.h
index 77964a57a3..1ade8151e2 100644
--- a/elf/tst-gnu2-tls2.h
+++ b/elf/tst-gnu2-tls2.h
@@ -27,6 +27,10 @@ extern struct tls *apply_tls (struct tls *);
 
 /* An architecture can define them to verify that clobber caller-saved
    registers aren't changed by the implicit TLSDESC call.  */
+#ifndef INIT_TLSDESC_CALL
+# define INIT_TLSDESC_CALL()
+#endif
+
 #ifndef BEFORE_TLSDESC_CALL
 # define BEFORE_TLSDESC_CALL()
 #endif
diff --git a/elf/tst-gnu2-tls2mod0.c b/elf/tst-gnu2-tls2mod0.c
index 45556a0e17..3fe3c14277 100644
--- a/elf/tst-gnu2-tls2mod0.c
+++ b/elf/tst-gnu2-tls2mod0.c
@@ -16,13 +16,14 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include "tst-gnu2-tls2.h"
+#include <tst-gnu2-tls2.h>
 
 __thread struct tls tls_var0 __attribute__ ((visibility ("hidden")));
 
 struct tls *
 apply_tls (struct tls *p)
 {
+  INIT_TLSDESC_CALL ();
   BEFORE_TLSDESC_CALL ();
   tls_var0 = *p;
   struct tls *ret = &tls_var0;
diff --git a/elf/tst-gnu2-tls2mod1.c b/elf/tst-gnu2-tls2mod1.c
index e10b9dbc0a..e210538468 100644
--- a/elf/tst-gnu2-tls2mod1.c
+++ b/elf/tst-gnu2-tls2mod1.c
@@ -16,13 +16,14 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include "tst-gnu2-tls2.h"
+#include <tst-gnu2-tls2.h>
 
 __thread struct tls tls_var1[100] __attribute__ ((visibility ("hidden")));
 
 struct tls *
 apply_tls (struct tls *p)
 {
+  INIT_TLSDESC_CALL ();
   BEFORE_TLSDESC_CALL ();
   tls_var1[1] = *p;
   struct tls *ret = &tls_var1[1];
diff --git a/elf/tst-gnu2-tls2mod2.c b/elf/tst-gnu2-tls2mod2.c
index 141af51e55..6d3031dc5f 100644
--- a/elf/tst-gnu2-tls2mod2.c
+++ b/elf/tst-gnu2-tls2mod2.c
@@ -16,13 +16,14 @@
    License along with the GNU C Library; if not, see
    <https://www.gnu.org/licenses/>.  */
 
-#include "tst-gnu2-tls2.h"
+#include <tst-gnu2-tls2.h>
 
 __thread struct tls tls_var2 __attribute__ ((visibility ("hidden")));
 
 struct tls *
 apply_tls (struct tls *p)
 {
+  INIT_TLSDESC_CALL ();
   BEFORE_TLSDESC_CALL ();
   tls_var2 = *p;
   struct tls *ret = &tls_var2;
diff --git a/sysdeps/arm/configure b/sysdeps/arm/configure
index 35e2918922..4ef4d46cbd 100644
--- a/sysdeps/arm/configure
+++ b/sysdeps/arm/configure
@@ -187,6 +187,38 @@ else
 default-abi = soft"
 fi
 
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether VFP supports 32 registers" >&5
+printf %s "checking whether VFP supports 32 registers... " >&6; }
+if test ${libc_cv_arm_pcs_vfp_d32+y}
+then :
+  printf %s "(cached) " >&6
+else $as_nop
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+void foo (void)
+{
+  asm volatile ("vldr d16,=17" : : : "d16");
+}
+
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"
+then :
+  libc_cv_arm_pcs_vfp_d32=yes
+else $as_nop
+  libc_cv_arm_pcs_vfp_d32=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_arm_pcs_vfp_d32" >&5
+printf "%s\n" "$libc_cv_arm_pcs_vfp_d32" >&6; }
+if test "$libc_cv_arm_pcs_vfp_d32" = yes ;
+then
+  printf "%s\n" "#define HAVE_ARM_PCS_VFP_D32 1" >>confdefs.h
+
+fi
+
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether PC-relative relocs in movw/movt work properly" >&5
 printf %s "checking whether PC-relative relocs in movw/movt work properly... " >&6; }
 if test ${libc_cv_arm_pcrel_movw+y}
diff --git a/sysdeps/arm/configure.ac b/sysdeps/arm/configure.ac
index 5172e30bbe..cd00ddc9d9 100644
--- a/sysdeps/arm/configure.ac
+++ b/sysdeps/arm/configure.ac
@@ -21,6 +21,21 @@ else
   LIBC_CONFIG_VAR([default-abi], [soft])
 fi
 
+AC_CACHE_CHECK([whether VFP supports 32 registers],
+		libc_cv_arm_pcs_vfp_d32, [
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
+void foo (void)
+{
+  asm volatile ("vldr d16,=17" : : : "d16");
+}
+]])],
+                [libc_cv_arm_pcs_vfp_d32=yes],
+                [libc_cv_arm_pcs_vfp_d32=no])])
+if test "$libc_cv_arm_pcs_vfp_d32" = yes ;
+then
+  AC_DEFINE(HAVE_ARM_PCS_VFP_D32)
+fi
+
 AC_CACHE_CHECK([whether PC-relative relocs in movw/movt work properly],
 	       libc_cv_arm_pcrel_movw, [
 cat > conftest.s <<\EOF
diff --git a/sysdeps/arm/dl-tlsdesc.S b/sysdeps/arm/dl-tlsdesc.S
index 764c56e70f..5c395fd22d 100644
--- a/sysdeps/arm/dl-tlsdesc.S
+++ b/sysdeps/arm/dl-tlsdesc.S
@@ -19,6 +19,7 @@
 #include <sysdep.h>
 #include <arm-features.h>
 #include <tls.h>
+#include <rtld-global-offsets.h>
 #include "tlsdesc.h"
 
 	.text
@@ -83,14 +84,20 @@ _dl_tlsdesc_dynamic(struct tlsdesc *tdp)
 	.align 2
 _dl_tlsdesc_dynamic:
 	/* Our calling convention is to clobber r0, r1 and the processor
-	   flags.  All others that are modified must be saved */
-	eabi_save ({r2,r3,r4,lr})
-	push	{r2,r3,r4,lr}
-	cfi_adjust_cfa_offset (16)
+	   flags.  All others that are modified must be saved.  r5 is
+	   used as the hwcap value to avoid reload after __tls_get_Addr
+	   call.  If required we will save the vector register on the slow
+	   patch if required.  */
+	eabi_save ({r2,r3,r4,r5,ip,lr})
+	push	{r2,r3,r4,r5,ip,lr}
+	cfi_adjust_cfa_offset (24)
 	cfi_rel_offset (r2,0)
 	cfi_rel_offset (r3,4)
 	cfi_rel_offset (r4,8)
-	cfi_rel_offset (lr,12)
+	cfi_rel_offset (r5,12)
+	cfi_rel_offset (ip,16)
+	cfi_rel_offset (lr,20)
+
 	ldr	r1, [r0] /* td */
 	GET_TLS (lr)
 	mov	r4, r0 /* r4 = tp */
@@ -113,22 +120,69 @@ _dl_tlsdesc_dynamic:
 	rsbne	r0, r4, r3
 	bne	2f
 1:	mov	r0, r1
+
+	/* Load the hwcap to check for vector support.  */
+	ldr     r2, 3f
+	ldr     r1, .Lrtld_global_ro
+0:	add     r2, pc, r2
+	ldr     r2, [r2, r1]
+	ldr     r5, [r2, #RTLD_GLOBAL_RO_DL_HWCAP_OFFSET]
+
+#ifdef __SOFTFP__
+	tst     r5, #HWCAP_ARM_VFP
+	beq     .Lno_vfp
+#endif
+
+	/* Store the VFP registers.  Don't use VFP instructions directly
+	   because this code is used in non-VFP multilibs.  */
+#define VFP_STACK_REQ (32*8 + 8)
+	sub	sp, sp, VFP_STACK_REQ
+	cfi_adjust_cfa_offset (VFP_STACK_REQ)
+	mov	r3, sp
+	.inst	0xeca30b20	/* vstmia r3!, {d0-d15} */
+	tst	r5, #HWCAP_ARM_VFPD32
+	beq	4f
+	.inst	0xece30b20	/* vstmia r3!, {d16-d31}  */
+	/* Store the floating-point status register.  */
+4:	.inst	0xeef12a10	/* vmrs	r2, fpscr */
+	str	r2, [r3]
+.Lno_vfp:
 	bl	__tls_get_addr
 	rsb	r0, r4, r0
+#ifdef __SOFTFP__
+	tst     r5, #HWCAP_ARM_VFP
+	beq     2f
+#endif
+	mov	r3, sp
+	.inst	0xecb30b20	/* vldmia r3!, {d0-d15}  */
+	tst	r5, #HWCAP_ARM_VFPD32
+	beq	5f
+	.inst	0xecf30b20	/* vldmia r3!, {d16-d31}  */
+	ldr	r4, [r3]
+5:	.inst	0xeee14a10	/* vmsr	fpscr, r4  */
+	add	sp, sp, VFP_STACK_REQ
+	cfi_adjust_cfa_offset (-VFP_STACK_REQ)
+
 2:
 #if ((defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)) \
      || defined (ARM_ALWAYS_BX))
-	pop	{r2,r3,r4, lr}
-	cfi_adjust_cfa_offset (-16)
+	pop	{r2,r3,r4,r5,ip, lr}
+	cfi_adjust_cfa_offset (-20)
 	cfi_restore (lr)
+	cfi_restore (ip)
+	cfi_restore (r5)
 	cfi_restore (r4)
 	cfi_restore (r3)
 	cfi_restore (r2)
 	bx	lr
 #else
-	pop	{r2,r3,r4, pc}
+	pop	{r2,r3,r4,r5,ip, pc}
 #endif
 	eabi_fnend
 	cfi_endproc
 	.size	_dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic
+
+3:      .long   _GLOBAL_OFFSET_TABLE_ - 0b - PC_OFS
+.Lrtld_global_ro:
+	.long   C_SYMBOL_NAME(_rtld_global_ro)(GOT)
 #endif /* SHARED */
diff --git a/sysdeps/arm/tst-gnu2-tls2.h b/sysdeps/arm/tst-gnu2-tls2.h
new file mode 100644
index 0000000000..7a73d7d1df
--- /dev/null
+++ b/sysdeps/arm/tst-gnu2-tls2.h
@@ -0,0 +1,96 @@
+/* Test TLSDESC relocation.  ARM version.
+   Copyright (C) 2024 Free Software Foundation, Inc.
+   This file is part of the GNU C Library.
+
+   The GNU C Library is free software; you can redistribute it and/or
+   modify it under the terms of the GNU Lesser General Public
+   License as published by the Free Software Foundation; either
+   version 2.1 of the License, or (at your option) any later version.
+
+   The GNU C Library is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+   Lesser General Public License for more details.
+
+   You should have received a copy of the GNU Lesser General Public
+   License along with the GNU C Library; if not, see
+   <https://www.gnu.org/licenses/>.  */
+
+#include <config.h>
+#include <sys/auxv.h>
+#include <string.h>
+#include <stdlib.h>
+#include <endian.h>
+
+#ifdef HAVE_ARM_PCS_VFP_D32
+# define INIT_TLSDESC_CALL()				\
+  unsigned long hwcap = getauxval (AT_HWCAP)
+
+/* Set each vector register to a value from 1 to 32 before the TLS access,
+   dump to memory after TLS access, and compare with the expected values.  */
+
+# define BEFORE_TLSDESC_CALL()				\
+  if (hwcap & (HWCAP_ARM_VFP | HWCAP_ARM_VFPD32))	\
+    {							\
+      asm volatile ("vldr  d0,=1" : : : "d0");		\
+      asm volatile ("vldr  d1,=2" : : : "d1");		\
+      asm volatile ("vldr  d2,=3" : : : "d1");		\
+      asm volatile ("vldr  d3,=4" : : : "d3");		\
+      asm volatile ("vldr  d4,=5" : : : "d4");		\
+      asm volatile ("vldr  d5,=6" : : : "d5");		\
+      asm volatile ("vldr  d6,=7" : : : "d6");		\
+      asm volatile ("vldr  d7,=8" : : : "d7");		\
+      asm volatile ("vldr  d8,=9" : : : "d8");		\
+      asm volatile ("vldr  d9,=10" : : : "d9");		\
+      asm volatile ("vldr d10,=11" : : : "d10");	\
+      asm volatile ("vldr d11,=12" : : : "d11");	\
+      asm volatile ("vldr d12,=13" : : : "d12");	\
+      asm volatile ("vldr d13,=14" : : : "d13");	\
+      asm volatile ("vldr d14,=15" : : : "d14");	\
+      asm volatile ("vldr d15,=16" : : : "d15");	\
+      asm volatile ("vldr d16,=17" : : : "d16");	\
+      asm volatile ("vldr d17,=18" : : : "d17");	\
+      asm volatile ("vldr d18,=19" : : : "d18");	\
+      asm volatile ("vldr d19,=20" : : : "d19");	\
+      asm volatile ("vldr d20,=21" : : : "d20");	\
+      asm volatile ("vldr d21,=22" : : : "d21");	\
+      asm volatile ("vldr d22,=23" : : : "d22");	\
+      asm volatile ("vldr d23,=24" : : : "d23");	\
+      asm volatile ("vldr d24,=25" : : : "d24");	\
+      asm volatile ("vldr d25,=26" : : : "d25");	\
+      asm volatile ("vldr d26,=27" : : : "d26");	\
+      asm volatile ("vldr d27,=28" : : : "d27");	\
+      asm volatile ("vldr d28,=29" : : : "d28");	\
+      asm volatile ("vldr d29,=30" : : : "d29");	\
+      asm volatile ("vldr d30,=31" : : : "d30");	\
+      asm volatile ("vldr d31,=32" : : : "d31");	\
+    }
+
+# define VFP_STACK_REQ (32*8)
+# if __BYTE_ORDER == __BIG_ENDIAN
+#  define DISP 7
+# else
+#  define DISP 0
+# endif
+
+# define AFTER_TLSDESC_CALL()						\
+  if (hwcap & HWCAP_ARM_VFP)						\
+    {									\
+      char vfp[VFP_STACK_REQ];						\
+      asm volatile ("vstmia %0, {d0-d15}\n"				\
+		    "vstmia %1, {d16-d31}\n"				\
+		    :							\
+		    : "r" (vfp), "r" (vfp + 128)			\
+		    : "memory");					\
+									\
+      char expected[VFP_STACK_REQ];					\
+      memset (expected, 0, sizeof expected);				\
+      for (int i = 0; i < 32; ++i)					\
+	expected[i * 8 + DISP] = i + 1;					\
+									\
+      if (memcmp (vfp, expected, VFP_STACK_REQ) != 0)			\
+        abort ();							\
+    }
+#endif
+
+#include_next <tst-gnu2-tls2.h>
-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 3/3] elf: Enable TLS descriptor tests on aarch64
  2024-02-29 19:46 [PATCH 0/3] Extending TLS testing and fixing TLS gnu2 for ARM Adhemerval Zanella
  2024-02-29 19:46 ` [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2 Adhemerval Zanella
  2024-02-29 19:46 ` [PATCH 2/3] arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ 31372) Adhemerval Zanella
@ 2024-02-29 19:46 ` Adhemerval Zanella
  2024-03-11 12:31   ` Szabolcs Nagy
  2 siblings, 1 reply; 9+ messages in thread
From: Adhemerval Zanella @ 2024-02-29 19:46 UTC (permalink / raw)
  To: libc-alpha; +Cc: Szabolcs Nagy, H . J . Lu

The aarch64 uses a different name than x86 and arm (trad instead
os gnu2).  Use it to check whether to enable the TLS descriptor
tests.

Also rename the internal machinery fron gnu2 to tls descriptors.

Checked on aarch64-linux-gnu.
---
 configure                    | 23 +++++++++++++----------
 configure.ac                 | 15 +++++++++------
 elf/Makefile                 | 26 +++++++++++++-------------
 sysdeps/aarch64/preconfigure |  1 +
 sysdeps/arm/Makefile         |  8 ++++----
 5 files changed, 40 insertions(+), 33 deletions(-)

diff --git a/configure b/configure
index ab8a10ed92..034ac9017a 100755
--- a/configure
+++ b/configure
@@ -653,7 +653,7 @@ LIBGD
 libc_cv_cc_loop_to_function
 libc_cv_cc_submachine
 libc_cv_cc_nofma
-libc_cv_mtls_dialect_gnu2
+libc_cv_mtls_descriptor
 libc_cv_has_glob_dat
 libc_cv_fpie
 libc_cv_z_execstack
@@ -4760,6 +4760,9 @@ libc_config_ok=no
 # whether to use such directories.
 with_fp_cond=1
 
+# A preconfigure script may define another name to TLS descriptor variant
+mtls_descriptor=gnu2
+
 if frags=`ls -d $srcdir/sysdeps/*/preconfigure 2> /dev/null`
 then
   { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for sysdeps preconfigure fragments" >&5
@@ -7006,9 +7009,9 @@ fi
 printf "%s\n" "$libc_cv_has_glob_dat" >&6; }
 
 
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for -mtls-dialect=gnu2" >&5
-printf %s "checking for -mtls-dialect=gnu2... " >&6; }
-if test ${libc_cv_mtls_dialect_gnu2+y}
+{ 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 $as_nop
@@ -7019,7 +7022,7 @@ void foo (void)
   i = 10;
 }
 EOF
-if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
+if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=$mtls_descriptor -nostdlib -nostartfiles
 		   -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&5'
   { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
   (eval $ac_try) 2>&5
@@ -7027,17 +7030,17 @@ if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nost
   printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
   test $ac_status = 0; }; }
 then
-  libc_cv_mtls_dialect_gnu2=yes
+  libc_cv_mtls_descriptor=$mtls_descriptor
 else
-  libc_cv_mtls_dialect_gnu2=no
+  libc_cv_mtls_descriptor=no
 fi
 rm -f conftest*
 fi
-{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mtls_dialect_gnu2" >&5
-printf "%s\n" "$libc_cv_mtls_dialect_gnu2" >&6; }
+{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $libc_cv_mtls_descriptor" >&5
+printf "%s\n" "$libc_cv_mtls_descriptor" >&6; }
 
 config_vars="$config_vars
-have-mtls-dialect-gnu2 = $libc_cv_mtls_dialect_gnu2"
+have-mtls-descriptor = $libc_cv_mtls_descriptor"
 
 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if -Wno-ignored-attributes is required for aliases" >&5
 printf %s "checking if -Wno-ignored-attributes is required for aliases... " >&6; }
diff --git a/configure.ac b/configure.ac
index 4bb9aeef95..ddfb2876a3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -442,6 +442,9 @@ libc_config_ok=no
 # whether to use such directories.
 with_fp_cond=1
 
+# A preconfigure script may define another name to TLS descriptor variant
+mtls_descriptor=gnu2
+
 dnl Let sysdeps/*/preconfigure act here.
 LIBC_PRECONFIGURE([$srcdir], [for sysdeps])
 
@@ -1287,7 +1290,7 @@ fi
 rm -f conftest*])
 AC_SUBST(libc_cv_has_glob_dat)
 
-AC_CACHE_CHECK([for -mtls-dialect=gnu2], libc_cv_mtls_dialect_gnu2,
+AC_CACHE_CHECK([for tls descriptor support], libc_cv_mtls_descriptor,
 [dnl
 cat > conftest.c <<EOF
 __thread int i;
@@ -1296,16 +1299,16 @@ void foo (void)
   i = 10;
 }
 EOF
-if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=$mtls_descriptor -nostdlib -nostartfiles
 		   -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD])
 then
-  libc_cv_mtls_dialect_gnu2=yes
+  libc_cv_mtls_descriptor=$mtls_descriptor
 else
-  libc_cv_mtls_dialect_gnu2=no
+  libc_cv_mtls_descriptor=no
 fi
 rm -f conftest*])
-AC_SUBST(libc_cv_mtls_dialect_gnu2)
-LIBC_CONFIG_VAR([have-mtls-dialect-gnu2], [$libc_cv_mtls_dialect_gnu2])
+AC_SUBST(libc_cv_mtls_descriptor)
+LIBC_CONFIG_VAR([have-mtls-descriptor], [$libc_cv_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.
diff --git a/elf/Makefile b/elf/Makefile
index a300cf2602..ebbe1bcf3f 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -999,13 +999,13 @@ modules-names-tests = $(filter-out ifuncmod% tst-tlsmod%,\
 # For +depfiles in Makerules.
 extra-test-objs += tst-auditmod17.os
 
-ifeq (yes,$(have-mtls-dialect-gnu2))
+ifneq (no,$(have-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=gnu2
-endif # $(have-mtls-dialect-gnu2)
+CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=$(have-mtls-descriptor)
+endif # $(have-mtls-descriptor)
 
 ifeq (yes,$(have-protected-data))
 modules-names += tst-protected1moda tst-protected1modb
@@ -2972,11 +2972,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)
-ifeq (yes,$(have-mtls-dialect-gnu2))
+ifneq (no,$(have-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=gnu2
-CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
+CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=$(have-mtls-descriptor)
+CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=$(have-mtls-descriptor)
 endif
 $(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library)
 $(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
@@ -3055,11 +3055,11 @@ $(objpfx)tst-gnu2-tls2.out: \
   $(objpfx)tst-gnu2-tls2mod1.so \
   $(objpfx)tst-gnu2-tls2mod2.so
 
-ifeq (yes,$(have-mtls-dialect-gnu2))
-CFLAGS-tst-tlsgap-mod0.c += -mtls-dialect=gnu2
-CFLAGS-tst-tlsgap-mod1.c += -mtls-dialect=gnu2
-CFLAGS-tst-tlsgap-mod2.c += -mtls-dialect=gnu2
-CFLAGS-tst-gnu2-tls2mod0.c += -mtls-dialect=gnu2
-CFLAGS-tst-gnu2-tls2mod1.c += -mtls-dialect=gnu2
-CFLAGS-tst-gnu2-tls2mod2.c += -mtls-dialect=gnu2
+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)
 endif
diff --git a/sysdeps/aarch64/preconfigure b/sysdeps/aarch64/preconfigure
index d9bd1f8558..89edb0c9a2 100644
--- a/sysdeps/aarch64/preconfigure
+++ b/sysdeps/aarch64/preconfigure
@@ -2,5 +2,6 @@ case "$machine" in
 aarch64*)
 	base_machine=aarch64
 	machine=aarch64
+	mtls_descriptor=trad
 	;;
 esac
diff --git a/sysdeps/arm/Makefile b/sysdeps/arm/Makefile
index d5cea717a9..619474eca9 100644
--- a/sysdeps/arm/Makefile
+++ b/sysdeps/arm/Makefile
@@ -13,15 +13,15 @@ $(objpfx)libgcc-stubs.a: $(objpfx)aeabi_unwind_cpp_pr1.os
 lib-noranlib: $(objpfx)libgcc-stubs.a
 
 ifeq ($(build-shared),yes)
-ifeq (yes,$(have-mtls-dialect-gnu2))
+ifneq (no,$(have-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=gnu2
-CFLAGS-tst-armtlsdescextnowmod.c += -mtls-dialect=gnu2
-CFLAGS-tst-armtlsdescextlazymod.c += -mtls-dialect=gnu2
+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)
 LDFLAGS-tst-armtlsdescextnowmod.so += -Wl,-z,now
 tst-armtlsdescloc-ENV = LD_BIND_NOW=1
 tst-armtlsdescextnow-ENV = LD_BIND_NOW=1
-- 
2.34.1


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2
  2024-02-29 19:46 ` [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2 Adhemerval Zanella
@ 2024-03-05 20:07   ` H.J. Lu
  2024-03-05 20:17     ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 9+ messages in thread
From: H.J. Lu @ 2024-03-05 20:07 UTC (permalink / raw)
  To: Adhemerval Zanella; +Cc: libc-alpha, Szabolcs Nagy

On Thu, Feb 29, 2024 at 11:46 AM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> So it is not fail for arm config that defaults to -mtp=soft (which
> issues a call to __aeabi_read_tp).
> ---
>  configure    | 2 +-
>  configure.ac | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/configure b/configure
> index 59ff1e415d..ab8a10ed92 100755
> --- a/configure
> +++ b/configure
> @@ -7020,7 +7020,7 @@ void foo (void)
>  }
>  EOF
>  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
> -                  conftest.c -o conftest 1>&5'
> +                  -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&5'
>    { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
>    (eval $ac_try) 2>&5
>    ac_status=$?
> diff --git a/configure.ac b/configure.ac
> index 65799e5685..4bb9aeef95 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1297,7 +1297,7 @@ void foo (void)
>  }
>  EOF
>  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
> -                  conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD])
> +                  -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD])
>  then

Can we use -shared instead?

>    libc_cv_mtls_dialect_gnu2=yes
>  else
> --
> 2.34.1
>


-- 
H.J.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2
  2024-03-05 20:07   ` H.J. Lu
@ 2024-03-05 20:17     ` Adhemerval Zanella Netto
  2024-03-05 20:22       ` H.J. Lu
  0 siblings, 1 reply; 9+ messages in thread
From: Adhemerval Zanella Netto @ 2024-03-05 20:17 UTC (permalink / raw)
  To: H.J. Lu; +Cc: libc-alpha, Szabolcs Nagy



On 05/03/24 17:07, H.J. Lu wrote:
> On Thu, Feb 29, 2024 at 11:46 AM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>> So it is not fail for arm config that defaults to -mtp=soft (which
>> issues a call to __aeabi_read_tp).
>> ---
>>  configure    | 2 +-
>>  configure.ac | 2 +-
>>  2 files changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/configure b/configure
>> index 59ff1e415d..ab8a10ed92 100755
>> --- a/configure
>> +++ b/configure
>> @@ -7020,7 +7020,7 @@ void foo (void)
>>  }
>>  EOF
>>  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
>> -                  conftest.c -o conftest 1>&5'
>> +                  -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&5'
>>    { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
>>    (eval $ac_try) 2>&5
>>    ac_status=$?
>> diff --git a/configure.ac b/configure.ac
>> index 65799e5685..4bb9aeef95 100644
>> --- a/configure.ac
>> +++ b/configure.ac
>> @@ -1297,7 +1297,7 @@ void foo (void)
>>  }
>>  EOF
>>  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
>> -                  conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD])
>> +                  -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD])
>>  then
> 
> Can we use -shared instead?

It works as well, I don't have a strong preference.

> 
>>    libc_cv_mtls_dialect_gnu2=yes
>>  else
>> --
>> 2.34.1
>>
> 
> 

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2
  2024-03-05 20:17     ` Adhemerval Zanella Netto
@ 2024-03-05 20:22       ` H.J. Lu
  0 siblings, 0 replies; 9+ messages in thread
From: H.J. Lu @ 2024-03-05 20:22 UTC (permalink / raw)
  To: Adhemerval Zanella Netto; +Cc: libc-alpha, Szabolcs Nagy

On Tue, Mar 5, 2024 at 12:17 PM Adhemerval Zanella Netto
<adhemerval.zanella@linaro.org> wrote:
>
>
>
> On 05/03/24 17:07, H.J. Lu wrote:
> > On Thu, Feb 29, 2024 at 11:46 AM Adhemerval Zanella
> > <adhemerval.zanella@linaro.org> wrote:
> >>
> >> So it is not fail for arm config that defaults to -mtp=soft (which
> >> issues a call to __aeabi_read_tp).
> >> ---
> >>  configure    | 2 +-
> >>  configure.ac | 2 +-
> >>  2 files changed, 2 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/configure b/configure
> >> index 59ff1e415d..ab8a10ed92 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -7020,7 +7020,7 @@ void foo (void)
> >>  }
> >>  EOF
> >>  if { ac_try='${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
> >> -                  conftest.c -o conftest 1>&5'
> >> +                  -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&5'
> >>    { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
> >>    (eval $ac_try) 2>&5
> >>    ac_status=$?
> >> diff --git a/configure.ac b/configure.ac
> >> index 65799e5685..4bb9aeef95 100644
> >> --- a/configure.ac
> >> +++ b/configure.ac
> >> @@ -1297,7 +1297,7 @@ void foo (void)
> >>  }
> >>  EOF
> >>  if AC_TRY_COMMAND([${CC-cc} $CFLAGS $CPPFLAGS -fPIC -mtls-dialect=gnu2 -nostdlib -nostartfiles
> >> -                  conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD])
> >> +                  -Wl,--unresolved-symbols=ignore-all conftest.c -o conftest 1>&AS_MESSAGE_LOG_FD])
> >>  then
> >
> > Can we use -shared instead?
>
> It works as well, I don't have a strong preference.
>

Let's use -shared.   OK with that change.

Thanks.

-- 
H.J.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] elf: Enable TLS descriptor tests on aarch64
  2024-02-29 19:46 ` [PATCH 3/3] elf: Enable TLS descriptor tests on aarch64 Adhemerval Zanella
@ 2024-03-11 12:31   ` Szabolcs Nagy
  2024-03-11 12:36     ` Adhemerval Zanella Netto
  0 siblings, 1 reply; 9+ messages in thread
From: Szabolcs Nagy @ 2024-03-11 12:31 UTC (permalink / raw)
  To: Adhemerval Zanella, libc-alpha; +Cc: H . J . Lu

The 02/29/2024 16:46, Adhemerval Zanella wrote:
> The aarch64 uses a different name than x86 and arm (trad instead
> os gnu2).  Use it to check whether to enable the TLS descriptor
> tests.

aarch64 uses 'trad' for traditional tls and 'desc' for tls
descriptors, but unlike other targets it defaults to 'desc'.

> 
> Also rename the internal machinery fron gnu2 to tls descriptors.
> 
> Checked on aarch64-linux-gnu.
...
> --- a/sysdeps/aarch64/preconfigure
> +++ b/sysdeps/aarch64/preconfigure
> @@ -2,5 +2,6 @@ case "$machine" in
>  aarch64*)
>  	base_machine=aarch64
>  	machine=aarch64
> +	mtls_descriptor=trad
>  	;;
>  esac

i think this is confusing.

on aarch64 mtls_descriptor should be 'desc', but we might
want to run some tests with 'trad' too for coverage (however
likely different tests than what other targets try to run with
tlsdesc).


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 3/3] elf: Enable TLS descriptor tests on aarch64
  2024-03-11 12:31   ` Szabolcs Nagy
@ 2024-03-11 12:36     ` Adhemerval Zanella Netto
  0 siblings, 0 replies; 9+ messages in thread
From: Adhemerval Zanella Netto @ 2024-03-11 12:36 UTC (permalink / raw)
  To: Szabolcs Nagy, libc-alpha; +Cc: H . J . Lu



On 11/03/24 09:31, Szabolcs Nagy wrote:
> The 02/29/2024 16:46, Adhemerval Zanella wrote:
>> The aarch64 uses a different name than x86 and arm (trad instead
>> os gnu2).  Use it to check whether to enable the TLS descriptor
>> tests.
> 
> aarch64 uses 'trad' for traditional tls and 'desc' for tls
> descriptors, but unlike other targets it defaults to 'desc'.
> 
>>
>> Also rename the internal machinery fron gnu2 to tls descriptors.
>>
>> Checked on aarch64-linux-gnu.
> ...
>> --- a/sysdeps/aarch64/preconfigure
>> +++ b/sysdeps/aarch64/preconfigure
>> @@ -2,5 +2,6 @@ case "$machine" in
>>  aarch64*)
>>  	base_machine=aarch64
>>  	machine=aarch64
>> +	mtls_descriptor=trad
>>  	;;
>>  esac
> 
> i think this is confusing.
> 

It is indeed, it should be 'desc' instead of 'trad' here.

> on aarch64 mtls_descriptor should be 'desc', but we might
> want to run some tests with 'trad' too for coverage (however
> likely different tests than what other targets try to run with
> tlsdesc).
> 

I will check the machinery required to enable all tls tests for
both modes.

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2024-03-11 12:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-29 19:46 [PATCH 0/3] Extending TLS testing and fixing TLS gnu2 for ARM Adhemerval Zanella
2024-02-29 19:46 ` [PATCH 1/3] Ignore undefined symbols for -mtls-dialect=gnu2 Adhemerval Zanella
2024-03-05 20:07   ` H.J. Lu
2024-03-05 20:17     ` Adhemerval Zanella Netto
2024-03-05 20:22       ` H.J. Lu
2024-02-29 19:46 ` [PATCH 2/3] arm: Update _dl_tlsdesc_dynamic to preserve caller-saved registers (BZ 31372) Adhemerval Zanella
2024-02-29 19:46 ` [PATCH 3/3] elf: Enable TLS descriptor tests on aarch64 Adhemerval Zanella
2024-03-11 12:31   ` Szabolcs Nagy
2024-03-11 12:36     ` Adhemerval Zanella Netto

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).