commit:     c2b543370775bb05328be389c778ca0a67443bb8
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Aug  3 22:52:02 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Aug  3 23:04:31 2025 +0000
URL:        https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=c2b54337

10.5.0: backport glibc-2.42 libsanitizer fixes, cut patchset 7

Signed-off-by: Sam James <sam <AT> gentoo.org>

 ...ll-libsanitizer-Fix-build-with-glibc-2.42.patch | 71 ++++++++++++++++++++++
 ...ommon-Remove-reference-to-obsolete-termio.patch | 68 +++++++++++++++++++++
 10.5.0/gentoo/README.history                       |  4 ++
 3 files changed, 143 insertions(+)

diff --git a/10.5.0/gentoo/78_all-libsanitizer-Fix-build-with-glibc-2.42.patch 
b/10.5.0/gentoo/78_all-libsanitizer-Fix-build-with-glibc-2.42.patch
new file mode 100644
index 0000000..bf43089
--- /dev/null
+++ b/10.5.0/gentoo/78_all-libsanitizer-Fix-build-with-glibc-2.42.patch
@@ -0,0 +1,71 @@
+From faf929fcc361d3ca64c6acb0ee9660c79b5905d2 Mon Sep 17 00:00:00 2001
+Message-ID: 
<faf929fcc361d3ca64c6acb0ee9660c79b5905d2.1753477197.git....@gentoo.org>
+From: Florian Weimer <[email protected]>
+Date: Fri, 2 May 2025 17:41:43 +0200
+Subject: [PATCH 1/2] 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.
+
+(cherry picked from commit 1789c57dc97ea2f9819ef89e28bf17208b6208e7)
+---
+ .../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 42e43a0..fcaa45d 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
++++ b/libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+@@ -330,13 +330,9 @@ static void ioctl_table_fill() {
+   _(SOUND_PCM_WRITE_CHANNELS, WRITE, sizeof(int));
+   _(SOUND_PCM_WRITE_FILTER, WRITE, sizeof(int));
+   _(TCFLSH, NONE, 0);
+-  _(TCGETA, WRITE, struct_termio_sz);
+   _(TCGETS, WRITE, struct_termios_sz);
+   _(TCSBRK, NONE, 0);
+   _(TCSBRKP, NONE, 0);
+-  _(TCSETA, READ, struct_termio_sz);
+-  _(TCSETAF, READ, struct_termio_sz);
+-  _(TCSETAW, READ, struct_termio_sz);
+   _(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 670c2f2..0bbdf3e 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -417,7 +417,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);
+-  unsigned struct_termio_sz = sizeof(struct termio);
+   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 dc6423b..09d6548 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -952,7 +952,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/10.5.0/gentoo/79_all-sanitizer_common-Remove-reference-to-obsolete-termio.patch
 
b/10.5.0/gentoo/79_all-sanitizer_common-Remove-reference-to-obsolete-termio.patch
new file mode 100644
index 0000000..7104139
--- /dev/null
+++ 
b/10.5.0/gentoo/79_all-sanitizer_common-Remove-reference-to-obsolete-termio.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=utf8
+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 670c2f206..8f664b80a 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cpp
+@@ -688,13 +688,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 dc6423bc2..4f7910fa7 100644
+--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -1189,13 +1189,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;

diff --git a/10.5.0/gentoo/README.history b/10.5.0/gentoo/README.history
index f848c9c..413977c 100644
--- a/10.5.0/gentoo/README.history
+++ b/10.5.0/gentoo/README.history
@@ -1,3 +1,7 @@
+7              8 August 2025
+       + 78_all-libsanitizer-Fix-build-with-glibc-2.42.patch
+       + 79_all-sanitizer_common-Remove-reference-to-obsolete-termio.patch
+
 6              28 Apr 2023
        + 77_all_all_PR109585_13_rtl-alias-analysis-typo.patch
 

Reply via email to