From patchwork Tue Apr 2 14:06:39 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: 87931 X-Patchwork-Delegate: carlos@redhat.com 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 4E0B5385B523 for ; Tue, 2 Apr 2024 14:07:56 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by sourceware.org (Postfix) with ESMTPS id E0665385C6EE for ; Tue, 2 Apr 2024 14:06:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E0665385C6EE 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 E0665385C6EE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::62f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712066828; cv=none; b=BgH4HKI95SBcvtr5j7uOgdRLLV8ybZ6z+9hh+hUbW1BE8j2zRuGIPA7xIsBc/8ceTfiKzxP4OIHeSE9bo2cLbR+FJF5Sgo664Zdq2hYyW7Qe06JU12rFu90/ZrMH4NRacEKpzcdDrE08c4BOnJ8OYRAbGMo2sDQ2opyPhIIglwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712066828; c=relaxed/simple; bh=nJ7ZOOPC8VsLEjtVDvqSQgdGQVmUeioFjo/icp8xjhk=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=IpFogDAlQh6vEsm06bIyQ23ZGwkiUyVcBl7HmtZX2Os4ZuCN1IGUD0tejJZ5znpUx99wzYmGCXbcbA3dwpxdAyGk+GATDoJypUFnL5KkmZ6FBOaHRSm4SorNQM9URZbi4reNbWndmIt6hRX6FKEVY6tRDmrtcgWIGiZV1dGeftw= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1e0d8403257so39762635ad.1 for ; Tue, 02 Apr 2024 07:06:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712066813; x=1712671613; 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=niJ8IbGqn67vNOx/k+HT+uAqNd8V6iptrnTofEmu4eE=; b=wo7C5GxfIRynFGUrioUqDkZQ1DtB3xWPoX23T4Rn+g/vbEI2xH7PrOveh8puuOrsgF LtCM0yhWC9Qy1AizEf1+dqGAl9gexKyIZbFxrAK+iZVk8VRdZmvLoLcb9vTY2YMHNLxn No+p+XZOTFMl8Hq+k6XRw5a53UgwfI3jCN+1d9wW6qLttcm2ALuYaTNGPH8RhUCIkmBt VqlnmaLtX/dvJq2D/7qBvpyHMChdwsLMW5FpMAfMXK9topr4Li5IzJcAoKnavGVEvnM+ momyeXR7d9iPFZ1dHLeHAA/8SYuMKXNRLjvk1KkN3+j1MHaToJqG0qTY9drsTkbsC/Gn Iw2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712066813; x=1712671613; 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=niJ8IbGqn67vNOx/k+HT+uAqNd8V6iptrnTofEmu4eE=; b=PFArfjYhsTgF0GswjuspFiTR6n8kBiVzOPWeWZipkgjclIXLoe1VIPe33mvk2Vtx9v e7CSh7BCBn3AHXcO7WzpPyc/Q2dIjlLGsBmfZzy31vd0gqGTkj7lqikKjF4nL5591Zza p47TRLNMkKtTO+VrdTtjUSE1W3DaPWC8FJ4ebIqeXFxG/8nN1yjN+L1kaBntpTPkBlPm c5e8ghvNoKI3DlC/wljmDonxgukhEc2xjMIAC0g2YxQmF1TY2pBLYwr1jMS778uAXdok j+YK5MDll701zZ0Zvwj2k3xRNPaA9Zl+TxqqYAfm2U/oKt3+03NeuaHETrdJC/9kBcFx 0KBw== X-Gm-Message-State: AOJu0YwN3mEdBHkcqZcMk0sxg+ezxqIR79oMZwMqh2UyQkxmUsfBs1eg as6vDRIOLxbqRj1jokce202VRBbu28w54IXlc1jbyiiWJt2yuxrtOZeI1XJNPa1izkbamoirrju b X-Google-Smtp-Source: AGHT+IHxeFPHaaRX35+DgS+pp+yvfLw5TtX7o/L+tAkCaqUIeqoSUgUP/WKv3X1si4DdUxJX7LFd0g== X-Received: by 2002:a17:903:2986:b0:1e2:7094:473c with SMTP id lm6-20020a170903298600b001e27094473cmr2214721plb.54.1712066813208; Tue, 02 Apr 2024 07:06:53 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:b18e:b217:420c:65ee:fc3e]) by smtp.gmail.com with ESMTPSA id b3-20020a170902d50300b001dcb654d1a5sm11078483plg.21.2024.04.02.07.06.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 07:06:52 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH v3 2/7] math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) Date: Tue, 2 Apr 2024 11:06:39 -0300 Message-Id: <20240402140644.2172819-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240402140644.2172819-1-adhemerval.zanella@linaro.org> References: <20240402140644.2172819-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 with 'make test t=math/test-{float,double}-modf-static build-math-static-tests=yes'. Reviewed-by: Aurelien Jarno Tested-by: Aurelien Jarno --- 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 ++++--- 5 files changed, 17 insertions(+), 13 deletions(-) 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