From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2178) id A4F8C385AE5E; Mon, 25 Jul 2022 14:04:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A4F8C385AE5E Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Florian Weimer To: glibc-cvs@sourceware.org Subject: [glibc] Linux: dirent/tst-readdir64-compat needs to use TEST_COMPAT (bug 27654) X-Act-Checkin: glibc X-Git-Author: Florian Weimer X-Git-Refname: refs/heads/master X-Git-Oldrev: ca4d3ea5130d66e66c5af14e958e99341bf20689 X-Git-Newrev: 0c5605989f72457b50e4eccad3e99a28929d89ba Message-Id: <20220725140417.A4F8C385AE5E@sourceware.org> Date: Mon, 25 Jul 2022 14:04:17 +0000 (GMT) X-BeenThere: glibc-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Glibc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 25 Jul 2022 14:04:17 -0000 https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=0c5605989f72457b50e4eccad3e99a28929d89ba commit 0c5605989f72457b50e4eccad3e99a28929d89ba Author: Florian Weimer Date: Mon Jul 25 09:39:22 2022 +0200 Linux: dirent/tst-readdir64-compat needs to use TEST_COMPAT (bug 27654) 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. Diff: --- sysdeps/unix/sysv/linux/Makefile | 10 ++++------ sysdeps/unix/sysv/linux/tst-readdir64-compat.c | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 2ccc92b6b8..a139a16532 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -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) diff --git a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c index e1f6166146..1f1302e543 100644 --- a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c +++ b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c @@ -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; }