From patchwork Fri Mar 5 13:05:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 42270 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B4D103834411; Fri, 5 Mar 2021 13:05:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B4D103834411 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614949529; bh=P1s9ivkRhEZkGJXH+7KkTjIPpy1b3AohO+oRL/ftmiI=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=iwg1AV9Q3huh8cvvegJvkw47GggbeXYRZihCcam5NyHylgG2WCpHOXhRjIfOrqSJN WmzYC0RaHT9d20DiCx9sqtmy/C4x0TCpwQrQ8ayhdTpFwXqNk9WEHRy/r0EC80/BrY VRAsMxp6TVtszBejr/y7lIsUzMKWOiqL1HZAg2WA= X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by sourceware.org (Postfix) with ESMTP id 656ED3834411 for ; Fri, 5 Mar 2021 13:05:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 656ED3834411 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-285-ruOZS6pcO_CqGI6bB6I0FA-1; Fri, 05 Mar 2021 08:05:23 -0500 X-MC-Unique: ruOZS6pcO_CqGI6bB6I0FA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 336161074644 for ; Fri, 5 Mar 2021 13:05:22 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-113-208.ams2.redhat.com [10.36.113.208]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 8AA2919D9B for ; Fri, 5 Mar 2021 13:05:21 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] Linux: dirent/tst-readdir64-compat can be a regular test Date: Fri, 05 Mar 2021 14:05:30 +0100 Message-ID: <87r1kteoo5.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Florian Weimer via Libc-alpha From: Florian Weimer Reply-To: Florian Weimer Errors-To: libc-alpha-bounces@sourceware.org Sender: "Libc-alpha" 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 --- sysdeps/unix/sysv/linux/Makefile | 6 +++++- sysdeps/unix/sysv/linux/tst-readdir64-compat.c | 5 ----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/sysdeps/unix/sysv/linux/Makefile b/sysdeps/unix/sysv/linux/Makefile index 51e28b97ac..2dc8b1f443 100644 --- a/sysdeps/unix/sysv/linux/Makefile +++ b/sysdeps/unix/sysv/linux/Makefile @@ -265,8 +265,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 diff --git a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c index 4a31a485b3..d04de3112b 100644 --- a/sysdeps/unix/sysv/linux/tst-readdir64-compat.c +++ b/sysdeps/unix/sysv/linux/tst-readdir64-compat.c @@ -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; }