From patchwork Wed Mar 27 16:45: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: 1916934 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=G+QGS+wq; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=sourceware.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=libc-alpha-bounces+incoming=patchwork.ozlabs.org@sourceware.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4V4XdS1chSz1yWv for ; Thu, 28 Mar 2024 03:47:08 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 68D99385DC1D for ; Wed, 27 Mar 2024 16:47:06 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by sourceware.org (Postfix) with ESMTPS id B96413858C36 for ; Wed, 27 Mar 2024 16:45:38 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B96413858C36 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 B96413858C36 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::633 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557940; cv=none; b=eTwwis9yVzhoUXoo5HPepNqwTQHBgoNpFkwYQtsfxfA2/9OyqQ08ACb4dDpgrY/Uy9h1UXEyUjpHHCejhqhvsGz41Wkvdb4JqOaX/dFVbI7ShUriAxLWMVVuBNfLGN7JpRCNvhFQ3ZbvSCqLANTg6zPdHLV4tXJhGb5xWFH41gU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711557940; c=relaxed/simple; bh=4aR3m2SjWqChSXYKCt63Vv0Bjg6RMaEe6T3zRnV9swU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=X11Wqn0Qc/2kkaZi1BJbAK43ItJoBegJGIvumjJOBuEhmR0OXlWSAqfU45F/Jc3xA7ZCHlKyWmwvuIwTsDJULXB3cwxJYhGA78ArL74cCTvfQd5n6d+mNIqFhIOm18xKgqyYG6FIgQ2SwF37HVwXYyPXTu3wJ8rVyty84KJdYSE= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pl1-x633.google.com with SMTP id d9443c01a7336-1df01161b39so183865ad.3 for ; Wed, 27 Mar 2024 09:45:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711557937; x=1712162737; 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=HTwxuMR5ucDSMpp4J0Kk3EI0Ie85RaR9Xaq7XFWHhq0=; b=G+QGS+wqM4Waw5uQXeOZK977hREhvems3Ifzh+b//aL9w/l3NRqey+f90/dB05pFof /OMvj2VAT+qSFSYlLDWU6o4jdYm8abP/SRhK2p78FgL0AtbNkwyyk0dTk8SydcFW5hBM ozjb4wrPqJANc9TDvhfQEqUNkWzAi6B/+9T38Pl494n3nuCaAnQvwLiO7CzXxWmNaSs4 tbAKcaS3FD/8eI7RZaQvqGKiyRBZWVj3hXhjHH032wTDAr88FZlDU9HGI5KGF9iKJESR dWU4zg81zI/7VLh+/3XdTRGU4MbzNf2xzspI5JB2C1SGDAOZ9mgQVrmJdKbIdiKOzkqc 2iFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711557937; x=1712162737; 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=HTwxuMR5ucDSMpp4J0Kk3EI0Ie85RaR9Xaq7XFWHhq0=; b=LcBTWtp3z+tYfm0Le83w/Lsi7AD83HNfFLSvLB9Utr9PkdvHaUFolxTYYiC9T5Fg45 M2QYoxGKJcrIxDs1xsvd7gjnQJwa//FsbhkUFxe+2l/uf9Vg3KO2/FYaTkxw+o++2K0D 5oJ/35hKvUJ/RTiX78XFJPBzMvG9zP0sd1gs87/oGweAovuwF1GqgXi1PFVoyRJBAPvO bmo1BTRL2ytJgu8t7Ax2z/CfU58u4vrH/KLxqzDH5q4S9l9RzUiHNUuEWRSa428JykT3 0pd83e80OLxH4dbKl5UZRllfZ2B54Mm02SelTJH/qFTKZlVG4fLuaCW7wX9bCLCuYiTP brgQ== X-Gm-Message-State: AOJu0Yys7Jm3UgK0ilh9zGytGSekpOu0VXlDMbS4xL9AfjV4tvy0IwvR /FjTXtes17NTmDoPSVbJwvFRg+XA5Ws741yxSVNlgJwgokkMsao4rCtQI3r1rz183nBSijQv2PT k X-Google-Smtp-Source: AGHT+IFN0l6fGdT5G6cUn7kGhSY7bPyKfLMqhe8KyUUVgjhxSsqAb1cLauFfChihSIcCU3FEWHdk2g== X-Received: by 2002:a17:902:f54a:b0:1e0:fc73:8f81 with SMTP id h10-20020a170902f54a00b001e0fc738f81mr282804plf.64.1711557936997; Wed, 27 Mar 2024 09:45:36 -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.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:45:36 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH 02/15] math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) Date: Wed, 27 Mar 2024 13:45:14 -0300 Message-Id: <20240327164527.3717523-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240327164527.3717523-1-adhemerval.zanella@linaro.org> References: <20240327164527.3717523-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+incoming=patchwork.ozlabs.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. --- 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 fb537955fb..964bf2be71 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-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