guix_mirror_bot pushed a commit to branch core-packages-team
in repository guix.

commit 479acfa5fcc7b1e00556e278fcede66fd86d0c43
Author: Zheng Junjie <[email protected]>
AuthorDate: Sat Sep 19 20:33:37 2026 +0800

    gnu: gcc-12: Fix build with glibc 2.42.
    
    * gnu/packages/patches/gcc-libsanitizer-Fix-build-with-glibc-2.42.patch: 
New patch.
    * 
gnu/packages/patches/gcc-sanitizer_common-Remove-reference-to-obsolete-termio-ioctls.patch:
    New patch
    * gnu/local.mk (dist_patch_DATA): Register them.
    * gnu/packages/gcc.scm (gcc-12)[source]: Use them.
---
 gnu/local.mk                                       |  2 +
 gnu/packages/gcc.scm                               |  4 +-
 ...cc-libsanitizer-Fix-build-with-glibc-2.42.patch | 74 ++++++++++++++++++++++
 ...emove-reference-to-obsolete-termio-ioctls.patch | 68 ++++++++++++++++++++
 4 files changed, 147 insertions(+), 1 deletion(-)

diff --git a/gnu/local.mk b/gnu/local.mk
index a85c78cf171..ed0122a888b 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1394,8 +1394,10 @@ dist_patch_DATA =                                        
        \
   %D%/packages/patches/gcc-cross-environment-variables.patch   \
   %D%/packages/patches/gcc-cross-gxx-include-dir.patch          \
   %D%/packages/patches/gcc-fix-texi2pod.patch                  \
+  %D%/packages/patches/gcc-libsanitizer-Fix-build-with-glibc-2.42.patch \
   %D%/packages/patches/gcc-libstdc++-newer-gcc.patch           \
   %D%/packages/patches/gcc-mangle-guix-store.patch             \
+  
%D%/packages/patches/gcc-sanitizer_common-Remove-reference-to-obsolete-termio-ioctls.patch
 \
   %D%/packages/patches/gcc-4.8-libsanitizer-fix.patch          \
   %D%/packages/patches/gcc-4.9-inline.patch            \
   %D%/packages/patches/gcc-4.9-libsanitizer-fix.patch          \
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index a9afd696b0f..eca8b5fe5a3 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -969,7 +969,9 @@ It also includes runtime support libraries for these 
languages.")
                                        "gcc-5.0-libvtv-runpath.patch"
                                        "gcc-12-libsanitizer-no-crypt.patch"
                                        "gcc-11-libstdc++-hurd-libpthread.patch"
-                                       "gcc-libstdc++-newer-gcc.patch"))
+                                       "gcc-libstdc++-newer-gcc.patch"
+                                       
"gcc-libsanitizer-Fix-build-with-glibc-2.42.patch"
+                                       
"gcc-sanitizer_common-Remove-reference-to-obsolete-termio-ioctls.patch"))
               (modules '((guix build utils)))
               (snippet gcc-canadian-cross-objdump-snippet)))
    (properties
diff --git 
a/gnu/packages/patches/gcc-libsanitizer-Fix-build-with-glibc-2.42.patch 
b/gnu/packages/patches/gcc-libsanitizer-Fix-build-with-glibc-2.42.patch
new file mode 100644
index 00000000000..ffb64929c32
--- /dev/null
+++ b/gnu/packages/patches/gcc-libsanitizer-Fix-build-with-glibc-2.42.patch
@@ -0,0 +1,74 @@
+From 1789c57dc97ea2f9819ef89e28bf17208b6208e7 Mon Sep 17 00:00:00 2001
+From: Florian Weimer <[email protected]>
+Date: Fri, 2 May 2025 17:41:43 +0200
+Subject: [PATCH] libsanitizer: Fix build with glibc 2.42
+
+The termio structure will be removed from glibc 2.42.  It has
+been deprecated since the late 80s/early 90s.
+
+Cherry-picked from LLVM commit 59978b21ad9c65276ee8e14f26759691b8a65763
+("[sanitizer_common] Remove interceptors for deprecated struct termio
+(#137403)").
+
+Co-Authored-By: Tom Stellard <[email protected]>
+
+libsanitizer/
+
+       * sanitizer_common/sanitizer_common_interceptors_ioctl.inc: Cherry
+       picked from LLVM commit 59978b21ad9c65276ee8e14f26759691b8a65763.
+       * sanitizer_common/sanitizer_platform_limits_posix.cpp: Likewise.
+       * sanitizer_common/sanitizer_platform_limits_posix.h: Likewise.
+---
+ .../sanitizer_common_interceptors_ioctl.inc               | 8 --------
+ .../sanitizer_common/sanitizer_platform_limits_posix.cpp  | 3 ---
+ .../sanitizer_common/sanitizer_platform_limits_posix.h    | 1 -
+ 3 files changed, 12 deletions(-)
+
+diff --git 
a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc 
b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+index 49ec4097c900..dda11daa77f4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
++++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+@@ -338,17 +338,9 @@ static void ioctl_table_fill() {
+   _(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int));
+   _(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int));
+   _(TCFLSH, NONE, 0);
+-#if SANITIZER_GLIBC
+-  _(TCGETA, WRITE, struct_termio_sz);
+-#endif
+   _(TCGETS, WRITE, struct_termios_sz);
+   _(TCSBRK, NONE, 0);
+   _(TCSBRKP, NONE, 0);
+-#if SANITIZER_GLIBC
+-  _(TCSETA, READ, struct_termio_sz);
+-  _(TCSETAF, READ, struct_termio_sz);
+-  _(TCSETAW, READ, struct_termio_sz);
+-#endif
+   _(TCSETS, READ, struct_termios_sz);
+   _(TCSETSF, READ, struct_termios_sz);
+   _(TCSETSW, READ, struct_termios_sz);
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 
b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index c87d5ef42c92..7bbc6f2edac2 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -485,9 +485,6 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned struct_input_id_sz = sizeof(struct input_id);
+   unsigned struct_mtpos_sz = sizeof(struct mtpos);
+   unsigned struct_rtentry_sz = sizeof(struct rtentry);
+-#if SANITIZER_GLIBC || SANITIZER_ANDROID
+-  unsigned struct_termio_sz = sizeof(struct termio);
+-#endif
+   unsigned struct_vt_consize_sz = sizeof(struct vt_consize);
+   unsigned struct_vt_sizes_sz = sizeof(struct vt_sizes);
+   unsigned struct_vt_stat_sz = sizeof(struct vt_stat);
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h 
b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index c07f7cd0b0d0..a80df656826e 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -1029,7 +1029,6 @@ extern unsigned struct_hd_geometry_sz;
+ extern unsigned struct_input_absinfo_sz;
+ extern unsigned struct_input_id_sz;
+ extern unsigned struct_mtpos_sz;
+-extern unsigned struct_termio_sz;
+ extern unsigned struct_vt_consize_sz;
+ extern unsigned struct_vt_sizes_sz;
+ extern unsigned struct_vt_stat_sz;
diff --git 
a/gnu/packages/patches/gcc-sanitizer_common-Remove-reference-to-obsolete-termio-ioctls.patch
 
b/gnu/packages/patches/gcc-sanitizer_common-Remove-reference-to-obsolete-termio-ioctls.patch
new file mode 100644
index 00000000000..2dd8e580625
--- /dev/null
+++ 
b/gnu/packages/patches/gcc-sanitizer_common-Remove-reference-to-obsolete-termio-ioctls.patch
@@ -0,0 +1,68 @@
+From dbe0ba6c90d53229613c7eb3f476580ae1b9aae1 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Fri, 25 Jul 2025 19:45:18 +0100
+Subject: [PATCH] [sanitizer_common] Remove reference to obsolete termio ioctls
+ (#138822)
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Cherry picked from LLVM commit c99b1bcd505064f2e086e6b1034ce0b0c91ea5b9.
+
+The termio ioctls are no longer used after commit 59978b21ad9c
+("[sanitizer_common] Remove interceptors for deprecated struct termio
+(#137403)"), remove them.  Fixes this build error:
+
+../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:765:27:
 error: invalid application of ‘sizeof’ to incomplete type ‘__sanitizer::termio’
+  765 |   unsigned IOCTL_TCGETA = TCGETA;
+      |                           ^~~~~~
+../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:769:27:
 error: invalid application of ‘sizeof’ to incomplete type ‘__sanitizer::termio’
+  769 |   unsigned IOCTL_TCSETA = TCSETA;
+      |                           ^~~~~~
+../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:770:28:
 error: invalid application of ‘sizeof’ to incomplete type ‘__sanitizer::termio’
+  770 |   unsigned IOCTL_TCSETAF = TCSETAF;
+      |                            ^~~~~~~
+../../../../libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp:771:28:
 error: invalid application of ‘sizeof’ to incomplete type ‘__sanitizer::termio’
+  771 |   unsigned IOCTL_TCSETAW = TCSETAW;
+      |                            ^~~~~~~
+---
+ .../sanitizer_common/sanitizer_platform_limits_posix.cpp      | 4 ----
+ .../sanitizer_common/sanitizer_platform_limits_posix.h        | 4 ----
+ 2 files changed, 8 deletions(-)
+
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp 
b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+index 490e75fe8f65..9856ac3c3ec4 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -762,13 +762,9 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr);
+   unsigned IOCTL_SOUND_PCM_WRITE_FILTER = SOUND_PCM_WRITE_FILTER;
+ #endif // SOUND_VERSION
+   unsigned IOCTL_TCFLSH = TCFLSH;
+-  unsigned IOCTL_TCGETA = TCGETA;
+   unsigned IOCTL_TCGETS = TCGETS;
+   unsigned IOCTL_TCSBRK = TCSBRK;
+   unsigned IOCTL_TCSBRKP = TCSBRKP;
+-  unsigned IOCTL_TCSETA = TCSETA;
+-  unsigned IOCTL_TCSETAF = TCSETAF;
+-  unsigned IOCTL_TCSETAW = TCSETAW;
+   unsigned IOCTL_TCSETS = TCSETS;
+   unsigned IOCTL_TCSETSF = TCSETSF;
+   unsigned IOCTL_TCSETSW = TCSETSW;
+diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h 
b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+index a80df656826e..cfac4903b76b 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -1274,13 +1274,9 @@ extern unsigned IOCTL_SNDCTL_COPR_SENDMSG;
+ extern unsigned IOCTL_SNDCTL_COPR_WCODE;
+ extern unsigned IOCTL_SNDCTL_COPR_WDATA;
+ extern unsigned IOCTL_TCFLSH;
+-extern unsigned IOCTL_TCGETA;
+ extern unsigned IOCTL_TCGETS;
+ extern unsigned IOCTL_TCSBRK;
+ extern unsigned IOCTL_TCSBRKP;
+-extern unsigned IOCTL_TCSETA;
+-extern unsigned IOCTL_TCSETAF;
+-extern unsigned IOCTL_TCSETAW;
+ extern unsigned IOCTL_TCSETS;
+ extern unsigned IOCTL_TCSETSF;
+ extern unsigned IOCTL_TCSETSW;

Reply via email to