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=-0.9 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 EFA561F44D for ; Wed, 27 Mar 2024 16:46:07 +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=q/6pkYm/; dkim-atps=neutral Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 740BB385E450 for ; Wed, 27 Mar 2024 16:46:06 +0000 (GMT) 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-Google-Smtp-Source: AGHT+IGRnVw1dCYHLBXymcTy8BG0i6ETkVI8004TH7Md3qYwL/3IFdFLpnAaY8Ims/WHNRN6x+ZSpw== 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 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 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 -- 2.34.1