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 [8.43.85.97]) (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 8EFB11F44D for ; Tue, 2 Apr 2024 14:07:36 +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=ErDtXVVv; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id CF9D43858C78 for ; Tue, 2 Apr 2024 14:07:35 +0000 (GMT) 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-Google-Smtp-Source: AGHT+IGbx3MwEhg2Rvv8mX46kUpw3jr7LgDEKd9kDiV7Nl4ZRpRO476fAqaT8QQ+PONcGUQLGnzbxg== 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 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 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 -- 2.34.1