https://gcc.gnu.org/g:59db4ce2df1db33ad361eca06a7aec99b24d0d2f
commit r16-3446-g59db4ce2df1db33ad361eca06a7aec99b24d0d2f Author: Jonathan Wakely <jwak...@redhat.com> Date: Tue Aug 19 17:08:07 2025 +0100 fixincludes: Skip pthread_incomplete_struct_argument for modern glibc [PR118009] 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 <ja...@redhat.com> Diff: --- fixincludes/fixincl.tpl | 2 +- fixincludes/fixincl.x | 15 +++++++++++---- fixincludes/inclhack.def | 1 + 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/fixincludes/fixincl.tpl b/fixincludes/fixincl.tpl index 3d70cabc7fd6..3227b388be71 100644 --- a/fixincludes/fixincl.tpl +++ b/fixincludes/fixincl.tpl @@ -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") =] diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index 819c02c483c7..e684b211cd00 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -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 diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 35ccaf03c4fa..71777cb10e73 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -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) "