diff mbox series

[v3,5/7] math: Provided copysignf128 for static libm on alpha, s390, and sparcv9

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

Commit Message

Adhemerval Zanella April 2, 2024, 2:06 p.m. UTC
Checked with a static build for the affected ABIs.
---
 sysdeps/ieee754/ldbl-64-128/s_copysignl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

H.J. Lu May 20, 2024, 4:55 p.m. UTC | #1
On Tue, Apr 2, 2024 at 7:07 AM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> Checked with a static build for the affected ABIs.
> ---
>  sysdeps/ieee754/ldbl-64-128/s_copysignl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
> index 11b42d04ba..80137847d3 100644
> --- a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
> +++ b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
> @@ -1,10 +1,10 @@
>  #include <math_ldbl_opt.h>
>  #include <libm-alias-ldouble.h>
> -#if IS_IN (libc)
> +#if IS_IN (libc) && defined SHARED
>  # undef libm_alias_ldouble
>  # define libm_alias_ldouble(from, to)
>  #endif
>  #include <sysdeps/ieee754/ldbl-128/s_copysignl.c>
> -#if IS_IN (libc)
> +#if IS_IN (libc) && defined SHARED

Doesn't this remove copysignl from libm.a?

>  long_double_symbol (libc, __copysignl, copysignl);
>  #endif
> --
> 2.34.1
>
Adhemerval Zanella May 20, 2024, 7:04 p.m. UTC | #2
On 20/05/24 13:55, H.J. Lu wrote:
> On Tue, Apr 2, 2024 at 7:07 AM Adhemerval Zanella
> <adhemerval.zanella@linaro.org> wrote:
>>
>> Checked with a static build for the affected ABIs.
>> ---
>>  sysdeps/ieee754/ldbl-64-128/s_copysignl.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
>> index 11b42d04ba..80137847d3 100644
>> --- a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
>> +++ b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
>> @@ -1,10 +1,10 @@
>>  #include <math_ldbl_opt.h>
>>  #include <libm-alias-ldouble.h>
>> -#if IS_IN (libc)
>> +#if IS_IN (libc) && defined SHARED
>>  # undef libm_alias_ldouble
>>  # define libm_alias_ldouble(from, to)
>>  #endif
>>  #include <sysdeps/ieee754/ldbl-128/s_copysignl.c>
>> -#if IS_IN (libc)
>> +#if IS_IN (libc) && defined SHARED
> 
> Doesn't this remove copysignl from libm.a?

There is no copysignl from libm.a, it is provided by libc.a for such
ABIs.  Without this path:

alpha-linux-gnu$ readelf -sW libc.a | grep -w copysign.*
    14: 0000000000000000    52 FUNC    WEAK   DEFAULT [NOPV]     1 copysignl
    14: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf32x
    15: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf64
    16: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysign
    14: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf32
    15: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf

After this patch:

alpha-linux-gnu$ readelf -sW libc.a | grep -w copysign.*
    14: 0000000000000000    52 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf64x
    15: 0000000000000000    52 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf128
    16: 0000000000000000    52 FUNC    WEAK   DEFAULT [NOPV]     1 copysignl
    14: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf32x
    15: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf64
    16: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysign
    14: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf32
    15: 0000000000000000     8 FUNC    WEAK   DEFAULT [NOPV]     1 copysignf

> 
>>  long_double_symbol (libc, __copysignl, copysignl);
>>  #endif
>> --
>> 2.34.1
>>
> 
>
diff mbox series

Patch

diff --git a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
index 11b42d04ba..80137847d3 100644
--- a/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
+++ b/sysdeps/ieee754/ldbl-64-128/s_copysignl.c
@@ -1,10 +1,10 @@ 
 #include <math_ldbl_opt.h>
 #include <libm-alias-ldouble.h>
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 # undef libm_alias_ldouble
 # define libm_alias_ldouble(from, to)
 #endif
 #include <sysdeps/ieee754/ldbl-128/s_copysignl.c>
-#if IS_IN (libc)
+#if IS_IN (libc) && defined SHARED
 long_double_symbol (libc, __copysignl, copysignl);
 #endif