2bfb24
commit dd2315a866a4ac2b838ea1cb10c5ea1c35d51a2f
2bfb24
Author: Florian Weimer <fweimer@redhat.com>
2bfb24
Date:   Tue Aug 16 08:27:50 2022 +0200
2bfb24
2bfb24
    elf: Run tst-audit-tlsdesc, tst-audit-tlsdesc-dlopen everywhere
2bfb24
    
2bfb24
    The test is valid for all TLS models, but we want to make a reasonable
2bfb24
    effort to test the GNU2 model specifically.  For example, aarch64
2bfb24
    defaults to GNU2, but does not have -mtls-dialect=gnu2, and the test
2bfb24
    was not run there.
2bfb24
    
2bfb24
    Suggested-by: Martin Coufal <mcoufal@redhat.com>
2bfb24
2bfb24
Conflicts:
2bfb24
	elf/Makefile
2bfb24
	  (missing tst-align3 backport, missing libdl integration)
2bfb24
2bfb24
diff --git a/elf/Makefile b/elf/Makefile
2bfb24
index 9e721d5d4e0a1cd9..1dd36ba0486e56a0 100644
2bfb24
--- a/elf/Makefile
2bfb24
+++ b/elf/Makefile
2bfb24
@@ -331,6 +331,8 @@ tests += \
2bfb24
   tst-addr1 \
2bfb24
   tst-align \
2bfb24
   tst-align2 \
2bfb24
+  tst-audit-tlsdesc \
2bfb24
+  tst-audit-tlsdesc-dlopen \
2bfb24
   tst-audit1 \
2bfb24
   tst-audit11 \
2bfb24
   tst-audit12 \
2bfb24
@@ -607,6 +609,8 @@ modules-names = \
2bfb24
   tst-alignmod2 \
2bfb24
   tst-array2dep \
2bfb24
   tst-array5dep \
2bfb24
+  tst-audit-tlsdesc-mod1 \
2bfb24
+  tst-audit-tlsdesc-mod2 \
2bfb24
   tst-audit11mod1 \
2bfb24
   tst-audit11mod2 \
2bfb24
   tst-audit12mod1 \
2bfb24
@@ -640,6 +644,7 @@ modules-names = \
2bfb24
   tst-auditmanymod7 \
2bfb24
   tst-auditmanymod8 \
2bfb24
   tst-auditmanymod9 \
2bfb24
+  tst-auditmod-tlsdesc  \
2bfb24
   tst-auditmod1 \
2bfb24
   tst-auditmod9a \
2bfb24
   tst-auditmod9b \
2bfb24
@@ -809,23 +814,8 @@ modules-names += tst-gnu2-tls1mod
2bfb24
 $(objpfx)tst-gnu2-tls1: $(objpfx)tst-gnu2-tls1mod.so
2bfb24
 tst-gnu2-tls1mod.so-no-z-defs = yes
2bfb24
 CFLAGS-tst-gnu2-tls1mod.c += -mtls-dialect=gnu2
2bfb24
+endif # $(have-mtls-dialect-gnu2)
2bfb24
 
2bfb24
-tests += tst-audit-tlsdesc tst-audit-tlsdesc-dlopen
2bfb24
-modules-names += tst-audit-tlsdesc-mod1 tst-audit-tlsdesc-mod2 tst-auditmod-tlsdesc
2bfb24
-$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
2bfb24
-			    $(objpfx)tst-audit-tlsdesc-mod2.so \
2bfb24
-			    $(shared-thread-library)
2bfb24
-CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
2bfb24
-CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
2bfb24
-$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library) $(libdl)
2bfb24
-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
2bfb24
-				       $(objpfx)tst-audit-tlsdesc-mod2.so
2bfb24
-$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
2bfb24
-$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
2bfb24
-tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
2bfb24
-$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
2bfb24
-tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
2bfb24
-endif
2bfb24
 ifeq (yes,$(have-protected-data))
2bfb24
 modules-names += tst-protected1moda tst-protected1modb
2bfb24
 tests += tst-protected1a tst-protected1b
2bfb24
@@ -2559,5 +2549,23 @@ $(objpfx)tst-tls21.out: $(objpfx)tst-tls21mod.so
2bfb24
 $(objpfx)tst-tls21mod.so: $(tst-tls-many-dynamic-modules:%=$(objpfx)%.so)
2bfb24
 
2bfb24
 $(objpfx)tst-rtld-run-static.out: $(objpfx)/ldconfig
2bfb24
+
2bfb24
 $(objpfx)tst-dlmopen-gethostbyname: $(libdl)
2bfb24
 $(objpfx)tst-dlmopen-gethostbyname.out: $(objpfx)tst-dlmopen-gethostbyname-mod.so
2bfb24
+$(objpfx)tst-audit-tlsdesc: $(objpfx)tst-audit-tlsdesc-mod1.so \
2bfb24
+			    $(objpfx)tst-audit-tlsdesc-mod2.so \
2bfb24
+			    $(shared-thread-library)
2bfb24
+ifeq (yes,$(have-mtls-dialect-gnu2))
2bfb24
+# The test is valid for all TLS types, but we want to exercise GNU2
2bfb24
+# TLS if possible.
2bfb24
+CFLAGS-tst-audit-tlsdesc-mod1.c += -mtls-dialect=gnu2
2bfb24
+CFLAGS-tst-audit-tlsdesc-mod2.c += -mtls-dialect=gnu2
2bfb24
+endif
2bfb24
+$(objpfx)tst-audit-tlsdesc-dlopen: $(shared-thread-library) $(libdl)
2bfb24
+$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-audit-tlsdesc-mod1.so \
2bfb24
+				       $(objpfx)tst-audit-tlsdesc-mod2.so
2bfb24
+$(objpfx)tst-audit-tlsdesc-mod1.so: $(objpfx)tst-audit-tlsdesc-mod2.so
2bfb24
+$(objpfx)tst-audit-tlsdesc.out: $(objpfx)tst-auditmod-tlsdesc.so
2bfb24
+tst-audit-tlsdesc-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so
2bfb24
+$(objpfx)tst-audit-tlsdesc-dlopen.out: $(objpfx)tst-auditmod-tlsdesc.so
2bfb24
+tst-audit-tlsdesc-dlopen-ENV = LD_AUDIT=$(objpfx)tst-auditmod-tlsdesc.so