From patchwork Wed Mar 27 19:40:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adhemerval Zanella X-Patchwork-Id: 783150 Delivered-To: patch@linaro.org Received: by 2002:a5d:4e01:0:b0:33e:7753:30bd with SMTP id p1csp2374616wrt; Wed, 27 Mar 2024 12:40:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWB0Lp7GMJWq/ocNIMf/lWtDtvAqkKraJUs9lU3UK0TITBVFWHUk1jN/oZaJ1jCaUHbqs/w4waEiS6ThBwe3ryR X-Google-Smtp-Source: AGHT+IHK/Ckv+j3LepSAT0t4heKyQAubnM/KBoiJTcr1plxhtIINCWr7WvQJGJGEAdrJKYe5pawU X-Received: by 2002:a9d:4f06:0:b0:6e6:ebef:555d with SMTP id d6-20020a9d4f06000000b006e6ebef555dmr906617otl.11.1711568458101; Wed, 27 Mar 2024 12:40:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711568458; cv=pass; d=google.com; s=arc-20160816; b=LTUnUt/oqo+1iwOCzx0hYPEaG6uEhtAK0XlMGML0szGCFMCb7ZEMatWXyb4OEYrBw+ ROgnCFiahZjOgsi2ipJ9v/AFViYosZKs+ySB3n1Jt1oBV0r6RqexDdtlEirwSeMM3ThK i1loSUep5K1tvBW+Nfj/Vqn7zYw15ildlFI9XsNNXasFBfiHLZggO5JgDuTpLGuCsQmg bmxUIxzl2qSaQjH7UeFVz4IkjfH3Y4MZVqqrOsRDK5zSbqrm/TgtTicz3vSLOnRJnJ/J XIhU3Df1i9OyoPQKsZUM2wgtnz6YWYa15g7ntAPL4pZEG9y2y/zgYEVqKf/hsc3jo+KS qw0w== 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=HTwxuMR5ucDSMpp4J0Kk3EI0Ie85RaR9Xaq7XFWHhq0=; fh=WtLnUd2EuDKv+EP3BSdEI8hdivapDDAq3MY9+WgWrlk=; b=jjSPRu5uI38ay3rKlk6f9vfQN4aBc7xIyp4P7hJYtxeL+1dje7sEHfkHKULgucOdL7 Q2qAU5r1xUAQ4REtweCdva/Nq0XHfdTy9hbTzDCTFV8dYd3NlbokSjqDG3HD0o0sudWX p/89YbfKtCbnpNA/jvhBFtnDRqFPgeKjN9/YudUDFoPIyYdrQG7ua2W9rW9dQUIlVOu8 8Erbd21NAfCnyTfoZ0/B9aWAFeDzbuWhcDRIVs9wkNxITaKCSbGTT3FIj68mvuOhKe4t x+Pu1QqsTfP94Vj4ZiE+fKvjhL093Bph02gp5fu90SAsFqvLxdjyiF3e/FIG2gJsI+rH IjMQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uSUd22tS; 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 z8-20020ae9e608000000b007886d6a333bsi10529615qkf.351.2024.03.27.12.40.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 12:40:58 -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=uSUd22tS; 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 B453A385E445 for ; Wed, 27 Mar 2024 19:40:57 +0000 (GMT) X-Original-To: libc-alpha@sourceware.org Delivered-To: libc-alpha@sourceware.org Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by sourceware.org (Postfix) with ESMTPS id 201BE385C6EE for ; Wed, 27 Mar 2024 19:40:35 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 201BE385C6EE 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 201BE385C6EE Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42c ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711568437; cv=none; b=Ruqies5HXLjOihkhHWbdnshk+94ekZR0UwuoY2LER7295WGYP+lIveffidQSa2dfhj+7IsZP7Yx5k+Vq0hsAemAuInEnI4VpTu0XMbB9SkvDdM6SlOu7zsF0KDab+D36pjn7C/YyI0nZ0FTnxDXm6nnGwv61QSAgu2b+jD+SnB0= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1711568437; c=relaxed/simple; bh=4aR3m2SjWqChSXYKCt63Vv0Bjg6RMaEe6T3zRnV9swU=; h=DKIM-Signature:From:To:Subject:Date:Message-Id:MIME-Version; b=iKehDdKyofpNJfSXSds61YegHDrVptuM6hHUuUtFR/n8af1kcK08Xdfg1eoVG5gfsGzAumRCF37kHSs4JNj+U61gNygW2KW6IK0qeJHkbvsuTicR1GenKlxgwsnorFxmQuTb52gFLZ6hLmQglShpXHkWt4lOgUdGCH4HKkX7Dhg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42c.google.com with SMTP id d2e1a72fcca58-6ea9a60f7f5so206521b3a.3 for ; Wed, 27 Mar 2024 12:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1711568433; x=1712173233; 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=uSUd22tSooCT2c5ZE9NVI0wH1s+o4+3CzGMzzmvf987yO+HobbpTChxGIPYSJtWOe5 xRAhLYV8jGyzUvV/wJTzZGJKB/bDwkbwncP5PEHmpOZz/9pzKXPFOn+kv7dW09XRGNc3 1ldfYbQNjg6PE0FptPHQaXJXRHHvs8oov3p+rY5kdS0pniMglQJumnIt6I5F7SUfLVNb iJCf77YZmBO7AoMI4T6ZbnYfsVeApuivZ/fjUXAOwKbMpJoAviTAg19qzgP1NlOUlrfG sFAuOd3Fapzf25t3Ujujqs5jsbL0IdBLjfemmR7s66z4dVyd46bxXJ7t04UTnxYpv+9p wasg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711568433; x=1712173233; 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=aOG+RcUQ6yLzJEXTGE9FhD2l0azkldD98L1pZIC2T0huhfrUcmREsH9CQF56EWjf15 9nEunj95BDX6BkuFMhIRc5vtOWtTn3uvAo9lZe7geq+2VzR6K/lsrlpNMNF8dvWtbnvD qdY2yvpezdP1Ryi2wdvhwfbzSmUOCqqmWbiogYCk1Yd0NyE0i2Xg0VdiwW8WAnB+MN0H CzKvn4DRBZylXGwVMBGUF6ectabiFagLjdIiyONb19tcA1JBgfy0ShbGn1bvuvzBKFd+ 0IN7L32+H8F31FsrIFf8hVhfWLvvZsbniJpBeadPvB6r+9bZn40YXxLfu0oEhmN5sXIF fr4g== X-Gm-Message-State: AOJu0YxPcOZ8GkkIsxMMSpm5maE3YHAM9YLwI+xY4p/0sO1Br12FxSuR cn6Dm3nU94FaG9UJwMVpJIhsEATk0Kue4cWd8UY2X7ZxS9p21KnVB/sUnjfPSG40Eu9fMtyYQgV r X-Received: by 2002:a05:6a21:a585:b0:1a3:6dbb:f072 with SMTP id gd5-20020a056a21a58500b001a36dbbf072mr1174537pzc.8.1711568433464; Wed, 27 Mar 2024 12:40:33 -0700 (PDT) Received: from mandiga.. ([2804:1b3:a7c3:b18e:67c4:6248:3d8a:f386]) by smtp.gmail.com with ESMTPSA id p11-20020a17090a348b00b002a091be027esm2277357pjb.31.2024.03.27.12.40.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 12:40:32 -0700 (PDT) From: Adhemerval Zanella To: libc-alpha@sourceware.org Cc: Joseph Myers , Florian Weimer , "H . J . Lu" Subject: [PATCH v2 02/10] math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) Date: Wed, 27 Mar 2024 16:40:16 -0300 Message-Id: <20240327194024.1409677-3-adhemerval.zanella@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> References: <20240327194024.1409677-1-adhemerval.zanella@linaro.org> MIME-Version: 1.0 X-Spam-Status: No, score=-12.6 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. --- 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