This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH] ucontext.h: Add __INDIRECT_RETURN
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Florian Weimer <fw at deneb dot enyo dot de>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Wed, 18 Jul 2018 15:14:18 -0700
- Subject: Re: [PATCH] ucontext.h: Add __INDIRECT_RETURN
- References: <20180718173558.GA18109@intel.com> <87y3e8ckzc.fsf@mid.deneb.enyo.de>
On Wed, Jul 18, 2018 at 2:06 PM, Florian Weimer <fw@deneb.enyo.de> wrote:
> * H. J. Lu:
>
>> +#ifndef __INDIRECT_RETURN
>> +# if defined __CET__ && (__CET__ & 2) != 0
>> +/* Note: Functions returned via indirect branch returns once. Without
>
> The grammar seems to be a bit off here.
>
>> + indirect_return attribute in GCC 9, use returns_twice attribute. */
>> +# if __GNUC_PREREQ (9, 0)
>> +# define __INDIRECT_RETURN __attribute__ ((__indirect_return__))
>> +# else
>> +# define __INDIRECT_RETURN __attribute__ ((__returns_twice__))
>> +# endif
>> +# endif
>> +#endif
>
> Do you expect distributions to backport support for the
> indirect_return attribute into GCC 8? Then this will not work.
I am running into another swapcontext issue:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=86560
I need to change indirect_return to function type attribute to support
function pointer:
https://gcc.gnu.org/ml/gcc-patches/2018-07/msg01007.html
I am planning to backport both patches to GCC 8 branch. When that
happens, we can change __GNUC_PREREQ (9, 0) to __GNUC_PREREQ (8, x).
Do you have a better solution?
--
H.J.