This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: Solaris & pthread mutex initializers


On Friday 21 January 2005 11:49 pm, Eric Botcazou wrote:
> > The data structures being initialized are actually defined
> > in /usr/include/sys/types.h and they seem to change every time
> > that file wiggles.
> 
> Note that there is an exception: Solaris 2.5.1 (that is still supported in 
> 4.0.x).  For example, pthread.h as of
> 
> #pragma ident   "@(#)pthread.h  1.13    95/08/24 SMI"
> 
> defines pthread_mutex_t and pthread_cond_t.  We should keep fixincluding it.

Fortunately, software can be flexible.  :-)  Check for a sys/types.h version
that antedates the move and pick a different initializer format structure:

> if (types_rev < 51)
>     <select based on pthread.h version>
> else switch (types_rev) {
> >     case 51: pi = &types_51; break; /* sol  6 */
> >     case 63: pi = &types_63; break; /* sol  7 */
> >     case 66: pi = &types_66; break; /* sol  8 */
> >     case 69: pi = &types_69; break; /* sol  8 */
> >     case 74: pi = &types_74; break; /* sol  9 */
> >     case 84: pi = &types_84; break; /* sol 10 */

> I can provide the following variant for Solaris 9:
> 
> #pragma ident   "@(#)types.h    1.75    04/01/06 SMI"

Most likely that would use the same initializer as "74"?

> >     case 75: case 74: pi = &types_74; break; /* sol  9 */

Maybe I should rename the structs:-)

types_74 ==> types_sol9
types_66 ==> types_sol8A
types_69 ==> types_sol8B

I still have questions about 52-62, 64, 65, 67, 68, 70-73, 76-83 :)
Is there anyone on the list with access to the Solaris CVS archive
that can fill in blanks here?  We could figure out what the
critical source changes are and search for that, but I also realized
that that wasn't a simple task, so I went for file versions.

> Could you refrain from committing anything until after PR middle-end/19515 is 
> resolved?  This is a (critical) bug I spotted because the initializers don't 
> use the {0,0,0,0,0,0,0,0} form.  Applying your patch will hide it.

It hides it iff fixing the pthread.h header were the test for the bug.
I would hope there's a regular test that exposes the bug, too.
Anyway, I was already thinking the right thing is to refrain until
at least a few people say, "I found a sys/types.h version of 1.xx"
so we don't have any (too many?) missing entries.

> Thanks for tackling this!

No problem.

Regards, Bruce


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