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: 87456 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BFE5038582A0 for ; Thu, 21 Mar 2024 16:44:16 +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-Google-Smtp-Source: AGHT+IFfVEUr66xS4cBJ4RYFZIcLb2s4bhPcuPBKLdBNAIRuzFVAiNG0EW0FZcpyrbnlGIr/VFf85w== 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+patchwork=sourceware.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