This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] ucontext.h: Add __INDIRECT_RETURN


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]