]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
fixincludes: Skip pthread_incomplete_struct_argument for modern glibc [PR118009]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 19 Aug 2025 16:08:07 +0000 (17:08 +0100)
committerJonathan Wakely <redi@gcc.gnu.org>
Thu, 28 Aug 2025 16:48:03 +0000 (17:48 +0100)
The pthread_incomplete_struct_argument fix was intended for ancient
versions of Glibc (only 2.3.3 and 2.3.4, I believe). From Glibc 2.3.5
the pthread.h header already included the change to use a pointer
instead of an array, so the fixinclude was no longer used.

However, the https://sourceware.org/bugzilla/show_bug.cgi?id=26647 fix
changed the __setjmpbuf declaration to use struct __jmp_buf_tag __env[1]
again, which caused this fixinclude to start matching again. This means
that GCC now installs a "fixed" pthread.h with a change to a declaration
that guarded by #if ! __GNUC_PREREQ (11, 0), i.e. it's not even relevant
for modern versions of GCC. The "fixed" pthread.h causes problems for
users because of changes to internal implementation details of the
pthread_cond_t type, which require the "fixed" pthread.h to be updated
with mkheaders if Glibc is updated.

This change adds a bypass to the fixinclude, so that it no longer
matches modern Glibc versions, and only applies to glibc versions 2.3.3
and 2.3.4 as originally intended.

Also remove outdated reference to svn in the comment at the top of the
generated file.

fixincludes/ChangeLog:

PR bootstrap/118009
PR bootstrap/119089
* inclhack.def (pthread_incomplete_struct_argument): Add bypass.
* fixincl.tpl: Remove reference to svn in comment.
* fixincl.x: Regenerate.

Reviewed-by: Jason Merrill <jason@redhat.com>
fixincludes/fixincl.tpl
fixincludes/fixincl.x
fixincludes/inclhack.def

index 3d70cabc7fd6dd0e63033e6523fac1dca01b285a..3227b388be7180f62f6b8a6a1e6077fffa0ce750 100644 (file)
@@ -5,7 +5,7 @@ x=fixincl.x =]
      (dne "-D" " * " "/* ")
      (dne " * " "/* ") ) =]
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER [=
+/* DO NOT MERGE THIS FILE, EITHER [=
    (define re-ct 0) (define max-mach 0) (define ct 0)
    (define HACK "") (define Hack "")    (define tmp "") 
    (shell "date") =]
index 819c02c483c7717aea0a4d7402722ed06562f350..e684b211cd002d3b57ce8ae31ac01a607fa39b05 100644 (file)
@@ -2,11 +2,11 @@
  *
  * DO NOT EDIT THIS FILE   (fixincl.x)
  *
- * It has been AutoGen-ed  August 15, 2025 at 05:30:32 PM by AutoGen 5.18.16
+ * It has been AutoGen-ed  August 28, 2025 at 04:10:25 PM by AutoGen 5.18.16
  * From the definitions    inclhack.def
  * and the template file   fixincl
  */
-/* DO NOT SVN-MERGE THIS FILE, EITHER Fri Aug 15 17:30:32 CEST 2025
+/* DO NOT MERGE THIS FILE, EITHER Thu Aug 28 16:10:25 BST 2025
  *
  * You must regenerate it.  Use the ./genfixes script.
  *
@@ -7547,8 +7547,15 @@ tSCC zPthread_Incomplete_Struct_ArgumentList[] =
 tSCC zPthread_Incomplete_Struct_ArgumentSelect0[] =
        "struct __jmp_buf_tag";
 
-#define    PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_TEST_CT  1
+/*
+ *  content bypass pattern - skip fix if pattern found
+ */
+tSCC zPthread_Incomplete_Struct_ArgumentBypass0[] =
+       "bits/types/struct___jmp_buf_tag.h";
+
+#define    PTHREAD_INCOMPLETE_STRUCT_ARGUMENT_TEST_CT  2
 static tTestDesc aPthread_Incomplete_Struct_ArgumentTests[] = {
+  { TT_NEGREP,   zPthread_Incomplete_Struct_ArgumentBypass0, (regex_t*)NULL },
   { TT_EGREP,    zPthread_Incomplete_Struct_ArgumentSelect0, (regex_t*)NULL }, };
 
 /*
@@ -11202,7 +11209,7 @@ static const char* apzX11_SprintfPatch[] = {
  *
  *  List of all fixes
  */
-#define REGEX_COUNT          318
+#define REGEX_COUNT          319
 #define MACH_LIST_SIZE_LIMIT 187
 #define FIX_COUNT            274
 
index 35ccaf03c4fa40a84841d0bbc061ffd2199e36a2..71777cb10e73d06c4a2788bd0823df72c6c7504c 100644 (file)
@@ -3803,6 +3803,7 @@ fix = {
     hackname  = pthread_incomplete_struct_argument;
     files     = pthread.h;
     select    = "struct __jmp_buf_tag";
+    bypass    = "bits/types/struct___jmp_buf_tag.h";
     c_fix     = format;
     c_fix_arg = "%1 *%2%3";
     c_fix_arg = "^(extern int __sigsetjmp \\(struct __jmp_buf_tag) "