]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: dirent/tst-readdir64-compat can be a regular test
authorFlorian Weimer <fweimer@redhat.com>
Tue, 9 Mar 2021 20:07:24 +0000 (21:07 +0100)
committerFlorian Weimer <fweimer@redhat.com>
Tue, 9 Mar 2021 20:07:24 +0000 (21:07 +0100)
compat_symbol_reference works in non-internal tests now.  Also
avoid building the test for unsupported configurations at all.
I verified by building with build-many-glibcs.py that GLIBC_2.1.3
works as the predecessor of GLIBC_2.2.  (Symbol versions in
the early days are complex.)

Reviewed-by: Adhemerval Zanella <adhemerval.zanella@linaro.org>
sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/tst-readdir64-compat.c

index 0441f2a54de0f2518522802e73118753479bc192..1d209516e3eb3d1eb95d843e7e344764248d8e7f 100644 (file)
@@ -266,8 +266,12 @@ inhibit-glue = yes
 ifeq ($(subdir),dirent)
 sysdep_routines += getdirentries getdirentries64
 tests += tst-getdents64
-tests-internal += tst-readdir64-compat
+
+# The tested readdir64 symbol was replaced in glibc 2.2.
+ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
+tests += tst-readdir64-compat
 endif
+endif # $(subdir) == dirent
 
 ifeq ($(subdir),nis)
 CFLAGS-ypclnt.c = -DUSE_BINDINGDIR=1
index 4a31a485b3c2194abed683cf72057575e0f57cdb..d04de3112bc613414c8e5b3489ca3801a37e2801 100644 (file)
@@ -37,16 +37,12 @@ struct __old_dirent64
 
 typedef struct __old_dirent64 *(*compat_readdir64_type) (DIR *);
 
-#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
 struct __old_dirent64 *compat_readdir64 (DIR *);
 compat_symbol_reference (libc, compat_readdir64, readdir64, GLIBC_2_1);
-#endif
 
 static int
 do_test (void)
 {
-#if TEST_COMPAT (libc, GLIBC_2_1, GLIBC_2_2)
-
   /* Directory stream using the non-compat readdir64 symbol.  The test
      checks against this.  */
   DIR *dir_reference = opendir (".");
@@ -108,7 +104,6 @@ do_test (void)
 
   TEST_COMPARE (closedir (dir_test), 0);
   TEST_COMPARE (closedir (dir_reference), 0);
-#endif
   return 0;
 }