]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Linux: dirent/tst-readdir64-compat needs to use TEST_COMPAT (bug 27654)
authorFlorian Weimer <fweimer@redhat.com>
Mon, 25 Jul 2022 07:39:22 +0000 (09:39 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 25 Jul 2022 09:39:03 +0000 (11:39 +0200)
The hppa port starts libc at GLIBC_2.2, but has earlier symbol
versions in other shared objects.  This means that the compat
symbol for readdir64 is not actually present in libc even though
have-GLIBC_2.1.3 is defined as yes at the make level.

Fixes commit 15e50e6c966fa0f26612602a95f0129543d9f9d5 ("Linux:
dirent/tst-readdir64-compat can be a regular test") by mostly
reverting it.

sysdeps/unix/sysv/linux/Makefile
sysdeps/unix/sysv/linux/tst-readdir64-compat.c

index 2ccc92b6b82fa33d584c9a265f1516f0d84a73bc..a139a1653207df96bb22a471031ed885a7dd633d 100644 (file)
@@ -361,12 +361,10 @@ inhibit-glue = yes
 
 ifeq ($(subdir),dirent)
 sysdep_routines += getdirentries getdirentries64
-tests += tst-getdents64
-
-# The tested readdir64 symbol was replaced in glibc 2.2.
-ifeq ($(have-GLIBC_2.1.3)$(build-shared),yesyes)
-tests += tst-readdir64-compat
-endif
+tests += \
+  tst-getdents64 \
+  tst-readdir64-compat \
+  # tests
 endif # $(subdir) == dirent
 
 ifeq ($(subdir),nis)
index e1f616614611f760d6a36166e1fbe3b270c209a5..1f1302e543f72e5089ddea7e2e023bec984333fb 100644 (file)
@@ -37,12 +37,15 @@ 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 (".");
@@ -104,6 +107,7 @@ do_test (void)
 
   TEST_COMPARE (closedir (dir_test), 0);
   TEST_COMPARE (closedir (dir_reference), 0);
+#endif
   return 0;
 }