diff mbox series

[v3,3/7] math: Fix i386 and m68k exp10 on static build

Message ID 20240402140644.2172819-4-adhemerval.zanella@linaro.org
State New
Headers show
Series Fix some libm static issues | expand

Commit Message

Adhemerval Zanella Netto April 2, 2024, 2:06 p.m. UTC
The commit 08ddd26814 removed the static exp10 on i386 and m68k with an
empty w_exp10.c (required for the ABIs that uses the newly
implementation).  This patch fixes by adding the required symbols on the
arch-specific w_exp{f}_compat.c implementation.

Checked on i686-linux-gnu and with a build for m68k-linux-gnu with
'make test t=math/test-{float,double}-exp10-static build-math-static-tests=yes'
---
 sysdeps/i386/fpu/w_exp10_compat.c        | 9 +++++++--
 sysdeps/m68k/m680x0/fpu/w_exp10_compat.c | 9 +++++++--
 2 files changed, 14 insertions(+), 4 deletions(-)

Comments

Aurelien Jarno May 11, 2024, 9:59 a.m. UTC | #1
On 2024-04-02 11:06, Adhemerval Zanella wrote:
> The commit 08ddd26814 removed the static exp10 on i386 and m68k with an
> empty w_exp10.c (required for the ABIs that uses the newly
> implementation).  This patch fixes by adding the required symbols on the
> arch-specific w_exp{f}_compat.c implementation.
> 
> Checked on i686-linux-gnu and with a build for m68k-linux-gnu with
> 'make test t=math/test-{float,double}-exp10-static build-math-static-tests=yes'
> ---
>  sysdeps/i386/fpu/w_exp10_compat.c        | 9 +++++++--
>  sysdeps/m68k/m680x0/fpu/w_exp10_compat.c | 9 +++++++--
>  2 files changed, 14 insertions(+), 4 deletions(-)

Reviewed-by: Aurelien Jarno <aurelien@aurel32.net>
H.J. Lu May 21, 2024, 12:48 p.m. UTC | #2
On Tue, Apr 2, 2024 at 7:06 AM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> The commit 08ddd26814 removed the static exp10 on i386 and m68k with an
> empty w_exp10.c (required for the ABIs that uses the newly
> implementation).  This patch fixes by adding the required symbols on the
> arch-specific w_exp{f}_compat.c implementation.
>
> Checked on i686-linux-gnu and with a build for m68k-linux-gnu with
> 'make test t=math/test-{float,double}-exp10-static build-math-static-tests=yes'
> ---
>  sysdeps/i386/fpu/w_exp10_compat.c        | 9 +++++++--
>  sysdeps/m68k/m680x0/fpu/w_exp10_compat.c | 9 +++++++--
>  2 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/sysdeps/i386/fpu/w_exp10_compat.c b/sysdeps/i386/fpu/w_exp10_compat.c
> index b53455386e..49a0e03385 100644
> --- a/sysdeps/i386/fpu/w_exp10_compat.c
> +++ b/sysdeps/i386/fpu/w_exp10_compat.c
> @@ -1,3 +1,8 @@
>  /* i386 provides an optimized __ieee754_exp10.  */
> -#define NO_COMPAT_NEEDED 1
> -#include <math/w_exp10_compat.c>
> +#ifdef SHARED
> +# define NO_COMPAT_NEEDED 1
> +# include <math/w_exp10_compat.c>
> +#else
> +# include <math-type-macros-double.h>
> +# include <w_exp10_template.c>
> +#endif
> diff --git a/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c b/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
> index 0d3e718626..350f2e4b4d 100644
> --- a/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
> +++ b/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
> @@ -1,3 +1,8 @@
>  /* m68k provides an optimized __ieee754_exp10.  */
> -#define NO_COMPAT_NEEDED 1
> -#include <math/w_exp10_compat.c>
> +#ifdef SHARED
> +# define NO_COMPAT_NEEDED 1
> +# include <math/w_exp10_compat.c>
> +#else
> +# include <math-type-macros-double.h>
> +# include <w_exp10_template.c>
> +#endif
> --
> 2.34.1
>

Please mention:

https://sourceware.org/bugzilla/show_bug.cgi?id=31775

in the commit log.
Adhemerval Zanella Netto May 21, 2024, 12:54 p.m. UTC | #3
On 21/05/24 09:48, H.J. Lu wrote:
> On Tue, Apr 2, 2024 at 7:06 AM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>> The commit 08ddd26814 removed the static exp10 on i386 and m68k with an
>> empty w_exp10.c (required for the ABIs that uses the newly
>> implementation).  This patch fixes by adding the required symbols on the
>> arch-specific w_exp{f}_compat.c implementation.
>>
>> Checked on i686-linux-gnu and with a build for m68k-linux-gnu with
>> 'make test t=math/test-{float,double}-exp10-static build-math-static-tests=yes'
>> ---
>>  sysdeps/i386/fpu/w_exp10_compat.c        | 9 +++++++--
>>  sysdeps/m68k/m680x0/fpu/w_exp10_compat.c | 9 +++++++--
>>  2 files changed, 14 insertions(+), 4 deletions(-)
>>
>> diff --git a/sysdeps/i386/fpu/w_exp10_compat.c b/sysdeps/i386/fpu/w_exp10_compat.c
>> index b53455386e..49a0e03385 100644
>> --- a/sysdeps/i386/fpu/w_exp10_compat.c
>> +++ b/sysdeps/i386/fpu/w_exp10_compat.c
>> @@ -1,3 +1,8 @@
>>  /* i386 provides an optimized __ieee754_exp10.  */
>> -#define NO_COMPAT_NEEDED 1
>> -#include <math/w_exp10_compat.c>
>> +#ifdef SHARED
>> +# define NO_COMPAT_NEEDED 1
>> +# include <math/w_exp10_compat.c>
>> +#else
>> +# include <math-type-macros-double.h>
>> +# include <w_exp10_template.c>
>> +#endif
>> diff --git a/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c b/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
>> index 0d3e718626..350f2e4b4d 100644
>> --- a/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
>> +++ b/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
>> @@ -1,3 +1,8 @@
>>  /* m68k provides an optimized __ieee754_exp10.  */
>> -#define NO_COMPAT_NEEDED 1
>> -#include <math/w_exp10_compat.c>
>> +#ifdef SHARED
>> +# define NO_COMPAT_NEEDED 1
>> +# include <math/w_exp10_compat.c>
>> +#else
>> +# include <math-type-macros-double.h>
>> +# include <w_exp10_template.c>
>> +#endif
>> --
>> 2.34.1
>>
> 
> Please mention:
> 
> https://sourceware.org/bugzilla/show_bug.cgi?id=31775
> 
> in the commit log.
> 

Ack.
diff mbox series

Patch

diff --git a/sysdeps/i386/fpu/w_exp10_compat.c b/sysdeps/i386/fpu/w_exp10_compat.c
index b53455386e..49a0e03385 100644
--- a/sysdeps/i386/fpu/w_exp10_compat.c
+++ b/sysdeps/i386/fpu/w_exp10_compat.c
@@ -1,3 +1,8 @@ 
 /* i386 provides an optimized __ieee754_exp10.  */
-#define NO_COMPAT_NEEDED 1
-#include <math/w_exp10_compat.c>
+#ifdef SHARED
+# define NO_COMPAT_NEEDED 1
+# include <math/w_exp10_compat.c>
+#else
+# include <math-type-macros-double.h>
+# include <w_exp10_template.c>
+#endif
diff --git a/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c b/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
index 0d3e718626..350f2e4b4d 100644
--- a/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
+++ b/sysdeps/m68k/m680x0/fpu/w_exp10_compat.c
@@ -1,3 +1,8 @@ 
 /* m68k provides an optimized __ieee754_exp10.  */
-#define NO_COMPAT_NEEDED 1
-#include <math/w_exp10_compat.c>
+#ifdef SHARED
+# define NO_COMPAT_NEEDED 1
+# include <math/w_exp10_compat.c>
+#else
+# include <math-type-macros-double.h>
+# include <w_exp10_template.c>
+#endif