gcc9: fix build w/glibc-2.36

Failing Hydra build: https://hydra.nixos.org/build/193342322
Patch from gcc11 requires some minor adjustments to properly apply.

+32
+1
pkgs/development/compilers/gcc/9/default.nix
··· 56 56 inherit (stdenv) buildPlatform hostPlatform targetPlatform; 57 57 58 58 patches = [ 59 + ./fix-struct-redefinition-on-glibc-2.36.patch 59 60 # Fix https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80431 60 61 (fetchurl { 61 62 name = "fix-bug-80431.patch";
+31
pkgs/development/compilers/gcc/9/fix-struct-redefinition-on-glibc-2.36.patch
··· 1 + Derived from ../11/fix-struct-redefinition-on-glibc-2.36.patch (upstream commit d2356ebb0084a0d80dbfe33040c9afe938c15d19) 2 + 3 + diff --git a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc 4 + index e8fce8a02..cb1ac806e 100644 5 + --- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc 6 + +++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc 7 + @@ -65,7 +65,9 @@ 8 + #include <sys/vt.h> 9 + #include <linux/cdrom.h> 10 + #include <linux/fd.h> 11 + +#if SANITIZER_ANDROID 12 + #include <linux/fs.h> 13 + +#endif 14 + #include <linux/hdreg.h> 15 + #include <linux/input.h> 16 + #include <linux/ioctl.h> 17 + @@ -846,10 +848,10 @@ unsigned struct_ElfW_Phdr_sz = sizeof(Elf_Phdr); 18 + unsigned IOCTL_EVIOCGPROP = IOCTL_NOT_PRESENT; 19 + unsigned IOCTL_EVIOCSKEYCODE_V2 = IOCTL_NOT_PRESENT; 20 + #endif 21 + - unsigned IOCTL_FS_IOC_GETFLAGS = FS_IOC_GETFLAGS; 22 + - unsigned IOCTL_FS_IOC_GETVERSION = FS_IOC_GETVERSION; 23 + - unsigned IOCTL_FS_IOC_SETFLAGS = FS_IOC_SETFLAGS; 24 + - unsigned IOCTL_FS_IOC_SETVERSION = FS_IOC_SETVERSION; 25 + + unsigned IOCTL_FS_IOC_GETFLAGS = _IOR('f', 1, long); 26 + + unsigned IOCTL_FS_IOC_GETVERSION = _IOR('v', 1, long); 27 + + unsigned IOCTL_FS_IOC_SETFLAGS = _IOW('f', 2, long); 28 + + unsigned IOCTL_FS_IOC_SETVERSION = _IOW('v', 2, long); 29 + unsigned IOCTL_GIO_CMAP = GIO_CMAP; 30 + unsigned IOCTL_GIO_FONT = GIO_FONT; 31 + unsigned IOCTL_GIO_UNIMAP = GIO_UNIMAP;