diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2025-08-19 17:08:07 +0100 |
---|---|---|
committer | Jonathan Wakely <redi@gcc.gnu.org> | 2025-08-31 10:19:23 +0100 |
commit | ea2798892de373b14f9fc7ae8a0d820eaddca98c (patch) | |
tree | 277d0b0d4f5cc94d1e3f1b21e33a2ac87e99b00a | |
parent | 353e4d2afb5b9b0ac592cab858999a5217dacfdf (diff) | |
download | gcc-ea2798892de373b14f9fc7ae8a0d820eaddca98c.zip gcc-ea2798892de373b14f9fc7ae8a0d820eaddca98c.tar.gz gcc-ea2798892de373b14f9fc7ae8a0d820eaddca98c.tar.bz2 |
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 <jason@redhat.com>
(cherry picked from commit 59db4ce2df1db33ad361eca06a7aec99b24d0d2f)
-rw-r--r-- | fixincludes/fixincl.tpl | 2 | ||||
-rw-r--r-- | fixincludes/fixincl.x | 15 | ||||
-rw-r--r-- | fixincludes/inclhack.def | 1 |
3 files changed, 13 insertions, 5 deletions
diff --git a/fixincludes/fixincl.tpl b/fixincludes/fixincl.tpl index 3d70cab..3227b38 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 9dc05ea..e793699 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 July 10, 2024 at 02:49:05 PM by AutoGen 5.18.16 + * It has been AutoGen-ed August 28, 2025 at 05:57:29 PM by AutoGen 5.18.16 * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT SVN-MERGE THIS FILE, EITHER Wed Jul 10 14:49:05 CEST 2024 +/* DO NOT MERGE THIS FILE, EITHER Thu Aug 28 17:57:29 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 1ac8e33..51163a9 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) " |