On Sunday 15 August 2004 16:00, Justin T. Gibbs wrote: > >> Is there something else we can do so that libpthread gets > >> initialized first? Use _init()? I'm not sure how to > >> not add that when building static libpthread though (let's > >> kill static libpthread!). > > > > There is no way other than putting a special case for pthread > > initialisation into rtld. The C++ constructor trick is implemented > > via _init anyway so that won't work either. > > I thought that static constructor invocation was deterministic based > on link order. Does the C++ spec really indicate that the order of > construction can be random? I don't think the spec places any restrictions on constructor ordering. The problem here is that you get different behaviour depending on whether you link with libGL first followed by libpthread (in that case libpthread initialises first) or if you link in the other order (in which case libGL initialises first). As far as I can see, rtld calls the _init sections of each shared library in reverse order with the last library linked against being initialised first.Received on Sun Aug 15 2004 - 13:10:55 UTC
This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:38:06 UTC