package/glibc: add upstream patch to fix build error with glibc 2.43
PATCH 1/1 package/glibc: add upstream patch to fix build error with glibc 2.43
Seen with this defconfig
BR2_x86_64=y
BR2_GCC_VERSION_15_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_PICOTOOL=y
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/struct_mutex.h:35:9:
error: declaration does not declare anything [-fpermissive]
35 | short __unused;
No related autobuilder error was recorded.
The build error does not occur with glibc-2.42 on the 2026.02.x branch.
The build error was reported to picotool upstream:
https://github.com/raspberrypi/picotool/issues/300
--- ...-__unused-fields-to-__glibc_reserved.patch | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 package/glibc/0001-Rename-__unused-fields-to-__glibc_reserved.patch
package/glibc/0001-Rename-__unused-fields-to-__glibc_reserved.patch new file +85 -0
@@ -0,0 +1,85 @@ +From 243bdfec8f7cd4a85a8ce6e4e9a5a5accd3ce1aa Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek <[email protected]> +Date: Tue, 17 Feb 2026 17:06:48 +0100 +Subject: [PATCH] Rename __unused fields to __glibc_reserved. + +__unused is often defined to __attribute__((unused)) in BSD +sources and furthermore libstdc++ testsuite uses it as a macro +to verify libstdc++ headers don't use __unused identifiers. +In ~2012 glibc headers have been cleaned up, but some new +uses of __unused have reappeared (s390 fenv.h already many +years ago, the rest last November). + +Reviewed-by: Florian Weimer <[email protected]> + +Upstream: https://sourceware.org/git/?p=glibc.git;a=commit;h=243bdfec8f7cd4a85a8ce6e4e9a5a5accd3ce1aa + +Signed-off-by: Bernd Kuhls <[email protected]> +--- + sysdeps/powerpc/nptl/bits/struct_mutex.h | 2 +- + sysdeps/s390/fpu/bits/fenv.h | 8 ++++---- + sysdeps/s390/nptl/bits/struct_mutex.h | 2 +- + sysdeps/x86/nptl/bits/struct_mutex.h | 2 +- + 4 files changed, 7 insertions(+), 7 deletions(-) + +diff --git a/sysdeps/powerpc/nptl/bits/struct_mutex.h b/sysdeps/powerpc/nptl/bits/struct_mutex.h +index 1472af21f7..ebf2d50922 100644 +--- a/sysdeps/powerpc/nptl/bits/struct_mutex.h ++++ b/sysdeps/powerpc/nptl/bits/struct_mutex.h +@@ -32,7 +32,7 @@ struct __pthread_mutex_s + int __kind; + #if __WORDSIZE == 64 + short __spins; +- short __unused; ++ short __glibc_reserved; + __pthread_list_t __list; + # define __PTHREAD_MUTEX_HAVE_PREV 1 + #else +diff --git a/sysdeps/s390/fpu/bits/fenv.h b/sysdeps/s390/fpu/bits/fenv.h +index b9e844e393..33e88fbe9d 100644 +--- a/sysdeps/s390/fpu/bits/fenv.h ++++ b/sysdeps/s390/fpu/bits/fenv.h +@@ -76,10 +76,10 @@ typedef unsigned int fexcept_t; /* size of fpc */ + typedef struct + { + fexcept_t __fpc; +- void *__unused; +- /* The field __unused (formerly __ieee_instruction_pointer) is a relict from +- commit "Remove PTRACE_PEEKUSER" (87b9b50f0d4b92248905e95a06a13c513dc45e59) +- and isn't used anymore. */ ++ void *__glibc_reserved; ++ /* The field __glibc_reserved (formerly __ieee_instruction_pointer) is a ++ relict from commit "Remove PTRACE_PEEKUSER" ++ (87b9b50f0d4b92248905e95a06a13c513dc45e59) and isn't used anymore. */ + } fenv_t; + + /* If the default argument is used we use this value. */ +diff --git a/sysdeps/s390/nptl/bits/struct_mutex.h b/sysdeps/s390/nptl/bits/struct_mutex.h +index d069b485d1..571265267c 100644 +--- a/sysdeps/s390/nptl/bits/struct_mutex.h ++++ b/sysdeps/s390/nptl/bits/struct_mutex.h +@@ -32,7 +32,7 @@ struct __pthread_mutex_s + int __kind; + #if __WORDSIZE == 64 + short __spins; +- short __unused; ++ short __glibc_reserved; + __pthread_list_t __list; + # define __PTHREAD_MUTEX_HAVE_PREV 1 + #else +diff --git a/sysdeps/x86/nptl/bits/struct_mutex.h b/sysdeps/x86/nptl/bits/struct_mutex.h +index 9c19dff660..13c9894ad4 100644 +--- a/sysdeps/x86/nptl/bits/struct_mutex.h ++++ b/sysdeps/x86/nptl/bits/struct_mutex.h +@@ -32,7 +32,7 @@ struct __pthread_mutex_s + int __kind; + #ifdef __x86_64__ + short __spins; +- short __unused; ++ short __glibc_reserved; + __pthread_list_t __list; + # define __PTHREAD_MUTEX_HAVE_PREV 1 + #else +-- +2.47.3 +
Signature · 6 lines
2.47.3 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Thomas Petazzoni via buildroot
AppliedQuoted 11 lines · Bernd Kuhls
Seen with this defconfig
BR2_x86_64=y
BR2_GCC_VERSION_15_X=y
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_PACKAGE_PICOTOOL=y
output/host/x86_64-buildroot-linux-gnu/sysroot/usr/include/bits/struct_mutex.h:35:9:
error: declaration does not declare anything [-fpermissive]
35 | short__unused;
Quoted 7 lines
No related autobuilder error was recorded.
The build error does not occur with glibc-2.42 on the 2026.02.x branch.The build error was reported to picotool upstream:
https://github.com/raspberrypi/picotool/issues/300Signed-off-by Bernd Kuhls <[email protected]>
Thanks, applied to master. Do you happen to know why glibc upstream didn't include this patch in its 2.43 maintenance branch, if it fixes a bug? Maybe something to report to them?
Thomas
Signature · 7 lines
Thomas Petazzoni, co-owner and CEO, Bootlin Embedded Linux and Kernel engineering and training https://bootlin.com _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
A message that is not in the archive (sent off-list or not yet received): ahvTE6qnCu2M6tp3__16489.2169924983$1780208462$gmane$org@windsurf
Hi Thomas,
Am Sun, 31 May 2026 08:20:37 +0200 schrieb Thomas Petazzoni via buildroot:
Quoted 3 lines
Thanks, applied to master. Do you happen to know why glibc upstream didn't include this patch in its 2.43 maintenance branch, if it fixes a bug? Maybe something to report to them?
no, I do not know why the patch was not backported, sent bug report:
https://sourceware.org/bugzilla/show_bug.cgi?id=34188
Regards, Bernd
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot