This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Solaris pthread patch
- From: Albert Chin-A-Young <china at thewrittenword dot com>
- To: Bruce Korb <bkorb at veritas dot com>
- Cc: GCC-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 28 Mar 2003 13:08:24 -0600
- Subject: Re: Solaris pthread patch
- References: <20030328170629.GD71154@spuckler.il.thewrittenword.com> <3E848434.AF952C0@veritas.com>
On Fri, Mar 28, 2003 at 09:19:48AM -0800, Bruce Korb wrote:
> Albert Chin-A-Young wrote:
> >
> > Your Solaris 2.6 pthread.h patch works fine on Solaris 2.6. However,
> > 2.5.1 has the same problem. Is the fix to get it to work on 2.5.1 and
> > 2.6 to modify:
> > select = '@\(#\)pthread.h' "[ \t]+1.1[0-9][ \t]+97/[0-9/]+ SMI";
> > to:
> > select = '@\(#\)pthread.h' "[ \t]+1.1[0-9][ \t]+9[57]/[0-9/]+ SMI";
>
> > Solaris 2.5.1 <pthread.h>:
> > #pragma ident "@(#)pthread.h 1.13 95/08/24 SMI"
> > Solaris 2.6 <pthread.h>:
> > #pragma ident "@(#)pthread.h 1.16 97/05/05 SMI"
>
> Then the hack needs to apply to versions 1.13 thru 1.16 dated '95 thru '97.
> I wouldn't leave out '96. ;-)
>
> > What do I do about:
> > test_text =
> > '#ident "@(#)pthread.h 1.16 97/05/05 SMI"'"\n"
>
> That's not important. It merely needs to be matched by the select
> clause. The primary purpose of the tests is not actually to show
> that this fix is working. That is accomplished by running it against
> the actual header of interest. The primary purpose is to ensure that
> somebody's new fix doesn't interfere with this fix; or, if it does,
> then it is done correctly and has the intended consequences.
Patch below against HEAD. Tested against 3.2.2.
2003-03-28 Albert Chin-A-Young <china at thewrittenword dot com>
* gcc/fixinc/inclhack.def: Update solaris_mutex_init_1 to
work on Solaris 2.5.1.
--
albert chin (china at thewrittenword dot com)
-- snip snip
Index: fixinc/inclhack.def
===================================================================
RCS file: /cvsroot/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.150
diff -u -3 -p -r1.150 inclhack.def
--- gcc/fixinc/inclhack.def 22 Mar 2003 21:51:03 -0000 1.150
+++ gcc/fixinc/inclhack.def 28 Mar 2003 19:06:32 -0000
@@ -2057,14 +2057,15 @@ fix = {
/*
- * Sun Solaris 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER incorrectly,
- * so we replace them with versions that correspond to the definition. We
- * also explicitly name this fix "1" and the next fix "2" because this one
- * does not deal with the last field. This fix needs to run before the next.
+ * Sun Solaris 2.5.1, 2.6 defines PTHREAD_{MUTEX|COND}_INITIALIZER
+ * incorrectly, so we replace them with versions that correspond to
+ * the definition. We also explicitly name this fix "1" and the next
+ * fix "2" because this one does not deal with the last field. This
+ * fix needs to run before the next.
*/
fix = {
hackname = solaris_mutex_init_1;
- select = '@\(#\)pthread.h' "[ \t]+1.1[0-9][ \t]+97/[0-9/]+ SMI";
+ select = '@\(#\)pthread.h' "[ \t]+1.1[0-9][ \t]+9[567]/[0-9/]+ SMI";
files = pthread.h;
sed = "/define[ \t]*PTHREAD_MUTEX_INI/s/{0, 0,/{{{0}, 0}, {{{0}}},/\n"
"/define[ \t]*PTHREAD_COND_INI/s/{0,/{{{0},0},/";