From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by sourceware.org (Postfix) with ESMTPS id 2FB68385B529 for ; Tue, 21 May 2024 12:54:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2FB68385B529 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 2FB68385B529 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::42d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716296068; cv=none; b=t3C25eAN1rlmvDmVxBXYIFZhFmwXxTY+G0nQXpNCC4ScUA65V7acNC4z83biVKv/fL1CQt9WCWlMWPF/rKFfAjwuWNKKWhpPt7O/6i1uqxOP1eCgq3YN1/Sj2EZpNFNpqB3VdpNf4CI4JaonWf7NBWdPJUkEO2aEvcy090+9jdw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1716296068; c=relaxed/simple; bh=mqiEdhIjazVy94fBCsFhMCzvG0mLXIZs2OIuiK92PN4=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=rZ7CoUNzCeJkorV+i40XpbSakgeTCis9GYl9/79kV0EtPqAH/XMlBQc5eXbhN5HFvpw/N0Cr3WgtcdtouQAoKOFR6wNxOjblgelNX9I12+G32YXs6S9s+oly2k6/vdODhQsleumz6s/rOrwkchxWCcq5K6NEFbpfeAFfGLVkGs4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-pf1-x42d.google.com with SMTP id d2e1a72fcca58-6f67f4bebadso324725b3a.0 for ; Tue, 21 May 2024 05:54:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716296065; x=1716900865; darn=sourceware.org; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=hfCbgXleD+Lq58NYrdAChPlLnkqfxNNzW61R/lByOWM=; b=GibOQJi7Nifhl2SD7JHQEgsdhYScv/Hr5Z+5bB5lUzFEiEuzYA2SigEZGLOqfqtXcP H+AqvxBsXx3mjFq5r/RrT9ntDl3VOJjlvqnP+cC8FACBvG+oMHZAta9fzDg0fRwB2UPr IMzBTxdXO+X4WfEoJH3puy6okuZEaGm+8VG9pGn1hCGgJlsHPE8AjBpLwHGKrMMhHoB/ udIVUKvuqjHdl0KPK3dmwRyvZYgNK4mb0pqatWAdU570rr/5EvQL3Sm+ujB74IrZB+BR 85bIACbpdt8kZM37FwxTUDmmCA5xB7gTVlBeBU8BIyT6LtqeoDXfjIbPhOx7HTyAXvHQ hKjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716296065; x=1716900865; h=content-transfer-encoding:in-reply-to:organization:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hfCbgXleD+Lq58NYrdAChPlLnkqfxNNzW61R/lByOWM=; b=s5YCR4h5iit5gyHBiPhZflO8ll740OiUm0Cm1nScmiKLn6Wxxs8r3GkuG6y2cX8jvE ErV4ELlrvRWQQ7K/gu35xvK9dWqT6Ynq6tfeZ0BcBwjGisskOqHbnQo5fFIZJmEoTa8o Fl6/wNTK1ZWCemEG2qmD0jHzhVDuuObJ/UNpfPl2k3ZwSn2podomcNnQStoSqSDv+gqG W3jnvN5tl3CUU6MTkzeMaeJOnCyUsB3gmk+4zIx5YdtDPvXLsidjedRAgu4VwxAuFE7O wBr6SAq11bORIXsztO06+bf36O0/heiWGqZtaUYlGGgbMvBMSsjjdo4ddTXr99ktYLNq oexg== X-Gm-Message-State: AOJu0YzR1HPs0aohjnxrVgGnpY7JX03HymmQCE2lJWBMjxiDgxGxsYyu k+opYRzJiTfqjXzje8hQYfW6DQbm6aAWEdCgJ0tf2vcXT9AfLpjFNqDWYmdY+Bs= X-Google-Smtp-Source: AGHT+IFMKgAC+9DRo8ef0d4S5O3iA0uTKjTEJPodeAFrioWkRWIMqn96TYbRKwjriEt/6qxY5VvgqA== X-Received: by 2002:a05:6a00:3a01:b0:6ed:5f64:2ff4 with SMTP id d2e1a72fcca58-6f4e02af0d1mr35682350b3a.14.1716296065059; Tue, 21 May 2024 05:54:25 -0700 (PDT) Received: from ?IPV6:2804:1b3:a7c2:f76a:f586:fbab:daec:c9bf? ([2804:1b3:a7c2:f76a:f586:fbab:daec:c9bf]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f4d2ade270sm20784264b3a.119.2024.05.21.05.54.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 21 May 2024 05:54:23 -0700 (PDT) Message-ID: <85e92f1a-07ca-4413-993b-a4124f44d041@linaro.org> Date: Tue, 21 May 2024 09:54:20 -0300 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/7] math: Fix i386 and m68k fmod/fmodf on static build (BZ 31488) To: "H.J. Lu" Cc: libc-alpha@sourceware.org, Joseph Myers , Florian Weimer References: <20240402140644.2172819-1-adhemerval.zanella@linaro.org> <20240402140644.2172819-3-adhemerval.zanella@linaro.org> Content-Language: en-US From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-12.8 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 List-Id: On 21/05/24 09:40, H.J. Lu wrote: > On Tue, Apr 2, 2024 at 7:06 AM Adhemerval Zanella > wrote: >> >> 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'. >> --- >> 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 >> -- >> 2.34.1 >> > > My WIP static ABI check identified exp10 exp10f32x exp10f64 fmod fmodf fmodf32 > fmodf32x fmodf64 are missing in i386 libm.a: > > https://sourceware.org/bugzilla/show_bug.cgi?id=31775 > > Does your patch fix all of them? > Yes, that the idea of this patchset: i686-linux-gnu$ readelf -sW math/libm.a | grep -E -w 'exp10|exp10f32x|exp10f64|fmod|fmodf|fmodf32|fmodf32x|fmodf64' 17: 00000000 160 FUNC WEAK DEFAULT 2 exp10f32x 18: 00000000 160 FUNC WEAK DEFAULT 2 exp10f64 19: 00000000 160 FUNC WEAK DEFAULT 2 exp10 17: 00000000 140 FUNC WEAK DEFAULT 2 fmodf32x 18: 00000000 140 FUNC WEAK DEFAULT 2 fmodf64 19: 00000000 140 FUNC WEAK DEFAULT 2 fmod 17: 00000000 140 FUNC WEAK DEFAULT 2 fmodf32 18: 00000000 140 FUNC WEAK DEFAULT 2 fmodf