[PATCH] i386: Disable check_consistency for GCC 5 and above [BZ #25788]

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

[PATCH] i386: Disable check_consistency for GCC 5 and above [BZ #25788]

Sourceware - libc-alpha mailing list
check_consistency should be disabled for GCC 5 and above since there is
no fixed PIC register in GCC 5 and above.  Check __GNUC_PREREQ (5,0)
instead OPTIMIZE_FOR_GCC_5 since OPTIMIZE_FOR_GCC_5 is false with
-fno-omit-frame-pointer.
---
 sysdeps/unix/sysv/linux/i386/sysdep.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
index 5e3888060b..6671afe65e 100644
--- a/sysdeps/unix/sysv/linux/i386/sysdep.h
+++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
@@ -580,8 +580,9 @@ struct libc_do_syscall_args
 # define EXTRAVAR_5
 #endif
 
-/* Consistency check for position-independent code.  */
-#if defined __PIC__ && !defined OPTIMIZE_FOR_GCC_5
+/* Consistency check for position-independent code.  Disabled for GCC 5
+   and above since there is no fixed PIC register in GCC 5 and above.  */
+#if defined __PIC__ && !__GNUC_PREREQ (5,0)
 # define check_consistency()      \
   ({ int __res;      \
      __asm__ __volatile__      \
--
2.25.1

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] i386: Disable check_consistency for GCC 5 and above [BZ #25788]

Sourceware - libc-alpha mailing list


On 06/04/2020 10:24, H.J. Lu via Libc-alpha wrote:

> check_consistency should be disabled for GCC 5 and above since there is
> no fixed PIC register in GCC 5 and above.  Check __GNUC_PREREQ (5,0)
> instead OPTIMIZE_FOR_GCC_5 since OPTIMIZE_FOR_GCC_5 is false with
> -fno-omit-frame-pointer.
> ---
>  sysdeps/unix/sysv/linux/i386/sysdep.h | 5 +++--
>  1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
> index 5e3888060b..6671afe65e 100644
> --- a/sysdeps/unix/sysv/linux/i386/sysdep.h
> +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
> @@ -580,8 +580,9 @@ struct libc_do_syscall_args
>  # define EXTRAVAR_5
>  #endif
>  
> -/* Consistency check for position-independent code.  */
> -#if defined __PIC__ && !defined OPTIMIZE_FOR_GCC_5
> +/* Consistency check for position-independent code.  Disabled for GCC 5
> +   and above since there is no fixed PIC register in GCC 5 and above.  */
> +#if defined __PIC__ && !__GNUC_PREREQ (5,0)
>  # define check_consistency()      \
>    ({ int __res;      \
>       __asm__ __volatile__      \
>

I think we can just remove the check_consistency altogether, since
we already required GCC 6.2 or later to build gcc (4dcbbc3b28a).
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] i386: Disable check_consistency for GCC 5 and above [BZ #25788]

Sourceware - libc-alpha mailing list
On Mon, Apr 6, 2020 at 6:31 AM Adhemerval Zanella via Libc-alpha
<[hidden email]> wrote:

>
>
>
> On 06/04/2020 10:24, H.J. Lu via Libc-alpha wrote:
> > check_consistency should be disabled for GCC 5 and above since there is
> > no fixed PIC register in GCC 5 and above.  Check __GNUC_PREREQ (5,0)
> > instead OPTIMIZE_FOR_GCC_5 since OPTIMIZE_FOR_GCC_5 is false with
> > -fno-omit-frame-pointer.
> > ---
> >  sysdeps/unix/sysv/linux/i386/sysdep.h | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> >
> > diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
> > index 5e3888060b..6671afe65e 100644
> > --- a/sysdeps/unix/sysv/linux/i386/sysdep.h
> > +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
> > @@ -580,8 +580,9 @@ struct libc_do_syscall_args
> >  # define EXTRAVAR_5
> >  #endif
> >
> > -/* Consistency check for position-independent code.  */
> > -#if defined __PIC__ && !defined OPTIMIZE_FOR_GCC_5
> > +/* Consistency check for position-independent code.  Disabled for GCC 5
> > +   and above since there is no fixed PIC register in GCC 5 and above.  */
> > +#if defined __PIC__ && !__GNUC_PREREQ (5,0)
> >  # define check_consistency()                                               \
> >    ({ int __res;                                                                    \
> >       __asm__ __volatile__                                                  \
> >
>
> I think we can just remove the check_consistency altogether, since
> we already required GCC 6.2 or later to build gcc (4dcbbc3b28a).

This affects all branches.  I prefer this so that it can be backported.  Support
for GCC older than GCC 5 should be removed as a separate patch.


--
H.J.
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] i386: Disable check_consistency for GCC 5 and above [BZ #25788]

Sourceware - libc-alpha mailing list


On 06/04/2020 10:35, H.J. Lu wrote:

> On Mon, Apr 6, 2020 at 6:31 AM Adhemerval Zanella via Libc-alpha
> <[hidden email]> wrote:
>>
>>
>>
>> On 06/04/2020 10:24, H.J. Lu via Libc-alpha wrote:
>>> check_consistency should be disabled for GCC 5 and above since there is
>>> no fixed PIC register in GCC 5 and above.  Check __GNUC_PREREQ (5,0)
>>> instead OPTIMIZE_FOR_GCC_5 since OPTIMIZE_FOR_GCC_5 is false with
>>> -fno-omit-frame-pointer.
>>> ---
>>>  sysdeps/unix/sysv/linux/i386/sysdep.h | 5 +++--
>>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>>
>>> diff --git a/sysdeps/unix/sysv/linux/i386/sysdep.h b/sysdeps/unix/sysv/linux/i386/sysdep.h
>>> index 5e3888060b..6671afe65e 100644
>>> --- a/sysdeps/unix/sysv/linux/i386/sysdep.h
>>> +++ b/sysdeps/unix/sysv/linux/i386/sysdep.h
>>> @@ -580,8 +580,9 @@ struct libc_do_syscall_args
>>>  # define EXTRAVAR_5
>>>  #endif
>>>
>>> -/* Consistency check for position-independent code.  */
>>> -#if defined __PIC__ && !defined OPTIMIZE_FOR_GCC_5
>>> +/* Consistency check for position-independent code.  Disabled for GCC 5
>>> +   and above since there is no fixed PIC register in GCC 5 and above.  */
>>> +#if defined __PIC__ && !__GNUC_PREREQ (5,0)
>>>  # define check_consistency()                                               \
>>>    ({ int __res;                                                                    \
>>>       __asm__ __volatile__                                                  \
>>>
>>
>> I think we can just remove the check_consistency altogether, since
>> we already required GCC 6.2 or later to build gcc (4dcbbc3b28a).
>
> This affects all branches.  I prefer this so that it can be backported.  Support
> for GCC older than GCC 5 should be removed as a separate patch.

Fair enough, LGTM then.