From patchwork Thu Mar 4 16:04:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 1447417 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=libc-alpha-bounces@sourceware.org; receiver=) Authentication-Results: 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=rfKkuW8Y; dkim-atps=neutral Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DrwfN3jcqz9sPf for ; Fri, 5 Mar 2021 03:04:12 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6DF36386102B; Thu, 4 Mar 2021 16:04:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6DF36386102B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1614873850; bh=ykTUbq9R6Dr94T/k6VijFdJ4aft7tjPzT/0m6cIMxhQ=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=rfKkuW8YR+ymMdXk+qyMG1u7sVxwGzbHgMaA+ZWsqODqkuLrZ+LP1/E8e2AocE7qV reTHx+HUzRnLT+aL6I0ROzo+iQs1rGY2xcqbVmF2PVxKslOH6BoXexP+jb+KaS7uK0 YS2khEnQMi4rLFsuDeOMN9MhdhywWTB32aQLRjJ0= 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 6E62F386102B for ; Thu, 4 Mar 2021 16:04:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 6E62F386102B 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-241-C3twJYLmOxCRj8cWQOkTOA-1; Thu, 04 Mar 2021 11:04:02 -0500 X-MC-Unique: C3twJYLmOxCRj8cWQOkTOA-1 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E0A461842151 for ; Thu, 4 Mar 2021 16:04:01 +0000 (UTC) Received: from oldenburg.str.redhat.com (ovpn-112-56.ams2.redhat.com [10.36.112.56]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 43D895C1A1 for ; Thu, 4 Mar 2021 16:04:01 +0000 (UTC) To: libc-alpha@sourceware.org Subject: [PATCH] malloc: Turn tst-mallocstate into a non-internal test Date: Thu, 04 Mar 2021 17:04:08 +0100 Message-ID: <87lfb2kirr.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.79 on 10.5.11.16 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-11.6 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, URIBL_BLACK 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 no longer needs tests-internal. Do not build the test at all for newer targets, so that no spurious UNSUPPORTED result is generated. --- malloc/Makefile | 10 ++++++---- malloc/tst-mallocstate.c | 11 ++--------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/malloc/Makefile b/malloc/Makefile index 583bbefb0d..641967c512 100644 --- a/malloc/Makefile +++ b/malloc/Makefile @@ -47,7 +47,12 @@ tests-static := \ tst-interpose-static-thread \ tst-malloc-usable-static \ -tests-internal := tst-mallocstate tst-scratch_buffer +# Test for the malloc_set_state symbol removed in glibc 2.25. +ifeq ($(have-GLIBC_2.24)$(build-shared),yesyes) +tests += tst-mallocstate +endif + +tests-internal := tst-scratch_buffer # The dynarray framework is only available inside glibc. tests-internal += \ @@ -118,9 +123,6 @@ $(objpfx)tst-malloc-thread-fail-mcheck: $(shared-thread-library) $(objpfx)tst-malloc-fork-deadlock-mcheck: $(shared-thread-library) $(objpfx)tst-malloc-stats-cancellation-mcheck: $(shared-thread-library) -# Export the __malloc_initialize_hook variable to libc.so. -LDFLAGS-tst-mallocstate = -rdynamic - # These should be removed by `make clean'. extra-objs = mcheck-init.o libmcheck.a others-extras = mcheck-init.o diff --git a/malloc/tst-mallocstate.c b/malloc/tst-mallocstate.c index 776f606863..ba726505e7 100644 --- a/malloc/tst-mallocstate.c +++ b/malloc/tst-mallocstate.c @@ -29,8 +29,6 @@ #include "malloc.h" -#if TEST_COMPAT (libc, GLIBC_2_0, GLIBC_2_25) - /* Make the compatibility symbols availabile to this test case. */ void *malloc_get_state (void); compat_symbol_reference (libc, malloc_get_state, malloc_get_state, GLIBC_2_0); @@ -310,6 +308,8 @@ init_heap (void) /* Interpose the initialization callback. */ void (*volatile __malloc_initialize_hook) (void) = init_heap; +compat_symbol_reference (libc, __malloc_initialize_hook, + __malloc_initialize_hook, GLIBC_2_0); /* Simulate occasional unrelated heap activity in the non-dumped heap. */ @@ -490,12 +490,5 @@ do_test (void) return errors; } -#else -static int -do_test (void) -{ - return 77; -} -#endif #include