This is the mail archive of the cygwin-developers mailing list for the Cygwin 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: [newlib-cygwin] Cygwin: signalfd: implement non-polling select


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

Attachment: signature.asc
Description: PGP signature


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