From patchwork Wed Mar 27 16:45:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella Netto X-Patchwork-Id: 783132 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2299566wrt; Wed, 27 Mar 2024 09:45:49 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVY5kXRCpPpT5kEfTseL+DVs1Oxl99xTizFYOcz7yQhmuv87gP0F819nsOAuzTRNxhdXbUkLheKP9GILiflvH3T X-Google-Smtp-Source: AGHT+IGSK8mFPu5ADn3dvuCAx4pKrDXkigjA30vnK38I2SO367JaBSSjCnZZHu4zfHLDo3KD0mcP X-Received: by 2002:ae9:f445:0:b0:789:e73d:9ec7 with SMTP id z5-20020ae9f445000000b00789e73d9ec7mr100800qkl.69.1711557948992; Wed, 27 Mar 2024 09:45:48 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711557948; cv=pass; d=google.com; s=arc-20160816; b=m4vK8aMq/Ne2930JZ4gzI1kge1xae1jfyljEDQUW1IH6hHryOnLJtRij7v/lLUGWO1 Vj9GKas8LCRwCEBCz/wWzq5XUf1TcVLK6eDo5gqAxGMTH90Y2pIdN4EoXW4nxtTzbNKZ ECLeRPOBVTbBAMU1ghEt6UHmx8Le+RY0Tgfk0E/aD7mqrGqP8RBdMYehjIhlqCHTQF/I rlRlaprlAgwdR24VULE2Atq10b3UyANNhp9UAVR0PDjEiUKaJ8NUevAxFYOXPu//CeUu f5Weid8bfb8fnenUA7JzWGbw0zYM3nKp1V4f/3nFABvC0emH5On+/03PPO+3cci3O+kb 1UtQ== 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=r1TLZWTM3JS6HF9s39qetFscBEkyiHz5W7QcfRsp/hI=; fh=WtLnUd2EuDKv+EP3BSdEI8hdivapDDAq3MY9+WgWrlk=; b=DGpVi3BOG++rgkHV2PHREXMaeKzW508EX8JCYsiaImYXyApkrhlMlhtDz2eeICw4Ue H0tSDeBuaV622GcyN2Iif1k0tfdRiA5cmbZsSf+x2dU9RiVu6qVqcE5Qp7RY/J39P6iQ E2oOS2uq1cIItF/7TJzQhJgeg7cZo6fFj15BnJC0AxUBe3ECyj36Ju1uWJZjlCs6R8zI KEr+C+cbGiwPReWao+8FpftcgnKjMi3UK/3pdctRUpj/SWjtFTKq+HB0nhN8i4c8i/OI S+r3eZiY7WCCSWl/hT27Yk3nsLZRDHQYsooFvocdp6ykYtbdQ9AXnFcs4CntJrDFvZcS Nmxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q/6pkYm/"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id w11-20020a05620a0e8b00b0078a5e674bd6si5218558qkm.253.2024.03.27.09.45.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:48 -0700 (PDT) Received-SPF: pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="q/6pkYm/"; arc=pass (i=1); spf=pass (google.com: domain of libc-alpha-bounces+patch=linaro.org@sourceware.org designates 2620:52:3:1:0:246e:9693:128c 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 544483858282 for ; Wed, 27 Mar 2024 16:45:48 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62b.google.com (mail-pl1-x62b.google.com [IPv6:2607:f8b0:4864:20::62b]) by sourceware.org (Postfix) with ESMTPS id 8A7FE3858D20 for ; Wed, 27 Mar 2024 16:45:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A7FE3858D20 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 8A7FE3858D20 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62b ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557936; cv=none; b=LVDOe2zEGjssEPuhS+OGE9a/K160wHx66ZueOHWoZCxkCWNuI2Gd3yZ83g5bb0vdNvtfM/ISJMyKflth3uBaANdc0M2La5T04LrwWCLd6D4QPbJt6uzqT8jDRufHe1wjA+JSKRposPhqtNpyKVUYSYAvwTx93vRtG4TNR2oiisM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557936; c=relaxed/simple; bh=c3nxPk5w3b00yU72/I/4UjL6DQae99ulFg69TujHFCo=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=szK4Y2hnU9W0OsSHefqDUkbtn01MXQjx0mlT8oWd5MIkXsJh0nx+sFhhvBQ0yeOO2/hwJ7sO5L3aXL70aYu7jcrnXk5D/jyVBRQhebOHzvIGPTp70EevOejmIJm77pNo8YAbFQWP9XzlI5EmKyTlopFPpU0T3grA71cqEiTaJec= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1e0b213efa3so493815ad.0 for ; Wed, 27 Mar 2024 09:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557933; x=1712162733; 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=r1TLZWTM3JS6HF9s39qetFscBEkyiHz5W7QcfRsp/hI=; b=q/6pkYm/XWAy5Bk1F6eVu6wtGsReNmQc2/bkX+v8/wqFk6TXYkjGsc1LuWe/nZr1Lw AC7WqVcdzoVUIdKctKbH8/9H3xaWvRAtn7P16IhrIelAb90fEF+a3d0dke0vvi34lbjE 6WEScYv3QHPOGHJJ3Pn+QTLysnIDXcWaKKNCZXva0n0L/4G2+pjiRu4PXI2+KHm6m7dE 3hC1FX+qwjRbhQ/XWHoW6WUpS1fixbWHzBWlvFI0PhygqAzBd7+4lfRyZVvG8aY7Q47C 5i9GZRcSxnlFM9YApZ3vCnt8z1vgZLjtZBOAK5mXkfHOz0qQN03KZi4isTFReSTPy0t/ PxKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557933; x=1712162733; 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=r1TLZWTM3JS6HF9s39qetFscBEkyiHz5W7QcfRsp/hI=; b=TUzy9UP3M2DvySxKxhUJUykcNdEZ+gllR+IgQAvnBASUJKU2KloL8B4L3bprRUxnxE vlo4GMBXoiSocl/nF0NtoEUxx0//fbZPg2O4ZFNypC0W6MHCHNQeyb47OxnT997JVej3 PNu10JowGHunnuJNTcBKaxdCmWnuf0fCFRfJJy/PKjCQq7ThBZ8gfR6ECr6YOJSeA92U HBooI86O17cEJ5/l17G61Kx3Vo9AC6RJub7QBHZghbdxEld7lmE/kq5Qzgx0Gjg0fLbb S9qx1RImfm38Yyms+DE4r85m51LjTgaIh0iXHPONQXXo9EExjslS/mopkkuzdmAGGTaI PwTw== X-Gm-Message-State: AOJu0YxcE/Wxd5S1UsR6b0EbMp6nQIH3daYNzVHBfqTNpJaY8LgkLOvh JiCwVaxcctRHquRQUfSZdL30cfecqO8jmEAd5nimf7hyd1bXqIcC780FlOjCtOs29pJiKgutZKd r X-Received: by 2002:a17:902:da84:b0:1e1:a74:4e17 with SMTP id j4-20020a170902da8400b001e10a744e17mr280293plx.30.1711557932730; Wed, 27 Mar 2024 09:45:32 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:b18e:67c4:6248:3d8a:f386]) by smtp.gmail.com with ESMTPSA id c4-20020a170903234400b001e20578b524sm858593plh.252.2024.03.27.09.45.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:32 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 00/15] Fix some libm static issues Date: Wed, 27 Mar 2024 13:45:12 -0300 Message-Id: <20240327164527.3717523-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 select 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, maybe a future ---enable-static-math-tests configure option could improve test coverage. 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. I tested this patchset on x86_64, i686, armhf, aarch64, and powerpc64le. The powerpc64le shows some issues with the static linking, due to the newly enabled tests (using gcc 13.1): FAIL: math/test-float128-exp10-static FAIL: math/test-float128-y1-static FAIL: math/test-float64x-exp10-static FAIL: math/test-float64x-y1-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-log10-static FAIL: math/test-ibm128-log2-static FAIL: math/test-ibm128-modf-static FAIL: math/test-ibm128-y0-static FAIL: math/test-ibm128-y1-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). One option could be XFAIL for now. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=20845 Adhemerval Zanella (15): math: Add support for auto static math tests math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) i386: Use generic fmod i386: Use generic fmodf math: Fix i386 and m68k exp10 on static build i386: Use generic exp10 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 math: Fix acos template for arguments greater than 1 math: Fix log10 template for inputs less than 0 math: Fix log2 template for inputs less than 0 math: Fix y0 template for arguments less/equal than 0 math: Fix y1 template for arguments less/equal than 0 math/Makefile | 116 +++++++++++++++++++- 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 + math/w_acos_template.c | 9 +- math/w_j0_template.c | 16 ++- math/w_j1_template.c | 16 ++- math/w_log10_template.c | 16 ++- math/w_log2_template.c | 16 ++- sysdeps/i386/fpu/Versions | 5 + sysdeps/i386/fpu/e_exp10.S | 51 --------- sysdeps/i386/fpu/e_exp10.c | 2 + sysdeps/i386/fpu/e_exp_data.c | 1 - sysdeps/i386/fpu/e_fmod.S | 18 --- sysdeps/i386/fpu/e_fmod.c | 2 + sysdeps/i386/fpu/e_fmodf.S | 18 --- sysdeps/i386/fpu/e_fmodf.c | 2 + sysdeps/i386/fpu/math_err.c | 1 - sysdeps/i386/fpu/w_exp10_compat.c | 3 - sysdeps/i386/fpu/w_fmod_compat.c | 14 --- sysdeps/i386/fpu/w_fmodf_compat.c | 14 --- sysdeps/ieee754/dbl-64/e_exp10.c | 7 +- sysdeps/ieee754/dbl-64/e_fmod.c | 5 +- sysdeps/ieee754/float128/float128_private.h | 2 +- sysdeps/ieee754/float128/s_isnanf128.c | 4 + sysdeps/ieee754/flt-32/e_fmodf.c | 5 +- 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 +- sysdeps/mach/hurd/i386/libm.abilist | 3 + sysdeps/unix/sysv/linux/i386/libm.abilist | 3 + 41 files changed, 235 insertions(+), 160 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 delete mode 100644 sysdeps/i386/fpu/e_exp10.S create mode 100644 sysdeps/i386/fpu/e_exp10.c delete mode 100644 sysdeps/i386/fpu/e_exp_data.c delete mode 100644 sysdeps/i386/fpu/e_fmod.S create mode 100644 sysdeps/i386/fpu/e_fmod.c delete mode 100644 sysdeps/i386/fpu/e_fmodf.S create mode 100644 sysdeps/i386/fpu/e_fmodf.c delete mode 100644 sysdeps/i386/fpu/math_err.c delete mode 100644 sysdeps/i386/fpu/w_exp10_compat.c delete mode 100644 sysdeps/i386/fpu/w_fmod_compat.c delete mode 100644 sysdeps/i386/fpu/w_fmodf_compat.c