summary refs log tree commit diff
path: root/gnu/packages/patches
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-03-05 17:27:20 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-03-05 23:36:04 +0100
commitaf88972bb8e3e69d9c5ea5a8a81f7f234c971133 (patch)
treeb0e711c40a88635ace1ad33dfff8d58e5d21f26e /gnu/packages/patches
parent3fd9c90c4ae79ff1e9a0dbe840c3ff10d099d7ca (diff)
downloadguix-af88972bb8e3e69d9c5ea5a8a81f7f234c971133.tar.gz
gnu: clang-runtime: Fix build with glibc 2.31.
* gnu/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch,
gnu/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch,
gnu/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch: New files.
* gnu/local.mk (dist_patch_DATA): Adjust accordingly.
* gnu/packages/llvm.scm (clang-runtime, clang-runtime-8, clang-runtime-7,
clang-runtime-6, clang-runtime-3.9.1, clang-runtime-3.8, clang-runtime-3.7):
Add the respective patches.
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r--gnu/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch50
-rw-r--r--gnu/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch50
-rw-r--r--gnu/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch60
3 files changed, 160 insertions, 0 deletions
diff --git a/gnu/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch b/gnu/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch
new file mode 100644
index 0000000000..f4bca3ecb1
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-3.8-libsanitizer-mode-field.patch
@@ -0,0 +1,50 @@
+Adjust libsanitizer to ABI change in glibc 2.31.
+
+Adapted to 3.x from this upstream commit:
+https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -1130,8 +1130,9 @@ CHECK_SIZE_AND_OFFSET(ipc_perm, cgid);
+ #ifndef __GLIBC_PREREQ
+ #define __GLIBC_PREREQ(x, y) 0
+ #endif
+-#if !defined(__aarch64__) || !SANITIZER_LINUX || __GLIBC_PREREQ (2, 21)
+-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field.  */
++#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
+ 
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -188,17 +188,16 @@ namespace __sanitizer {
+     unsigned __seq;
+     u64 __unused1;
+     u64 __unused2;
+-#elif defined(__mips__) || defined(__aarch64__)
+-    unsigned int mode;
+-    unsigned short __seq;
+-    unsigned short __pad1;
+-    unsigned long __unused1;
+-    unsigned long __unused2;
++#elif defined(__sparc__)
++  unsigned mode;
++  unsigned short __pad2;
++  unsigned short __seq;
++  unsigned long long __unused1;
++  unsigned long long __unused2;
+ #else
+-    unsigned short mode;
+-    unsigned short __pad1;
+-    unsigned short __seq;
+-    unsigned short __pad2;
++  unsigned int mode;
++  unsigned short __seq;
++  unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)
+     u64 __unused1;
+     u64 __unused2;
diff --git a/gnu/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch b/gnu/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch
new file mode 100644
index 0000000000..2598a1bdeb
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-3.9-libsanitizer-mode-field.patch
@@ -0,0 +1,50 @@
+Adjust libsanitizer to ABI change in glibc 2.31.
+
+Adapted to 3.x from this upstream commit:
+https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -1139,8 +1139,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)
+-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field.  */
++#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
+ 
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -194,17 +194,16 @@ namespace __sanitizer {
+     unsigned __seq;
+     u64 __unused1;
+     u64 __unused2;
+-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
+-    unsigned int mode;
+-    unsigned short __seq;
+-    unsigned short __pad1;
+-    unsigned long __unused1;
+-    unsigned long __unused2;
++#elif defined(__sparc__)
++  unsigned mode;
++  unsigned short __pad2;
++  unsigned short __seq;
++  unsigned long long __unused1;
++  unsigned long long __unused2;
+ #else
+-    unsigned short mode;
+-    unsigned short __pad1;
+-    unsigned short __seq;
+-    unsigned short __pad2;
++  unsigned int mode;
++  unsigned short __seq;
++  unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)
+     u64 __unused1;
+     u64 __unused2;
diff --git a/gnu/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch b/gnu/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch
new file mode 100644
index 0000000000..ebb080ed9d
--- /dev/null
+++ b/gnu/packages/patches/clang-runtime-9-libsanitizer-mode-field.patch
@@ -0,0 +1,60 @@
+Adjust libsanitizer to ABI change in glibc 2.31.
+
+Taken from this upstream commit:
+https://github.com/llvm/llvm-project/commit/947f9692440836dcb8d88b74b69dd379d85974ce
+
+diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
+@@ -1126,8 +1126,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)
+-/* On aarch64 glibc 2.20 and earlier provided incorrect mode field.  */
++#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
+ 
+diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h b/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.h
++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.h
+@@ -203,28 +203,15 @@ namespace __sanitizer {
+     u64 __unused1;
+     u64 __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;
+-#elif defined(__mips__) || defined(__aarch64__) || defined(__s390x__)
+-    unsigned int mode;
+-    unsigned short __seq;
+-    unsigned short __pad1;
+-    unsigned long __unused1;
+-    unsigned long __unused2;
++  unsigned mode;
++  unsigned short __pad2;
++  unsigned short __seq;
++  unsigned long long __unused1;
++  unsigned long long __unused2;
+ #else
+-    unsigned short mode;
+-    unsigned short __pad1;
+-    unsigned short __seq;
+-    unsigned short __pad2;
++  unsigned int mode;
++  unsigned short __seq;
++  unsigned short __pad2;
+ #if defined(__x86_64__) && !defined(_LP64)
+     u64 __unused1;
+     u64 __unused2;