Patch: __thread and older Linux

Tom Tromey tromey@redhat.com
Sun Jun 2 05:02:00 GMT 2002


I'm running x86 Red Hat Linux 6.2.  On this box,
/usr/include/pthread.h has this:

    extern int pthread_create __P ((pthread_t *__thread,

This isn't matched by the __thread pattern in fixinc.  I needed the
appended patch to get gcc to build.

Ok to commit?

Tom

Index: ChangeLog
from  Tom Tromey  <tromey@redhat.com>

	* fixinc/fixincl.x: Rebuilt.
	* fixinc/inclhack.def (thread_keyword): Match `*__thread'.

Index: fixinc/fixincl.x
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/fixincl.x,v
retrieving revision 1.128
diff -u -r1.128 fixincl.x
--- fixinc/fixincl.x 22 May 2002 21:29:35 -0000 1.128
+++ fixinc/fixincl.x 2 Jun 2002 11:46:18 -0000
@@ -4587,7 +4587,7 @@
  *  content selection pattern - do fix if pattern found
  */
 tSCC zThread_KeywordSelect0[] =
-       " __thread([,)])";
+       "([* ])__thread([,)])";
 
 #define    THREAD_KEYWORD_TEST_CT  1
 static tTestDesc aThread_KeywordTests[] = {
@@ -4598,7 +4598,7 @@
  */
 static const char* apzThread_KeywordPatch[] = {
     "format",
-    " __thr%1",
+    "%1__thr%2",
     (char*)NULL };
 
 /* * * * * * * * * * * * * * * * * * * * * * * * * *
Index: fixinc/inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/gcc/fixinc/inclhack.def,v
retrieving revision 1.132
diff -u -r1.132 inclhack.def
--- fixinc/inclhack.def 22 May 2002 21:29:37 -0000 1.132
+++ fixinc/inclhack.def 2 Jun 2002 11:46:21 -0000
@@ -2892,9 +2892,9 @@
     hackname  = thread_keyword;
     files     = "pthread.h";
     files     = "bits/sigthread.h";
-    select    = " __thread([,)])";
+    select    = "([* ])__thread([,)])";
     c_fix     = format;
-    c_fix_arg = " __thr%1";
+    c_fix_arg = "%1__thr%2";
 
     test_text =
 	"extern int pthread_create (pthread_t *__restrict __thread,\n"



More information about the Gcc-patches mailing list