commit: bac33d01509e549669b2ae1e763dd85ba22d1e09 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> AuthorDate: Sat Mar 21 12:56:09 2020 +0000 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> CommitDate: Sat Mar 21 12:56:09 2020 +0000 URL: https://gitweb.gentoo.org/proj/gcc-patches.git/commit/?id=bac33d01
7.5.0: backport glibc-2.31 libsanitizer fixes Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> 7.5.0/gentoo/22_all_libsanitizer-p1.patch | 32 +++++++++++++++++ 7.5.0/gentoo/23_all_libsanitizer-p2.patch | 59 +++++++++++++++++++++++++++++++ 7.5.0/gentoo/README.history | 4 +++ 3 files changed, 95 insertions(+) diff --git a/7.5.0/gentoo/22_all_libsanitizer-p1.patch b/7.5.0/gentoo/22_all_libsanitizer-p1.patch new file mode 100644 index 0000000..80cc074 --- /dev/null +++ b/7.5.0/gentoo/22_all_libsanitizer-p1.patch @@ -0,0 +1,32 @@ +From 54d87ffe4b34052f159ac5b72b250129ce813b2a Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek <ja...@redhat.com> +Date: Fri, 14 Feb 2020 12:33:27 +0100 +Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm + bootstrap due to libsanitizer) + + Backported from mainline + 2019-10-22 Tamar Christina <tamar.christ...@arm.com> + + PR sanitizer/92154 + * sanitizer_common/sanitizer_platform_limits_posix.cc: + Cherry-pick compiler-rt revision r375220. +--- +--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc ++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +@@ -1147,8 +1147,12 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); + CHECK_SIZE_AND_OFFSET(ipc_perm, gid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); +-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21) ++#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \ ++ !defined(__arm__) + /* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ ++/* On Arm glibc 2.31 and later provide a different mode field, this field is ++ never used by libsanitizer so we can simply ignore this assert for all glibc ++ versions. */ + CHECK_SIZE_AND_OFFSET(ipc_perm, mode); + #endif + +-- +2.25.2 + diff --git a/7.5.0/gentoo/23_all_libsanitizer-p2.patch b/7.5.0/gentoo/23_all_libsanitizer-p2.patch new file mode 100644 index 0000000..bdd8dcb --- /dev/null +++ b/7.5.0/gentoo/23_all_libsanitizer-p2.patch @@ -0,0 +1,59 @@ +From dbdf86838aaaef76620c00c53096cfe157d5af6e Mon Sep 17 00:00:00 2001 +From: Jakub Jelinek <ja...@redhat.com> +Date: Fri, 14 Feb 2020 12:38:30 +0100 +Subject: [PATCH] backport: re PR sanitizer/92154 (new glibc breaks arm + bootstrap due to libsanitizer) + + Backported from mainline + 2019-11-26 Jakub Jelinek <ja...@redhat.com> + + PR sanitizer/92154 + * sanitizer_common/sanitizer_platform_limits_posix.h: Cherry-pick + llvm-project revision 947f9692440836dcb8d88b74b69dd379d85974ce. + * sanitizer_common/sanitizer_platform_limits_posix.cc: Likewise. +--- +--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc ++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.cc +@@ -1147,12 +1147,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, uid); + CHECK_SIZE_AND_OFFSET(ipc_perm, gid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cuid); + CHECK_SIZE_AND_OFFSET(ipc_perm, cgid); +-#if (!defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)) && \ +- !defined(__arm__) +-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field. */ +-/* On Arm glibc 2.31 and later provide a different mode field, this field is +- never used by libsanitizer so we can simply ignore this assert for all glibc +- versions. */ ++#if !SANITIZER_LINUX || __GLIBC_PREREQ (2, 31) ++/* glibc 2.30 and earlier provided 16-bit mode field instead of 32-bit ++ on many architectures. */ + CHECK_SIZE_AND_OFFSET(ipc_perm, mode); + #endif + +--- a/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h ++++ b/libsanitizer/sanitizer_common/sanitizer_platform_limits_posix.h +@@ -210,20 +210,13 @@ namespace __sanitizer { + unsigned long __unused1; + unsigned long __unused2; + #elif defined(__sparc__) +-# if defined(__arch64__) + unsigned mode; +- unsigned short __pad1; +-# else +- unsigned short __pad1; +- unsigned short mode; + unsigned short __pad2; +-# endif + unsigned short __seq; + unsigned long long __unused1; + unsigned long long __unused2; + #else +- unsigned short mode; +- unsigned short __pad1; ++ unsigned int mode; + unsigned short __seq; + unsigned short __pad2; + #if defined(__x86_64__) && !defined(_LP64) +-- +2.25.2 + diff --git a/7.5.0/gentoo/README.history b/7.5.0/gentoo/README.history index 3958c90..6029d79 100644 --- a/7.5.0/gentoo/README.history +++ b/7.5.0/gentoo/README.history @@ -1,3 +1,7 @@ +2 TODO + + 22_all_libsanitizer-p1.patch + + 23_all_libsanitizer-p2.patch + 1 14 Nov 2019 + 01_all_default-fortify-source.patch + 02_all_default-warn-format-security.patch