[newlib-cygwin] Cygwin: signalfd: implement non-polling select
Corinna Vinschen
corinna-cygwin@cygwin.com
Tue Jan 15 11:53:00 GMT 2019
On Jan 15 12:22, Corinna Vinschen wrote:
> On Jan 15 10:50, Václav Haisman wrote:
> > On Mon, 14 Jan 2019 at 17:19, Corinna Vinschen <corinna@sourceware.org> wrote:
> > > + /* context MUST be aligned to 16 byte, otherwise RtlCaptureContext fails.
> > > + If you prepend cygtls members here, make sure context stays 16 byte
> > > + aligned. */
> > > ucontext_t context;
> > >[...]
> > Would it not better to do this with `ucontext_t context
> > __attribute__((__aligned__(16)));` instead?
>
> In theory yes, but it doesn't work. The simple perl parser in
> gentls_offsets doesn't understand __attribute__ and screws up,
> so generating tlsoffsets{64}.h fails.
>
> I'm not good at perl. My attempts to fix the parser to let
> __attribute__ statements slip through unchanged failed so far.
> Right now what it does is:
>
> ucontext_t context __attribute__((__aligned__(16)));
>
> in the input is mangled to
>
> ucontext_t context__attribute____aligned__16;
>
> in the output. Any help appreciated.
Uhm... I managed to find a solution to keep __attribute__ expressions
in and to generate the code to compute the offsets. However, it has
no effect at all. I added a long variable which moves the address
by 8 bytes. The alignment should have moved context by 16 bytes, but
it doesn't.
Before:
//; $tls::context = -8624;
//; $tls::pcontext = 4176;
after:
//; $tls::foo = -8624;
//; $tls::pfoo = 4176;
//; $tls::context = -8616;
//; $tls::pcontext = 4184;
/scratching head/
Corinna
--
Corinna Vinschen
Cygwin Maintainer
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <http://cygwin.com/pipermail/cygwin-developers/attachments/20190115/a093eeb1/attachment.sig>
More information about the Cygwin-developers
mailing list