From patchwork Mon Jul 25 08:13:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1660251 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.a=rsa-sha256 header.s=default header.b=JqdqaDck; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4Lrt8z31B4z9sB4 for ; Mon, 25 Jul 2022 18:13:39 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9C2AF3858016 for ; Mon, 25 Jul 2022 08:13:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C2AF3858016 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1658736816; bh=t43JdmWY4l84CDWS2NqUxFvsWQll5PuWWjzELQGyamA=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:Cc:From; b=JqdqaDckA+U9aPro3A2sf4TU5z8g70RYYSmc2f/OHzaNo44myRFISBNfcALxeppSU h/LGQrRT5Z9fyp8qOYpbw5IoGPaTjtDqBSGVRXd7FsVrznI7+C+Vfm38vvUS68aVKF +aJhO8Aj5I2CY3/8qMh3rikkteL/Z1NzQ1Z41Hq4= 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 [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id 5218D3858403 for ; Mon, 25 Jul 2022 08:13:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5218D3858403 Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-314--ZbwQESlMmWuz7MLaeVqmA-1; Mon, 25 Jul 2022 04:13:20 -0400 X-MC-Unique: -ZbwQESlMmWuz7MLaeVqmA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 81C6F805B9A; Mon, 25 Jul 2022 08:13:20 +0000 (UTC) Received: from oldenburg.str.redhat.com (unknown [10.39.192.195]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7823590A04; Mon, 25 Jul 2022 08:13:19 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] Linux: dirent/tst-readdir64-compat needs to use TEST_COMPAT (bug 27654) Date: Mon, 25 Jul 2022 10:13:17 +0200 Message-ID: <87k081sj8i.fsf@oldenburg.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.2 (gnu/linux) MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-10.9 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_NONE, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) 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 Cc: dave.anglin@bell.net Errors-To: libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org Sender: "Libc-alpha" 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. Tested on i686-linux-gnu. Built on hppa-linux-gnu. --- 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; }