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: [PING] Fix PR20166, fixinclude patch


On Mon, 21 Mar 2005, Bruce Korb wrote:

> Richard Guenther wrote:
> >
> > Please consider:
> > http://gcc.gnu.org/ml/gcc-patches/2005-03/msg01533.html
>
> Looks fine, except that the test text does not test the
> fix.  The test-text should contain a copy of the broken text:
>
> > int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask);
>
> and the patch to tests/base/pthread.h should be the fixed
> variation.

I'll apply the following which passed bootstrapping on
x86_64-unknown-linux-gnu and make check in fixincludes.

Thanks,
Richard.


2005-03-21  Richard Guenther  <rguenth@gcc.gnu.org>

	PR target/20166
	* inclhack.def: Add fix for array of incomplete structures
	in function prototype in pthread.h.
	* fixincl.x: Regenerate.
	* tests/base/pthread.h: Adjust.


Index: inclhack.def
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/inclhack.def,v
retrieving revision 1.16.14.1
diff -u -r1.16.14.1 inclhack.def
--- inclhack.def	15 Mar 2005 17:38:05 -0000	1.16.14.1
+++ inclhack.def	21 Mar 2005 16:10:49 -0000
@@ -2315,6 +2315,19 @@
     test_text = "int __page_size;";
 };

+/*
+ * On broken glibc-2.3.3 systems an array of incomplete structures is
+ * passed to __sigsetjmp.  Fix that to take a pointer instead.
+ */
+fix = {
+    hackname  = pthread_incomplete_struct_argument;
+    files     = pthread.h;
+    select    = "struct __jmp_buf_tag";
+    c_fix     = format;
+    c_fix_arg = "%1 *%2%3";
+    c_fix_arg = "^(extern int __sigsetjmp \\(struct __jmp_buf_tag) (__env)\\[1\\](.*)$";
+    test_text = "extern int __sigsetjmp (struct __jmp_buf_tag __env[1], int __savemask);";
+};

 /*
  * On DYNIX/ptx, sys/mc_param.h has an embedded asm for the cpuid instruction
Index: fixincl.x
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/fixincl.x,v
retrieving revision 1.16.14.1
diff -u -r1.16.14.1 fixincl.x
--- fixincl.x	15 Mar 2005 17:38:05 -0000	1.16.14.1
+++ fixincl.x	21 Mar 2005 16:10:50 -0000
@@ -2,11 +2,11 @@
  *
  * DO NOT EDIT THIS FILE   (fixincl.x)
  *
- * It has been AutoGen-ed  Monday March 14, 2005 at 09:43:34 PM UTC
+ * It has been AutoGen-ed  Monday March 21, 2005 at 04:21:15 PM CET
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT CVS-MERGE THIS FILE, EITHER Mon Mar 14 21:43:34 UTC 2005
+/* DO NOT CVS-MERGE THIS FILE, EITHER Mon Mar 21 16:21:15 CET 2005
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -15,7 +15,7 @@
  * certain ANSI-incompatible system header files which are fixed to work
  * correctly with ANSI C and placed in a directory that GNU C will search.
  *
- * This file contains 178 fixup descriptions.
+ * This file contains 179 fixup descriptions.
  *
  * See README for more information.
  *
@@ -4183,6 +4183,42 @@

 /* * * * * * * * * * * * * * * * * * * * * * * * * *
  *
+ *  Description of Pthread_Incomplete_Struct_Argument fix
+ */
+tSCC zPthread_Incomplete_Struct_ArgumentName[] =
+     "pthread_incomplete_struct_argument";
+
+/*
+ *  File name selection pattern
+ */
+tSCC zPthread_Incomplete_Struct_ArgumentList[] =
+  "|pthread.h|";
+/*
+ *  Machine/OS name selection pattern
+ */
+#define apzPthread_Incomplete_Struct_ArgumentMachs (const char**)NULL
+
+/*
+ *  content selection pattern - do fix if pattern found
+ */
+tSCC zPthread_Incomplete_Struct_ArgumentSelect0[] =
+       "struct __jmp_buf_tag";
+
+#define    PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_TEST_CT  1
+static tTestDesc aPthread_Incomplete_Struct_ArgumentTests[] = {
+  { TT_EGREP,    zPthread_Incomplete_Struct_ArgumentSelect0, (regex_t*)NULL }, };
+
+/*
+ *  Fix Command Arguments for Pthread_Incomplete_Struct_Argument
+ */
+static const char* apzPthread_Incomplete_Struct_ArgumentPatch[] = {
+    "format",
+    "%1 *%2%3",
+    "^(extern int __sigsetjmp \\(struct __jmp_buf_tag) (__env)\\[1\\](.*)$",
+    (char*)NULL };
+
+/* * * * * * * * * * * * * * * * * * * * * * * * * *
+ *
  *  Description of Read_Ret_Type fix
  */
 tSCC zRead_Ret_TypeName[] =
@@ -7125,9 +7161,9 @@
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          208
+#define REGEX_COUNT          209
 #define MACH_LIST_SIZE_LIMIT 261
-#define FIX_COUNT            178
+#define FIX_COUNT            179

 /*
  *  Enumerate the fixes
@@ -7236,6 +7272,7 @@
     OSF_NAMESPACE_A_FIXIDX,
     OSF_NAMESPACE_C_FIXIDX,
     PTHREAD_PAGE_SIZE_FIXIDX,
+    PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_FIXIDX,
     READ_RET_TYPE_FIXIDX,
     RPC_XDR_LVALUE_CAST_A_FIXIDX,
     RPC_XDR_LVALUE_CAST_B_FIXIDX,
@@ -7829,6 +7866,11 @@
      PTHREAD_PAGE_SIZE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
      aPthread_Page_SizeTests,   apzPthread_Page_SizePatch, 0 },

+  {  zPthread_Incomplete_Struct_ArgumentName,    zPthread_Incomplete_Struct_ArgumentList,
+     apzPthread_Incomplete_Struct_ArgumentMachs,
+     PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
+     aPthread_Incomplete_Struct_ArgumentTests,   apzPthread_Incomplete_Struct_ArgumentPatch, 0 },
+
   {  zRead_Ret_TypeName,    zRead_Ret_TypeList,
      apzRead_Ret_TypeMachs,
      READ_RET_TYPE_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE,
Index: tests/base/pthread.h
===================================================================
RCS file: /cvs/gcc/gcc/fixincludes/tests/base/pthread.h,v
retrieving revision 1.3
diff -u -r1.3 pthread.h
--- tests/base/pthread.h	21 Nov 2004 23:01:44 -0000	1.3
+++ tests/base/pthread.h	21 Mar 2005 16:10:50 -0000
@@ -61,6 +61,11 @@
 #endif  /* PTHREAD_PAGE_SIZE_CHECK */


+#if defined( PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK )
+extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask);
+#endif  /* PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_CHECK */
+
+
 #if defined( SOLARIS_MUTEX_INIT_1_CHECK )
 #ident "@(#)pthread.h  1.16    97/05/05 SMI"
 #if __STDC__ - 0 == 0 && !defined(_NO_LONGLONG)


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