From patchwork Tue Apr 2 14:06:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 785115 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp4952550wrt; Tue, 2 Apr 2024 07:07:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUcF2u8HwW68drk/q16pA5FJ6yx9u6wsOV/gGJuaXKESzPJ1xdTxt1z3aJbiQ+IPvhOT9timg0kKYGsl5w37FNv X-Google-Smtp-Source: AGHT+IHvkpJ47CVeSNQE6sxfu5C0aCeGBqDVT+hxREJzHSdfOBUnuxDXUntAQZJoRio3VjrkpOI8 X-Received: by 2002:a05:622a:1492:b0:432:c94d:22d4 with SMTP id t18-20020a05622a149200b00432c94d22d4mr15041487qtx.34.1712066839869; Tue, 02 Apr 2024 07:07:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712066839; cv=pass; d=google.com; s=arc-20160816; b=bvTkXlUu4QOa7GzSlEoAV6tE3eE/wgJawJ35ldL0eFI/mQ1VV5c66qWWXdweYhxxqH SlBxG0o/l/Hm137blm+LQ5xn5dNpT2wv4pqpF4TGTgC9R9J/CBdZrN0n33j9Cnp31/5f B/ss5VLG/5kmkhWPKAfUeMG9VXK12yfVc67fbLfwOr+vOeh+kQQelDFgn5OfoIj84qtE lwbV37Kf5vc+NVsl1f1TSXBTma+kFAK0wYwYxUBmVhd7DFKxLxMqV1XcfeMR0lORdQjr zJshj1JBSSbWxhOjqip1ohj7KTpH5z8Lg9XQrRkEge2HnmnndLYIti77owJftXYD6yyt AuTw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature :arc-filter:dmarc-filter:delivered-to; bh=4kcsrh5mq4M6YN+PyMazArwmP31JrmnxP7Lqtmeh3CA=; fh=WtLnUd2EuDKv+EP3BSdEI8hdivapDDAq3MY9+WgWrlk=; b=Sb06b9ZJNsdGz8C5eTOy2TCFwIYZr6J+alrmSuaIJGsj5PjU0yYdulXUmPJH46+G6E 4ggSALLWh/tyR2MFu7rKzyp+4j1lO1igtu/0Nrz6MXd05CrkfHOleAN0PE7d99dVKAkn CIB9xLsOaS5LTfVRcbu7uerwZ4zh6fVjoRk8EpXpXdvT4rtH5AIa7P4sc0UPeqi3dUUO zICFnL3XJFzQC/Qij1mS5diEAZm3MfQO6QRrt75V/gabyX/M7JYPI1OAMGm2Cu7N8wH3 6a5dCicnc0hOZynSm0NFaNjm/LW0GmmthlTFka9BpiL0EbPqsypOnmKQG0bd/+7v6qYj T+kQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ErDtXVVv; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id d7-20020ac85d87000000b00430d6ee30b0si12321065qtx.556.2024.04.02.07.07.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 07:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ErDtXVVv; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="libc-alpha-bounces+patch=linaro.org@sourceware.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 269E5385841D for ; Tue, 2 Apr 2024 14:07:19 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id AA8AE3858CDA for ; Tue, 2 Apr 2024 14:06:50 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org AA8AE3858CDA 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 AA8AE3858CDA Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712066824; cv=none; b=i+9yHYQBjGz/iSiXkYHHQNOoVlfQuUpKeK6xt+PyH/yzG/oVk5yBUNGmrddHyxuslTFzjPodrF6t0jU5ysADkAG9DrgCl2XPWSXLQdmgvcmMUliV1ErO1ce0fbW/1b157StJUKol8WR8jP6QPOtQHtoqN3EcpDQ903qQ7dWUBkA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712066824; c=relaxed/simple; bh=sD41OLpflHmUT3jq+L8yuUQnu27+5pKM7a9Vf4BzWeU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=iVl4c6DUu7AHQ7a8HeNr2tPKfol6hjq++3aJ07JmW8IYwXdtJUKEv9EwS+7B8iHv1eg7IKNbpeg3sAD39vvoMBPN5BVV7zTX26D1Jh//rx5UU5+8+p4mziAIqYmOgxLVblcbE6d2lm02rpvCPdGV8AsZsOjJes5ITZv1bi4vwXQ= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1df01161b39so44693945ad.3 for ; Tue, 02 Apr 2024 07:06:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712066808; x=1712671608; darn=sourceware.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=4kcsrh5mq4M6YN+PyMazArwmP31JrmnxP7Lqtmeh3CA=; b=ErDtXVVvJFFCp9HAAkpsPoXYkJPqEzpRrY799VP6bzCLU/kqlnm7JO8HTAHCf02vLg R+LjTA9zqshqF4e0czBckxA+njFDDgoWdL8YhH7vu6x7DOpEgzXKRvGoDg3hLeZHHqu0 /UTEFd4tECM+lPVApzphjVIySrTWZ4A2y9jI1GLxvkE/x7tYhfn3lij4dmolKU1dkces 28PoBdql+LgWUEm/S+280GLCdPBK3VK7UGdGUIDZSTkbBp5/XKDQPAdlm2LjDvwWL4y9 jsvrZ/akKVl61sbHwkus4c/w3GK8RcnoPRHTY+MuTsbWESJvbjmshSKfBBzf64Wnn+vT oszA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712066808; x=1712671608; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=4kcsrh5mq4M6YN+PyMazArwmP31JrmnxP7Lqtmeh3CA=; b=ef9olwLA0w9CmrQJ0R7ywaVfxguPYIrJ/nrK9+1Gd8QakpodmY9lv696QmZ5LhtU55 Y5iFDC0mTSy99TzP+hSl5ouYI4WOOotbu/31NNWrGo7R/iV/7x1CCuEF8JMFQCfdFy7i SNEUS2DgR0ZY993QgmWiJQI6MH2nbnaxlZkOY6mhDeaQyAKOs53fsJtbaKF8879m8QJS q11Tcj34SKAqwkGZrvfxMG+ZfyfnB/P8FkSLFLWXNzp/0kRsKnVyA13XJFxzVV5a8tS4 Y6Hh9JfaPE4VCY5mEVaSWwNheKkAiSGX5obWRs99sxKBFQY47pAXOZy0en25Y9s9Ol1a zSGQ== X-Gm-Message-State: AOJu0YxZgWsQNfSCvz1KYa+0PAsbebMA2XS3VIjOMGeTLsVKjcalXTj1 EyG11aurGwr5+XqNDP2nbxTId6lZs8t7xjR5NFeMs6MMd/Rz7uDBqpWu0trfnoT5aa0QOIDdYaF V X-Received: by 2002:a17:902:e786:b0:1e2:5e77:4cd with SMTP id cp6-20020a170902e78600b001e25e7704cdmr3652082plb.7.1712066808512; Tue, 02 Apr 2024 07:06:48 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:b18e:b217:420c:65ee:fc3e]) by smtp.gmail.com with ESMTPSA id b3-20020a170902d50300b001dcb654d1a5sm11078483plg.21.2024.04.02.07.06.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 07:06:48 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH v3 0/7] Fix some libm static issues Date: Tue, 2 Apr 2024 11:06:37 -0300 Message-Id: <20240402140644.2172819-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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.30 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libc-alpha-bounces+patch=linaro.org@sourceware.org Some recent math optimizations removed some symbols from the static build and due to the limited static build check, along with --disable-shared being broken for some time [1], this issue has slipped some releases. Although the fix is straightforward, I added an extra framework to enable static build for math libraries using the generic type framework (which autogenerated the tests for all supported types using the C template files). I have not enabled it for all tests due to the required extra size constraint, this is done with a new define that can be used with make check (build-math-static-tests). As an experiment, I enabled static build for all autogenerated math tests. This has uncovered some extra missing symbols on some ABIs, along with some issues with implementation used on static for some ABIs. On x86_64/i686 it shows that the assembly optimizations for acos, log10, log2, and ldbl-96 y0/y1 show some issues: x86_64-linux-gnu$ grep ^FAIL math/subdir-tests.sum FAIL: math/test-float64x-acos-static FAIL: math/test-float64x-log10-static FAIL: math/test-float64x-log2-static FAIL: math/test-float64x-y0-static FAIL: math/test-float64x-y1-static FAIL: math/test-ldouble-acos-static FAIL: math/test-ldouble-log10-static FAIL: math/test-ldouble-log2-static FAIL: math/test-ldouble-y0-static FAIL: math/test-ldouble-y1-static i686-linux-gnu$ grep ^FAIL math/subdir-tests.sum FAIL: math/test-double-atanh-static FAIL: math/test-float-atanh-static FAIL: math/test-float32-atanh-static FAIL: math/test-float32x-atanh-static FAIL: math/test-float64-atanh-static FAIL: math/test-float64x-acos-static FAIL: math/test-float64x-acosh-static FAIL: math/test-float64x-atanh-static FAIL: math/test-float64x-log10-static FAIL: math/test-float64x-log2-static FAIL: math/test-float64x-y0-static FAIL: math/test-float64x-y1-static FAIL: math/test-ldouble-acos-static FAIL: math/test-ldouble-acosh-static FAIL: math/test-ldouble-atanh-static FAIL: math/test-ldouble-log10-static FAIL: math/test-ldouble-log2-static FAIL: math/test-ldouble-y0-static FAIL: math/test-ldouble-y1-static The powerpc64le also shows multiple issues with the static linking (using gcc 13.1): FAIL: math/test-float128-exp10-static FAIL: math/test-float64x-exp10-static FAIL: math/test-ibm128-acos-static FAIL: math/test-ibm128-copysign-static FAIL: math/test-ibm128-exp10-static FAIL: math/test-ibm128-fmod-static FAIL: math/test-ibm128-frexp-static FAIL: math/test-ibm128-modf-static [...] I have not analyzed what is happening, but it might be due to the '-mabi=ibmlongdouble' along with how libgcc.a was built (I saw some issues on GCC bugzilla). I also tested this patchset with build-math-static-tests=yes for all ABIs, and there is not more build failures. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=20845 Adhemerval Zanella (7): math: Add support for auto static math tests math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) math: Fix i386 and m68k exp10 on static build math: Fix isnanf128 static build math: Provided copysignf128 for static libm on alpha, s390, and sparcv9 math: Provide frexpf128 for static libm on alpha, s390, and sparcv9 math: Provide modf128 for static libm on alpha, s390, and sparcv9 Makeconfig | 5 + Makefile.help | 4 + math/Makefile | 113 +++++++++++++++++++- math/test-double-static.h | 1 + math/test-float-static.h | 1 + math/test-float128-static.h | 1 + math/test-float32-static.h | 1 + math/test-float32x-static.h | 1 + math/test-float64-static.h | 1 + math/test-float64x-static.h | 1 + math/test-ibm128-static.h | 1 + math/test-ldouble-static.h | 1 + sysdeps/i386/fpu/w_exp10_compat.c | 9 +- sysdeps/i386/fpu/w_fmod_compat.c | 7 +- sysdeps/i386/fpu/w_fmodf_compat.c | 7 +- sysdeps/ieee754/float128/float128_private.h | 2 +- sysdeps/ieee754/float128/s_isnanf128.c | 4 + sysdeps/ieee754/ldbl-64-128/s_copysignl.c | 4 +- sysdeps/ieee754/ldbl-64-128/s_frexpl.c | 4 +- sysdeps/ieee754/ldbl-64-128/s_modfl.c | 4 +- sysdeps/ieee754/ldbl-opt/s_ldexpl.c | 4 +- sysdeps/m68k/m680x0/fpu/w_exp10_compat.c | 9 +- sysdeps/m68k/m680x0/fpu/w_fmod_compat.c | 5 +- sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c | 7 +- 24 files changed, 170 insertions(+), 27 deletions(-) create mode 100644 math/test-double-static.h create mode 100644 math/test-float-static.h create mode 100644 math/test-float128-static.h create mode 100644 math/test-float32-static.h create mode 100644 math/test-float32x-static.h create mode 100644 math/test-float64-static.h create mode 100644 math/test-float64x-static.h create mode 100644 math/test-ibm128-static.h create mode 100644 math/test-ldouble-static.h