From patchwork Wed Mar 27 19:40:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 783149 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2374529wrt; Wed, 27 Mar 2024 12:40:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW+buQwUUWSZnZgBvlXVzW76T0F/NA5UcJ1QoPbgEvc3mngsexkZc5pf3pi5KSMYKW8HWUf7+O/+uBoynNC9nAG X-Google-Smtp-Source: AGHT+IEILueXJaMNpc29pDkV8MtCoi3jg65BbxTYIL9ZEOnNlqvUPfDWS7rYzztuORW8zI5SAQZ2 X-Received: by 2002:a05:6808:f92:b0:3c3:e081:a1be with SMTP id o18-20020a0568080f9200b003c3e081a1bemr855072oiw.47.1711568442800; Wed, 27 Mar 2024 12:40:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711568442; cv=pass; d=google.com; s=arc-20160816; b=FWtWSGvNnpsPWbxezVLy8/kCs9BnvR9iZO2ayJL2zr8AAZZJ4hoXijCHnthYUAQsgj Q4mHhru7DjzS2EQMOUHqDugIBGuQlogV0ZrUVjFm36ZZE5VvX+Jm8+4bC0/Iv2nvrW8m PROWgicfPuCioLyXVCVN97vc0YY043cdW5Jnq/XL0K7wha21dNkHryCk5CQr8mkCSp7k qohke5uoUAMvUyO1Oxp46a0zWcRPZFTOwdwMDcLy2Z+AwvzDDSaJb2riNx3HOEQ1qcGH rR6p18KMA+/sUWsPq2QFAwv/Gj5nTAnNvsjKgblfrr6nbbGhsObMo95SC+HsfeZB3CSr HO7Q== 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=TKEFr85lufbOCyqJ88dpFK06fvQtqp0Rk97D7S4BRnM=; fh=WtLnUd2EuDKv+EP3BSdEI8hdivapDDAq3MY9+WgWrlk=; b=LlZBthoIQHrVaXiE/rQUB9zUwNV3KZC0+7vncuA5660Xczs+tsRvJq0nMh4D3qQbZO 7jWEpWLA51f+Mfi51kPLU1eV2yeaQ/Lz7A5clI6FBCr/fjLiQw4WLPso+gCWpc6cZWvP bt7zuJu8jNpFGj5g5LnCYe5ft1MLgtU5Odw6ZKguy8DCzc1MuKsYsGnrgSS8CsKS827r Jk8OUsHSrm7PRcYlPjmmMvOVNMj7YT6PUJsSFRtL9cijiyOYzvdHJUkbCqLbkZtuUusm OYdhbNlaSCXvoJVwmgvp2TjuiqOb2UH8JIOdwMqd5Yui9cXI8E+2MlpfNF6d/srrfhj5 A4Pg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=lD0oziCZ; 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 v10-20020a05622a144a00b00431762b6d20si3568373qtx.150.2024.03.27.12.40.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 12:40:42 -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=lD0oziCZ; 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 6B4033858427 for ; Wed, 27 Mar 2024 19:40:42 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pj1-x1029.google.com (mail-pj1-x1029.google.com [IPv6:2607:f8b0:4864:20::1029]) by sourceware.org (Postfix) with ESMTPS id C311A3858D34 for ; Wed, 27 Mar 2024 19:40:30 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C311A3858D34 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 C311A3858D34 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::1029 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711568433; cv=none; b=iyNIDUr/CYMPD/P1i7ezxF7oeaBLNY4ho/RlqgqFcnRjIFu1SRk+Isch+3Y2kNszFWUoVkL0THZBQ6/hKheBa/Y6EljA+mpEk0coFMMi6fCuUQRPY0XFPnvQOKX/Pfdu3DVG91g4gYWeG7sX2AzwnVGVwZD+YYSc/+TGMOjiDDQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711568433; c=relaxed/simple; bh=EHnyytP6+ZGW+aC0q3eeJNpVFyc+yZFx/uyt1K+nb0M=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=XrLYKE8RYl1JGvBkMgJXpU1R0tr+vLAuGeUYc7qPl+GjYsVzLbwOMGFtI3Ewdj4thLp6YJzO8JvIl1gp5KPfQ/HxibJFatMM+horqTDNyAWdq59y51xjMKWXB5r25YPrpgHuhEe9RzQhIE9uAnKsdNEwgTa9mJUbDXNgdrZulyo= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-29c14800a7fso178843a91.2 for ; Wed, 27 Mar 2024 12:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711568429; x=1712173229; 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=TKEFr85lufbOCyqJ88dpFK06fvQtqp0Rk97D7S4BRnM=; b=lD0oziCZm8Pc4dPUL7hTr3bPTJcJIYII6GYPnfUhKLkr/+r29H5b6znEFycZ8jO2gI f1qVkYHO0DxEzj70vo2BgLbLRfjHOhkpQctOO7YOFRF+nI/YEsrOEhn/tHhfe9271pIz i4Jby5vQS+B+8Q2XhyDnalTzQ5K51Q0LCZ0Supld1/MD/JK8ruSli5YCtGjfW3FHRK3q evVVlY+6bjBri/gc3E6ioNeAX3gM5SuhSzEH0bkCspovDucBvvEChqO/WH+7pp2y6e26 Sx7j9RwOvF83EvAFXDgoqx3bYmH07uAnsm5fva6hO8hn01Bc2hq8ToSshAvnXqYXxWAg 2OwQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711568429; x=1712173229; 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=TKEFr85lufbOCyqJ88dpFK06fvQtqp0Rk97D7S4BRnM=; b=CGMDH/nPnvSE5bqp0Yz6jvEBQrWZOrbrrs4usJAvPHiEt6ycYMCpAq+eq3JPDLeKRk 0SZJiZ+zzu7rvsGK+7AdsCRqI11nAwPJo7Q52/gesn1jQXvbAUK4fnhtPwc39qq1Oo6y IIjl7bL7sFbVX1FtNHkpd8CLe1dJrRtxpr7EzpWTI6fIjXZM3D/1ODfDGwzHxnbzaMHZ KJXfCaX2p8vE3L/Bd/v7sO/vVjiL/8WrSd3bTmOCmz+B7IlOApgMtzANRQmTadJk3WyV OlIOH8jOuLgQzpx9BVnDlsiggfeNvhRbVTzj/J8jMOWcOpY+d2ku/2LvlBwQhrkSymy4 HmNg== X-Gm-Message-State: AOJu0YwiyEG448zz0NBvGullOmCft69clL18oh1OVKpn7xddzeWen+Rr 8Gl5O9hjL6JGC7CSNxPoM8xIJcQA+wUAp3L/xztZSwh7mW1egbp2jGuGcMPoz3xdO4TnA/76i5K / X-Received: by 2002:a17:90a:4297:b0:2a0:d24:6cbf with SMTP id p23-20020a17090a429700b002a00d246cbfmr639210pjg.36.1711568429113; Wed, 27 Mar 2024 12:40:29 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:b18e:67c4:6248:3d8a:f386]) by smtp.gmail.com with ESMTPSA id p11-20020a17090a348b00b002a091be027esm2277357pjb.31.2024.03.27.12.40.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 12:40:28 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH v2 00/10] Fix some libm static issues Date: Wed, 27 Mar 2024 16:40:14 -0300 Message-Id: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-6.6 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. On x86_64/i686 it shows that the assembly optimizations for acos, log10, log2, and ldbl-96 y0/y1 show some issues. 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-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). One option could be XFAIL for now. [1] https://sourceware.org/bugzilla/show_bug.cgi?id=20845 Adhemerval Zanella (10): 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/Makefile | 111 +++++++++++++++++++- 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/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 + 36 files changed, 175 insertions(+), 142 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