From patchwork Tue Aug 22 10:47:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Florian Weimer X-Patchwork-Id: 22301 Received: (qmail 11080 invoked by alias); 22 Aug 2017 10:47:30 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 11066 invoked by uid 89); 22 Aug 2017 10:47:29 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com A2A0020A88 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=fweimer@redhat.com Subject: Re: [PATCH] Add hidden visibility to internal function prototypes To: Joseph Myers Cc: "H.J. Lu" , GNU C Library References: <20170817122244.GA14297@gmail.com> <1cb1b2db-db57-85dd-02ff-a7a1371bcee3@redhat.com> <0bd41ea7-65f6-da5d-2025-dd41d5f8c61a@redhat.com> From: Florian Weimer Message-ID: <116a6dce-db6b-65f0-ad65-de22ea0aff8c@redhat.com> Date: Tue, 22 Aug 2017 12:47:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: On 08/21/2017 11:15 PM, Joseph Myers wrote: > On Mon, 21 Aug 2017, Florian Weimer wrote: > >>> The test links with libc.so, but it uses various GMP objects from libc.a. >>> >>> Generically, any test using any objects from libc.a will have problems if >>> those reference hidden symbols (in this case, __assert_fail) from >>> elsewhere in libc. >> >> I don't think linking a test both against libc.a and libc.so is valid. >> >> In other cases, in order to test hidden symbols, we use fully static >> linking instead. Is this something we could do here as well? I don't >> think it would invalidate the tests any more than the current hybrid >> linkage model does. > > As far as I know, linking those tests statically would be OK (it would not > significantly affect what they are testing). That's atext-exp, > atest-sincos, atest-exp2 that are using internal GMP objects from libc.a; > I don't know if other tests, in math/ or elsewhere, also link against > particular libc.a objects. I think the attached approach will work for the math subdirectory. Tested on aarch64 and ppc64le. I see additional aarch64 failures, though (outside math). Thanks, Florian math: Statically link tests of internal functionality 2017-08-22 Florian Weimer math: Statically link tests of internal functionality. * math/Makefile (tests): Remove atest-exp, atest-sincos, atest-exp2. (tests-static): Add atest-exp, atest-sincos, atest-exp2. (gmp-objs): Remove assignment. (atest-exp, atest-sincos, atest-exp2): Remove targets. diff --git a/math/Makefile b/math/Makefile index 25d3e95c6c..7948d476fa 100644 --- a/math/Makefile +++ b/math/Makefile @@ -181,7 +181,7 @@ $(inst_libdir)/libm.a: $(common-objpfx)format.lds \ endif # Rules for the test suite. -tests = test-matherr-3 test-fenv atest-exp atest-sincos atest-exp2 basic-test \ +tests = test-matherr-3 test-fenv basic-test \ test-misc test-fpucw test-fpucw-ieee tst-definitions test-tgmath \ test-tgmath-ret bug-nextafter bug-nexttoward bug-tgmath1 \ test-tgmath-int test-tgmath2 test-powl tst-CMPLX tst-CMPLX2 test-snan \ @@ -203,6 +203,10 @@ tests-static = test-fpucw-static test-fpucw-ieee-static \ test-signgam-ullong-static test-signgam-ullong-init-static tests-internal = test-matherr test-matherr-2 +# These tests use internal (unexported) GMP functions and are linked +# statically to obtain access to these fucntions. +tests-static += atest-exp atest-sincos atest-exp2 + ifneq (,$(CXX)) tests += test-math-isinff test-math-iszero endif @@ -569,11 +573,4 @@ endef object-suffixes-left := $(libmvec-tests) include $(o-iterator) -gmp-objs = $(patsubst %,$(common-objpfx)stdlib/%.o,\ - add_n sub_n cmp addmul_1 mul_1 mul_n divmod_1 \ - lshift rshift mp_clz_tab udiv_qrnnd inlines \ - $(gmp-sysdep_routines)) -$(objpfx)atest-exp: $(gmp-objs) -$(objpfx)atest-sincos: $(gmp-objs) -$(objpfx)atest-exp2: $(gmp-objs) $(objpfx)test-fenv-tls: $(shared-thread-library)