From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rhel8.vm.delorie.com (d-159-250-13-23.nh.cpe.atlanticbb.net [159.250.13.23]) by sourceware.org (Postfix) with ESMTPS id 2A353385803C for ; Fri, 5 Mar 2021 01:15:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2A353385803C Received: from rhel8.vm.redhat.com (localhost [127.0.0.1]) by rhel8.vm.delorie.com (8.15.2/8.15.2) with ESMTPS id 1251F181036783 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 4 Mar 2021 20:15:01 -0500 From: DJ Delorie To: Florian Weimer Cc: libc-alpha@sourceware.org Subject: Re: [PATCH] malloc: Turn tst-mallocstate into a non-internal test In-Reply-To: <87lfb2kirr.fsf@oldenburg.str.redhat.com> (message from Florian Weimer via Libc-alpha on Thu, 04 Mar 2021 17:04:08 +0100) Date: Thu, 04 Mar 2021 20:15:01 -0500 Message-ID: MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.9 required=5.0 tests=BAYES_00, KAM_DMARC_NONE, KAM_DMARC_STATUS, KHOP_HELO_FCRDNS, RDNS_DYNAMIC, SPF_FAIL, SPF_HELO_NONE, TXREP, URIBL_BLACK autolearn=no 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-List-Received-Date: Fri, 05 Mar 2021 01:15:04 -0000 Florian Weimer via Libc-alpha writes: > 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. If this is your only goal, changing "return 77" to "return 0" would have sufficed ;-) > -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 If a platform has been around long enough to have been released in glibc 2.24, then we want to add this test. Ok. > -# Export the __malloc_initialize_hook variable to libc.so. > -LDFLAGS-tst-mallocstate = -rdynamic > - This is unexplained? I assume it's part of whatever "compat_symbol_reference no longer needs tests-internal" encompases. > -#if TEST_COMPAT (libc, GLIBC_2_0, GLIBC_2_25) If the test only runs on 2.24-or-older platforms, we don't need to test for 2.25-or-newer platforms. Ok. > /* 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); How does this work? On x86-64, that symbol is GLIBC_2.2.5, not GLIBC_2.0.