From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on starla X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 Received: from server2.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 dcvr.yhbt.net (Postfix) with ESMTPS id 282F71F44D for ; Mon, 25 Mar 2024 14:30:05 +0000 (UTC) Authentication-Results: dcvr.yhbt.net; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=AIBcgO3x; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 65427385840B for ; Mon, 25 Mar 2024 14:30:04 +0000 (GMT) Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by sourceware.org (Postfix) with ESMTPS id C771E3858410 for ; Mon, 25 Mar 2024 14:29:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C771E3858410 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C771E3858410 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711376981; cv=none; b=oiEo8GnLy3CL6b8u0sTwteqEI/3s4grhDFN1Mb/QTj5svZ+pxTbV5RpCcBaCN+3yT7mR994CRDFSpa/XlFqT6YsKH+IqBEuNnzwpQ85ypxC0JzFw/ojZVvKGK7kaOp2byR+Trslii7tni+ulPNErR414QKInrX7uK8FLUAqJqRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711376981; c=relaxed/simple; bh=ig6I+hwwKQCgZdTHFTOyA4j76FMHowMK5eFJQEij7aA=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=oPKlmOlr9rrer/i1HU++x+iGQrEjwL8QhdCCF2GkbA9CUPeFy160lDGWccSl5XJ7FX1Y4EtPRc/5Sd6sMoAbpSUuDumd+RIIJa1iigM0xPttyd54waXbJQ4bS0Bq29GIrDsFmmNVMq2Kusz/fayiEsErjBuyZoNv2LSDQkImahE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1def89f0cfdso39494825ad.0 for ; Mon, 25 Mar 2024 07:29:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711376978; x=1711981778; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to; bh=f5XkJV8coqi0drv/TUW62slTmwASfG6TNOhcZoRPsuU=; b=AIBcgO3x5oOsyVJLlLKFm0XxXVUqZk2IVhZfMZCOzjWDnMl5bLtXsujzWBeplrbtEJ +fRaSRs2iFLAdLfQDxXOmjM3UCSk8GBm5X2N4IaigcObnsPVWuyKggZ6ncghLXBVNGpt 6GPJKTwmOzYx2tg29KKBkPFZdfITm8yRXDqhg30Vt0OAbwlsI6FyG9pSiquWWbnFSlJh 6SQiZHQ44us4fMX9/JQLEUMsB/Uf3i9xR2W2Vgj0eJp2KtMHuUrQRE4WhJCqPL+8mOcc ytbc3Sps5+OSlBI5UgoK9n8/CB2mHVtS6n9NULIfOZehfIRyOIiW5JEMeIzFriuYFjRn t/AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711376978; x=1711981778; h=content-transfer-encoding:in-reply-to:organization:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=f5XkJV8coqi0drv/TUW62slTmwASfG6TNOhcZoRPsuU=; b=dHOLsM2l3Li9y361AgYXDcpILhjnast4AvB63SBH1PdYkxmcgWxeCnLt2659CuJbIX s0SD4Vyu5utbhhWMbBxrg71Zci4SECE6KvTuPyCTSyZGQONT6TZxofTDNMpjUMZKGFn+ 783i4UTC4JpROnNEU1IHWh731bWfCZwTdJrkBFrUDf6g6p4DPIGNDWjTqPH7pNmJwSV0 iqLiNCx8I/AgE0OEKeMvLTsohukOjMkqBxXvtz7wNQ8iyKQEHyv1pFE3k1fepa0k3ugR Bfev3bcsuv0+IEjWlNQsvhHDuxGV/xnNSQozJOA2UygtVkkybbBg9mzVTC5DvkXH1EdT vy5g== X-Forwarded-Encrypted: i=1; AJvYcCXJTP3qn5DmIyD4PwgWu/idtq+SdHRgY1pCDk9qYAGdKlNtjSB2BGsSuwKxgqT0l2bOUHMcz4v+ieyTr1XGnACa4fGfCloBU1QR X-Gm-Message-State: AOJu0YyNCQz4+DVPoouJii1U9zZ7rJwPfItE5Cpml2QHQ5+MT1126cnS fNjUVYKMGad3Hm3QN3rxhSzrShY9N5yJL5MjoVTTjAfsz5U+38u2Zy4XFblKQkvftM8muOFFpNd N X-Google-Smtp-Source: AGHT+IFpLwSYGOcuLvyMr3oEH9v1dE+ustaPZ2VbqU2DTbYx6A4rGlIaqvogOLNz99DNKIRZPCEAlg== X-Received: by 2002:a17:902:f709:b0:1e0:ab65:85e5 with SMTP id h9-20020a170902f70900b001e0ab6585e5mr10356511plo.1.1711376977657; Mon, 25 Mar 2024 07:29:37 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c3:1d04:bc5d:8d21:f0bf:b624? ([2804:1b3:a7c3:1d04:bc5d:8d21:f0bf:b624]) by smtp.gmail.com with ESMTPSA id e13-20020a170902784d00b001db8145a1a2sm4767618pln.274.2024.03.25.07.29.35 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Mar 2024 07:29:36 -0700 (PDT) Message-ID: Date: Mon, 25 Mar 2024 11:29:33 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 1/6] math: Add support for auto static math tests Content-Language: en-US To: "H.J. Lu" Cc: Florian Weimer , Joseph Myers , libc-alpha@sourceware.org References: <20240321164325.539976-1-adhemerval.zanella@linaro.org> <20240321164325.539976-2-adhemerval.zanella@linaro.org> <23abf336-5490-d62d-c664-98724630bad0@redhat.com> <87v85edar3.fsf@oldenburg.str.redhat.com> <152e5240-b315-401a-8bdd-03b4be0fe35f@linaro.org> <8734sii7s3.fsf@oldenburg.str.redhat.com> <1ab96a85-a66c-45f7-9786-863cd37e5497@linaro.org> From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+e=80x24.org@sourceware.org On 25/03/24 11:25, H.J. Lu wrote: > On Mon, Mar 25, 2024 at 7:13 AM Adhemerval Zanella Netto > wrote: >> >> >> >> On 25/03/24 10:34, H.J. Lu wrote: >>> On Fri, Mar 22, 2024 at 10:46 AM Adhemerval Zanella Netto >>> wrote: >>>> >>>> >>>> >>>> On 22/03/24 12:51, Florian Weimer wrote: >>>>> * Adhemerval Zanella Netto: >>>>> >>>>>> On 22/03/24 03:46, Florian Weimer wrote: >>>>>>> * Joseph Myers: >>>>>>> >>>>>>>> On Thu, 21 Mar 2024, Adhemerval Zanella wrote: >>>>>>>> >>>>>>>>> It basically copy the already in place rules for dynamic tests >>>>>>>>> for auto-generated math tests for all support types. To avoid >>>>>>>>> the need to duplicate .inc files, a .SECONDEXPANSION rules is >>>>>>>>> adeed for the gen-libm-test.py generation. >>>>>>>> >>>>>>>> Running the autogenerated tests seems overly complicated when the goal is >>>>>>>> simply to verify that linking a call succeeds. >>>>>>> >>>>>>> Right. And I would prefer if we could mark compat/otherwise non-static >>>>>>> symbols in the ABI lists and use those for testing static linking. >>>>>>> >>>>>> >>>>>> That was my first approach, but then as an experiment I enabled static >>>>>> build for most of math tests and unexpectedly it has shows some failures >>>>>> on x86_64: >>>>>> >>>>>> FAIL: math/test-float64x-acos >>>>>> FAIL: math/test-float64x-log10 >>>>>> FAIL: math/test-float64x-log2 >>>>>> FAIL: math/test-float64x-y0 >>>>>> FAIL: math/test-float64x-y1 >>>>>> FAIL: math/test-ldouble-acos >>>>>> FAIL: math/test-ldouble-log10 >>>>>> FAIL: math/test-ldouble-log2 >>>>>> FAIL: math/test-ldouble-y0 >>>>>> FAIL: math/test-ldouble-y1 >>>>>> >>>>>> $ cat math/test-float64x-acos.out >>>>>> testing _Float64x (without inline functions) >>>>>> Failure: acos (max_value): Exception "Overflow" set >>>>>> Failure: acos (-max_value): Exception "Overflow" set >>>>>> Failure: acos_downward (max_value): Exception "Overflow" set >>>>>> Failure: acos_downward (-max_value): Exception "Overflow" set >>>>>> Failure: acos_towardzero (max_value): Exception "Overflow" set >>>>>> Failure: acos_towardzero (-max_value): Exception "Overflow" set >>>>>> Failure: acos_upward (max_value): Exception "Overflow" set >>>>>> Failure: acos_upward (-max_value): Exception "Overflow" set >>>>>> >>> >>> This new static test only checks link failure. It doesn't check if the static >>> implementation is correct. We may not have more functional coverage >>> for static libm in the first static libm test patch. But the first new static >>> libm tests should least expose one static libm failure on x86-64. >> >> The first patch is just a framework so we can selective add new static >> tests, I haven't hook all of the autogenerated tests because this would >> add more cpu and disk usage. >> >> And the test added on libm-test-funcs-*-static rules does check for >> the implementation, using the default math skeleton test (including >> ulp, rounding, exceptions, etc). >> >>> >>>>>> My plan was to eventually track down what might be happening here, and >>>>>> the currently autogenerated tests gave me a nice scaffolding to add coverage >>>>>> tests. >>>>> >>>>> Interesting. On the other hand, getting --disable-shared to work and >>>>> just run the *entire* test suite could provide value, too. The last >>>>> time we discussed this we weren't sure if we had static-specific >>>>> failures, but your example shows that we do. >>>>> >>>> >>>> The main problem imho is --disable-shared is essentially a maintainer >>>> option. Although some installed programs will be static linked, it is >>>> really useful on checking if static linking is really working as expected. >>>> >>>> And it also requires *another* build and check iteration, which duplicates >>>> the work required in most cases (since static libraries are still built >>>> on default for --enable-shared). I tried to help a coworker on support the >>>> --disable-shared and I recall another potential issues was the resulting >>>> disk usage (and thus build requirements) was quite high due glibc poor >>>> organization on static build requirements. >>>> >>>> There also another complication where we will need to constantly add >>>> $(build-shared) and duplicate the CI work to ensure both configure >>>> builds are ok. >>>> >>>> So I really think we should phase-out --disable-shared and work towards >>>> on add more static build tests. >>> >>> Agreed. We should add one static libm functional test to each libm >>> functional test. With this, the static libm link tests won't be needed. >> >> For this patchset only added the required one to check for symbols that >> there were some regression with recent fixes. But it should be doable to >> hook all tests for all symbols, although it would require some more Makefile >> rules to hook the tgmath ones. > > The first patch should just add the functional tests for the missing static > libm functions with Makefile changes which can be extended to cover > other libm functions. > And it does on second patch exactly as you suggested: diff --git a/math/Makefile b/math/Makefile index aef9cec1a1..fbb2987248 100644 --- a/math/Makefile +++ b/math/Makefile @@ -368,7 +368,9 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \ libm-test-funcs-auto-static = -libm-test-funcs-noauto-static = +libm-test-funcs-noauto-static = \ + fmod \ + # libm-test-funcs-noauto-static libm-test-funcs-compat-static = libm-test-funcs-narrow-static = libm-test-funcs-all-static = $(libm-test-funcs-auto-static) $(libm-test-funcs-noauto-static) If you check the build directory, it will have a test--fmod-static that would fail to build without the rest of the patch. >> I don't have a strong opinion in fact, and I am ok on changing to Joseph's >> suggestion to check minimal tests to check for static linking support. > > >