[PATCH] powerpc64le: guarantee a .gnu.attributes section [BZ #26220]

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] powerpc64le: guarantee a .gnu.attributes section [BZ #26220]

Sourceware - libc-alpha mailing list
Upstream GCC 11 development is now building the ibm128 runtime
support (in libgcc) without a .gnu.attributes section on ppc64le.
Ensure we have one to replace by building one ibm128 file in
libc and libm with attributes.
---
 sysdeps/powerpc/powerpc64/le/Makefile | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile
index 05ab13d85c..033dc77b01 100644
--- a/sysdeps/powerpc/powerpc64/le/Makefile
+++ b/sysdeps/powerpc/powerpc64/le/Makefile
@@ -38,6 +38,14 @@ if [ ! -z "$(filter libm.so libc.so,$(notdir $1))" ]; then \
 fi
 endef
 
+# Ensure a .gnu.attributes section is present by building an ibm128 file with
+# -mgnu-attribute in both libm and libc shared libraries.  Prior to GCC 11 this
+# section was implicitly included via static libgcc ibm128 routines.
+ifeq ($(subdir),math)
+$(objpfx)m_ldexpl.os: CFLAGS += -mgnu-attribute
+$(objpfx)s_ldexpl.os: CFLAGS += -mgnu-attribute
+endif
+
 endif # ifeq ($(build-shared),yes)
 endif # ifeq ($(ibm128-fcts),yes)
 
--
2.26.2

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] powerpc64le: guarantee a .gnu.attributes section [BZ #26220]

Tulio Magno Quites Machado Filho-3
"Paul E. Murphy via Libc-alpha" <[hidden email]> writes:

> Upstream GCC 11 development is now building the ibm128 runtime
> support (in libgcc) without a .gnu.attributes section on ppc64le.
> Ensure we have one to replace by building one ibm128 file in
> libc and libm with attributes.

Tested with GCC master and LGTM.

But I think it also need to be approved by Carlos before it gets merged in
glibc 2.32.

Reviewed-by: Tulio Magno Quites Machado Filho <[hidden email]>

--
Tulio Magno

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] powerpc64le: guarantee a .gnu.attributes section [BZ #26220]

Sourceware - libc-alpha mailing list
In reply to this post by Sourceware - libc-alpha mailing list
On 7/8/20 6:23 PM, Paul E. Murphy via Libc-alpha wrote:

> Upstream GCC 11 development is now building the ibm128 runtime
> support (in libgcc) without a .gnu.attributes section on ppc64le.
> Ensure we have one to replace by building one ibm128 file in
> libc and libm with attributes.
> ---
>  sysdeps/powerpc/powerpc64/le/Makefile | 8 ++++++++
>  1 file changed, 8 insertions(+)
>
> diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile
> index 05ab13d85c..033dc77b01 100644
> --- a/sysdeps/powerpc/powerpc64/le/Makefile
> +++ b/sysdeps/powerpc/powerpc64/le/Makefile
> @@ -38,6 +38,14 @@ if [ ! -z "$(filter libm.so libc.so,$(notdir $1))" ]; then \
>  fi
>  endef
>  
> +# Ensure a .gnu.attributes section is present by building an ibm128 file with
> +# -mgnu-attribute in both libm and libc shared libraries.  Prior to GCC 11 this
> +# section was implicitly included via static libgcc ibm128 routines.
> +ifeq ($(subdir),math)
> +$(objpfx)m_ldexpl.os: CFLAGS += -mgnu-attribute
> +$(objpfx)s_ldexpl.os: CFLAGS += -mgnu-attribute
> +endif
> +
>  endif # ifeq ($(build-shared),yes)
>  endif # ifeq ($(ibm128-fcts),yes)
>  
>

I'll admit this seems a bit hackish. I would have expected the compiler
would have output something that marked the object as using the ibm128
with gnu attributes by default, but I guess that isn't a default and
you have to ask for the attributes?

OK for 2.32.

Reviewed-by: Carlos O'Donell <[hidden email]>

--
Cheers,
Carlos.

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] powerpc64le: guarantee a .gnu.attributes section [BZ #26220]

Sourceware - libc-alpha mailing list


On 7/17/20 4:03 PM, Carlos O'Donell wrote:

> On 7/8/20 6:23 PM, Paul E. Murphy via Libc-alpha wrote:
>> Upstream GCC 11 development is now building the ibm128 runtime
>> support (in libgcc) without a .gnu.attributes section on ppc64le.
>> Ensure we have one to replace by building one ibm128 file in
>> libc and libm with attributes.
>> ---
>>   sysdeps/powerpc/powerpc64/le/Makefile | 8 ++++++++
>>   1 file changed, 8 insertions(+)
>>
>> diff --git a/sysdeps/powerpc/powerpc64/le/Makefile b/sysdeps/powerpc/powerpc64/le/Makefile
>> index 05ab13d85c..033dc77b01 100644
>> --- a/sysdeps/powerpc/powerpc64/le/Makefile
>> +++ b/sysdeps/powerpc/powerpc64/le/Makefile
>> @@ -38,6 +38,14 @@ if [ ! -z "$(filter libm.so libc.so,$(notdir $1))" ]; then \
>>   fi
>>   endef
>>  
>> +# Ensure a .gnu.attributes section is present by building an ibm128 file with
>> +# -mgnu-attribute in both libm and libc shared libraries.  Prior to GCC 11 this
>> +# section was implicitly included via static libgcc ibm128 routines.
>> +ifeq ($(subdir),math)
>> +$(objpfx)m_ldexpl.os: CFLAGS += -mgnu-attribute
>> +$(objpfx)s_ldexpl.os: CFLAGS += -mgnu-attribute
>> +endif
>> +
>>   endif # ifeq ($(build-shared),yes)
>>   endif # ifeq ($(ibm128-fcts),yes)
>>  
>>
>
> I'll admit this seems a bit hackish. I would have expected the compiler
> would have output something that marked the object as using the ibm128
> with gnu attributes by default, but I guess that isn't a default and
> you have to ask for the attributes?

Yes, but I think libc/libm should provide a permissive gnu attributes
section on libc/libm instead of stripping it.  We disabled this feature
when building glibc to avoid the linking warning/errors, thus any
externally built and subsequently linked libraries might provide their
own.

I have committed this patch.  Thank you Carlos and Tulio for reviewing.