From patchwork Thu Mar 21 16:43:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 781584 Delivered-To: patch@linaro.org Received: by 2002:adf:cf01:0:b0:33e:7753:30bd with SMTP id o1csp927761wrj; Thu, 21 Mar 2024 09:43:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVLUTkyQ3Vx38d1Gyq1gf2NA0SWpz7xK6WnsT4x/0KcXTd7UQ7Vdy2kdX2kcqVMAcAQaHB/92iP5LySgbKTjxLJ X-Google-Smtp-Source: AGHT+IF1bCMuRaZGeR0k0i1iSEb1fNZidvbWyyd/edzFpY5G9J68SFnOQQnl4IWSZvOX/kY+QID+ X-Received: by 2002:a05:620a:126f:b0:789:eccd:dbb6 with SMTP id b15-20020a05620a126f00b00789eccddbb6mr9947664qkl.43.1711039430818; Thu, 21 Mar 2024 09:43:50 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711039430; cv=pass; d=google.com; s=arc-20160816; b=1DBqc6iJMT9mdY+DIdY5/ZmlNsXokPNXtifY6Ca1oOTdhuR0daG2gCqjCCS2GvB4Nd njzofYwoWyPv1X+RGkv2ktN+aXk8h61tcBZEHlXvH0zEPzi6fVZuew3NAOJEHCxfJfE9 bGYTnetWkUiaOXbmRNDlmb3VBf51bJSiwQjd+jSwe11IH3kzC9zPapiNWiBt8S7cifs4 upLsX5HyRR5J8HDfjV4mTFlrwmqm3VynxnTSudW4Wi4wazmkPrryDMVoDW3ZhFafuG5x 4T0weNVEzHO58qJ+jJNdKMfL3YdZHog9HjP5pCjx4LYz0/Wpqzj661CNZrd4p8FHcoHU D70g== 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:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=FvSto6S14a2dV6Tyip/F96rta66GZM4uoCiXo2KVAps=; fh=+6orIzRLXQY2FWXAtGF+abYflc8V+YPKzsYFuX0DJM4=; b=EIsKoaZCKeqkrUkdtZr+PQFJeMmh+Tau9E2zw+wH8GBSuW/zkzISJtNmnRboLFTzvd rIzWtIgT4ctSqXbxUqlyaqtteAY8DctZc06Bjm6eQXRUr4m9luiSWyrI97GUtgm67IsR EPnScMYyHus6RNwTie28Hm89OMSzxfnciRpij9se4y8mifJR8IOnYC9WQ6snNefhNZK0 tIYnlPoC365YfPF4ICSfaeaDLNK2QglFaMIfE47pWyii9puHtcnE990P2xq+X3LRbTT5 9+D16La5F0D8oihk0sYiegMDIMAdQvrO0ItgZph9xrC/KbYjMp4XGybGp/WuGwTUY25i Sttw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Bclfb37M; 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 b9-20020a05620a118900b0078a1a976e43si68873qkk.712.2024.03.21.09.43.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 09:43:50 -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=Bclfb37M; 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 5D4C93858C98 for ; Thu, 21 Mar 2024 16:43:50 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x629.google.com (mail-pl1-x629.google.com [IPv6:2607:f8b0:4864:20::629]) by sourceware.org (Postfix) with ESMTPS id E2AC43858C24 for ; Thu, 21 Mar 2024 16:43:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E2AC43858C24 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 E2AC43858C24 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::629 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711039416; cv=none; b=DPWcZWFnRnUdfvhn4+sIgBBv308Ko6vxC9WlCB2wvotxanPJLXHhHd2n+ll+7nJa3ESH4NGBnAnUQMyMQplq1dVpwK1bCmCYoQJYJYjZYX0GOdzBh800B57b1rIDcgrk3F44IRLHBuQbZj9g0X0lIP+aIT9CKazch3EgkfYe4GA= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711039416; c=relaxed/simple; bh=Q46ZLyNZ2n8Lh1ncNRFk98MiR7FUGUj8Mw68fwgABx4=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=Z2NhSmOBkPJ323B4CvJCS06WHr1EZOuhCBHgdExlCEV440k2xNTg6hWxQAL6/pzZm93CijzSVt9fvGSnOcVNj5Io05M0HE3VuVKAlVb95HqzhD9m2kkDWDJxxp+xX7TogrHsDlrYB2tcbVLcEHrsafpBZRlLTA6HxqUEgwYQWlE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x629.google.com with SMTP id d9443c01a7336-1e00896dfdcso8008095ad.1 for ; Thu, 21 Mar 2024 09:43:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711039413; x=1711644213; darn=sourceware.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FvSto6S14a2dV6Tyip/F96rta66GZM4uoCiXo2KVAps=; b=Bclfb37MB1JrpBYXlyPrsk1L0pY4tLJJZKgqu2zqtrdpTA79+XHztxZUus2JVhRF62 ZDZp9vTZVI/Yw4J80yfjvoki9uJBgV+eSVxWN8OV3NtWnXee6Hs7NPBwGT38NlGLdIUZ /QGG29THbiy6PLyzUyGadVRep3u/vBoOjwYwu1n+PDGU8uP1yHuSQfs9kmGny6AHoxmr T516tMAiqpxXt9LhYW54SwAzz2QFvvgtyeSS17vi3N9h6yzMF+KSUX1TSfiGx1PTj+Me SLKeCRJ/Ic66GdjLSYrjg0oO6N9cMVmSo3OR/1puK5EmGnxKUxrkUY8CeQTUoeec4ro1 VsUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711039413; x=1711644213; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FvSto6S14a2dV6Tyip/F96rta66GZM4uoCiXo2KVAps=; b=C4e735wwCQTmU6Bu9hOn9VB8lxir8DwS8OLDXO6EQCnK1RUBBb3DnWBtWl9jEkX6oE nYjSt/MbN40WvUcu/ccJsKV+HD43K00sHBi1vPbeU7xzzPI7LdEMAsJatCUx+i9A9nmB KpZwzIBQkMfgX5UPQQ/kPBWFgQJ9irfOO6aHzTWjU4el0dZbDcfflZseE6EeiAgoOMGx BDQ3zKOGwASyP+ukhUw8insgH/9Og2TjV0rZLCyAxPbQL+mYlEKox5+5vl2bKRHcYmN7 jfuA8HW19d/v4qS1IxQ15fYQDFvyFpKlNPMXdOu+94Zro80VeghFvDyjqpjx6ki711rm lUfg== X-Gm-Message-State: AOJu0YyOb2HzUNfN67rs11mJEqXEjVVryf5CsLWZxSIcEbifh9Or0wbJ 47MxpSDOiBeY+9GSvyK96a7NrJvK90pyqIjePMfT9M1ZRfUDCStHGdMul9bbaupx6n0Ik5VOJeB C X-Received: by 2002:a17:902:70c2:b0:1e0:e35:add1 with SMTP id l2-20020a17090270c200b001e00e35add1mr9489125plt.31.1711039413241; Thu, 21 Mar 2024 09:43:33 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:1d04:42cc:aea4:27d6:375f]) by smtp.gmail.com with ESMTPSA id q1-20020a170902bd8100b001dd75d4b408sm18074pls.302.2024.03.21.09.43.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Mar 2024 09:43:32 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: "H . J . Lu" Subject: [PATCH v2 2/6] math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) Date: Thu, 21 Mar 2024 13:43:21 -0300 Message-Id: <20240321164325.539976-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240321164325.539976-1-adhemerval.zanella@linaro.org> References: <20240321164325.539976-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, 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 The commit 16439f419b removed the static fmod/fmodf on i386 and m68k with and empty w_fmod.c (required for the ABIs that uses the newly implementation). This patch fixes by adding the required symbols on the arch-specific w_fmod{f}_compat.c implementation. To statically build fmod fails on some ABI (alpha, s390, sparc) because it does not export the ldexpf128, this is also fixed by this patch. Checked on i686-linux-gnu and with a build for m68k-linux-gnu. I also checked that a stack build using fmod/fmodf correctly resolves on both ABIs. --- math/Makefile | 4 +++- sysdeps/i386/fpu/w_fmod_compat.c | 7 ++++--- sysdeps/i386/fpu/w_fmodf_compat.c | 7 ++++--- sysdeps/ieee754/ldbl-opt/s_ldexpl.c | 4 ++-- sysdeps/m68k/m680x0/fpu/w_fmod_compat.c | 5 +++-- sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c | 7 ++++--- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/math/Makefile b/math/Makefile index aef9cec1a1..fbb2987248 100644 --- a/math/Makefile +++ b/math/Makefile @@ -368,7 +368,9 @@ $(libm-test-c-narrow-obj): $(objpfx)libm-test%.c: libm-test%.inc \ libm-test-funcs-auto-static = -libm-test-funcs-noauto-static = +libm-test-funcs-noauto-static = \ + fmod \ + # libm-test-funcs-noauto-static libm-test-funcs-compat-static = libm-test-funcs-narrow-static = libm-test-funcs-all-static = $(libm-test-funcs-auto-static) $(libm-test-funcs-noauto-static) diff --git a/sysdeps/i386/fpu/w_fmod_compat.c b/sysdeps/i386/fpu/w_fmod_compat.c index 5ac9995ffd..528bfc2a13 100644 --- a/sysdeps/i386/fpu/w_fmod_compat.c +++ b/sysdeps/i386/fpu/w_fmod_compat.c @@ -7,8 +7,9 @@ # define LIBM_SVID_COMPAT 1 # undef compat_symbol # define compat_symbol(a, b, c, d) -#endif -#include -#ifdef SHARED +# include libm_alias_double (__fmod_compat, fmod) +#else +#include +#include #endif diff --git a/sysdeps/i386/fpu/w_fmodf_compat.c b/sysdeps/i386/fpu/w_fmodf_compat.c index cc417e07d3..5a61693e51 100644 --- a/sysdeps/i386/fpu/w_fmodf_compat.c +++ b/sysdeps/i386/fpu/w_fmodf_compat.c @@ -7,8 +7,9 @@ # define LIBM_SVID_COMPAT 1 # undef compat_symbol # define compat_symbol(a, b, c, d) -#endif -#include -#ifdef SHARED +# include libm_alias_float (__fmod_compat, fmod) +#else +#include +#include #endif diff --git a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c index 1afbe7d8ad..932cc4341c 100644 --- a/sysdeps/ieee754/ldbl-opt/s_ldexpl.c +++ b/sysdeps/ieee754/ldbl-opt/s_ldexpl.c @@ -17,13 +17,13 @@ License along with the GNU C Library; if not, see . */ -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED # define declare_mgen_alias(f,t) #endif #include #include -#if IS_IN (libc) +#if IS_IN (libc) && defined SHARED long_double_symbol (libc, __ldexpl, ldexpl); long_double_symbol (libc, __wrap_scalbnl, scalbnl); #endif diff --git a/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c b/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c index 527d4fbed2..57f38091e6 100644 --- a/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c +++ b/sysdeps/m68k/m680x0/fpu/w_fmod_compat.c @@ -7,8 +7,9 @@ # define LIBM_SVID_COMPAT 1 # undef compat_symbol # define compat_symbol(a, b, c, d) -#endif #include -#ifdef SHARED libm_alias_double (__fmod_compat, fmod) +#else +#include +#include #endif diff --git a/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c b/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c index 5043586b91..88db07f443 100644 --- a/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c +++ b/sysdeps/m68k/m680x0/fpu/w_fmodf_compat.c @@ -7,8 +7,9 @@ # define LIBM_SVID_COMPAT 1 # undef compat_symbol # define compat_symbol(a, b, c, d) -#endif -#include -#ifdef SHARED +# include libm_alias_float (__fmod_compat, fmod) +#else +#include +#include #endif