Recently, when installing gcc7, I encountered a compilation error due to changes in glibc 2.42:
19979:/home/z/.cache/paru/clone/gcc7/src/gcc/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc:430:51: error: invalid application of ‘sizeof’ to incomplete type ‘__sanitizer::termio’
This issue has been fixed in gcc12 from AUR. I adapted a patch based on that fix, and my build now succeeds. Since I'm not familiar with the AUR submission process, I'm leaving this comment here—maintainers, please review it when you have time.
--- libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
+++ libsanitizer/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
@@ -325,13 +325,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);
--- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
+++ libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc
@@ -427,7 +427,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);
--- libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
+++ libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h
@@ -978,7 +978,6 @@ struct __sanitizer_cookie_io_functions_t {
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;
Pinned Comments