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 testers needed for fixinclude patch, PTHREAD_ONCE_INIT


 >  > Hi Kaveh,
 >  > 
 >  > Well, wait, one nit:  Since we know that this cruft is only ever
 >  > useful on Solaris, it should be constrained to Solaris by
 >  > adding:
 >  > 
 >  > mach = '*-solaris*';
 >  > 
 >  > That is glob-matched against the config.guess output.
 >  > It will cause the test and fix to be removed from the
 >  > list of things fixincludes has to do on other platforms.
 >  > Cheers - Bruce
 > 
 > Sure no problem, I agree this is useful. 


After receiving confirmation privately that the patch works on
solaris2.6 from Rodney Brown I went ahead and installed the patch with
the "mach" tweek on all three active 4.x branches.  I've included the
revised version below.

Bruce, Rodney, thanks for your help.  (More to come!)

		--Kaveh



2006-09-26  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* inclhack.def (solaris_once_init_1): New.
	* tests/base/pthread.h: Adjust for new fix.
	
	* fixincl.x: Regenerate.
	
diff -rup orig/egcc-SVN20060923/fixincludes/inclhack.def egcc-SVN20060923/fixincludes/inclhack.def
--- orig/egcc-SVN20060923/fixincludes/inclhack.def	2006-06-23 20:01:40.000000000 -0400
+++ egcc-SVN20060923/fixincludes/inclhack.def	2006-09-26 10:37:58.901822903 -0400
@@ -2990,6 +2990,25 @@ fix = {
 
 
 /*
+ * Sun Solaris defines PTHREAD_ONCE_INIT as an array containing a
+ * structure.  As such, it need two levels of brackets, but only
+ * contains one.  Wrap the macro definition in an extra layer.
+ */
+fix = {
+    hackname = solaris_once_init_1;
+    select = '@\(#\)pthread.h' "[ \t]+1.[0-9]+[ \t]+[0-9/]+ SMI";
+    files = pthread.h;
+    mach = '*-*-solaris*';
+    c_fix = format;
+    c_fix_arg = "%1{%2}%3";
+    c_fix_arg = "(^#define[ \t]+PTHREAD_ONCE_INIT[ \t]+\\{)([^}]+)(\\})[ \t]*$";
+    test_text =
+    '#pragma ident	"@(#)pthread.h	1.37	04/09/28 SMI"'"\n"
+    "#define PTHREAD_ONCE_INIT\t{0, 0, 0, PTHREAD_ONCE_NOTDONE}";
+};
+
+
+/*
  * Solaris 2.5.1 and 2.6 use an outdated prototype for send & recv
  * in sys/socket.h.  This is corrected in Solaris 7 and up.
  */
diff -rup orig/egcc-SVN20060923/fixincludes/tests/base/pthread.h egcc-SVN20060923/fixincludes/tests/base/pthread.h
--- orig/egcc-SVN20060923/fixincludes/tests/base/pthread.h	2006-01-23 00:54:57.000000000 -0500
+++ egcc-SVN20060923/fixincludes/tests/base/pthread.h	2006-09-26 09:36:52.877967475 -0400
@@ -98,6 +98,12 @@ extern int __sigsetjmp (struct __jmp_buf
 #endif  /* SOLARIS_MUTEX_INIT_2_CHECK */
 
 
+#if defined( SOLARIS_ONCE_INIT_1_CHECK )
+#pragma ident	"@(#)pthread.h	1.37	04/09/28 SMI"
+#define PTHREAD_ONCE_INIT	{{0, 0, 0, PTHREAD_ONCE_NOTDONE}}
+#endif  /* SOLARIS_ONCE_INIT_1_CHECK */
+
+
 #if defined( THREAD_KEYWORD_CHECK )
 extern int pthread_create (pthread_t *__restrict __thr,
 extern int pthread_kill (pthread_t __thr, int __signo);


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