From 0627f93db6a57e7411cb332b7509f35753b149e4 Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 15 Oct 2018 21:45:08 +0300 Subject: gnu: clang-runtime: Adapt for glibc@2.28. * gnu/packages/llvm.scm (clang-runtime@3.7, clang-runtime@3.8, clang-runtime@3.9)[patches]: Add patch to work around removed ustat.h. * gnu/packages/patches/clang-3.5-libsanitizer-ustat-fix.patch: New file. * gnu/local.mk (dist_patch_DATA): Register it. --- gnu/packages/llvm.scm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'gnu/packages/llvm.scm') diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index d0791d00cc..aef24b3bac 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -7,6 +7,7 @@ ;;; Copyright © 2017 Roel Janssen ;;; Copyright © 2018 Marius Bakke ;;; Copyright © 2018 Tobias Geerinckx-Rice +;;; Copyright © 2018 Efraim Flashner ;;; ;;; This file is part of GNU Guix. ;;; @@ -270,7 +271,8 @@ (define-public clang-runtime-3.9.1 llvm-3.9.1 "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk" '("clang-runtime-asan-build-fixes.patch" - "clang-runtime-esan-build-fixes.patch"))) + "clang-runtime-esan-build-fixes.patch" + "clang-3.5-libsantitizer-ustat-fix.patch"))) (define-public clang-3.9.1 (clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1 @@ -294,7 +296,8 @@ (define-public clang-runtime-3.8 (clang-runtime-from-llvm llvm-3.8 "0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d" - '("clang-runtime-asan-build-fixes.patch"))) + '("clang-runtime-asan-build-fixes.patch" + "clang-3.5-libsantitizer-ustat-fix.patch"))) (define-public clang-3.8 (clang-from-llvm llvm-3.8 clang-runtime-3.8 @@ -317,7 +320,8 @@ (define-public clang-runtime-3.7 (clang-runtime-from-llvm llvm-3.7 "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx" - '("clang-runtime-asan-build-fixes.patch"))) + '("clang-runtime-asan-build-fixes.patch" + "clang-3.5-libsantitizer-ustat-fix.patch"))) (define-public clang-3.7 (clang-from-llvm llvm-3.7 clang-runtime-3.7 -- cgit v1.2.3 From 1a2d8d06b53c3c8cf8f94920c6e8734c71b8369b Mon Sep 17 00:00:00 2001 From: Efraim Flashner Date: Mon, 15 Oct 2018 21:51:23 +0300 Subject: * gnu: clang-runtime: Fix typo in patch name. This is a follow-up to 0627f93db6a57e7411cb332b7509f35753b149e4. * gnu/packages/patches/libsantitizer-ustat-fix.patch: Rename to gnu/packages/patches/libsanitizer-ustat-fix.patch. * gnu/packages/llvm.scm (clang-runtime@3.7, clang-runtime@3.8, clang-runtime@3.9)[patches]: Fix patch name. --- gnu/packages/llvm.scm | 6 +-- .../patches/clang-3.5-libsanitizer-ustat-fix.patch | 46 ++++++++++++++++++++++ .../clang-3.5-libsantitizer-ustat-fix.patch | 46 ---------------------- 3 files changed, 49 insertions(+), 49 deletions(-) create mode 100644 gnu/packages/patches/clang-3.5-libsanitizer-ustat-fix.patch delete mode 100644 gnu/packages/patches/clang-3.5-libsantitizer-ustat-fix.patch (limited to 'gnu/packages/llvm.scm') diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm index aef24b3bac..54a17be8f4 100644 --- a/gnu/packages/llvm.scm +++ b/gnu/packages/llvm.scm @@ -272,7 +272,7 @@ (define-public clang-runtime-3.9.1 "16gc2gdmp5c800qvydrdhsp0bzb97s8wrakl6i8a4lgslnqnf2fk" '("clang-runtime-asan-build-fixes.patch" "clang-runtime-esan-build-fixes.patch" - "clang-3.5-libsantitizer-ustat-fix.patch"))) + "clang-3.5-libsanitizer-ustat-fix.patch"))) (define-public clang-3.9.1 (clang-from-llvm llvm-3.9.1 clang-runtime-3.9.1 @@ -297,7 +297,7 @@ (define-public clang-runtime-3.8 llvm-3.8 "0p0y85c7izndbpg2l816z7z7558axq11d5pwkm4h11sdw7d13w0d" '("clang-runtime-asan-build-fixes.patch" - "clang-3.5-libsantitizer-ustat-fix.patch"))) + "clang-3.5-libsanitizer-ustat-fix.patch"))) (define-public clang-3.8 (clang-from-llvm llvm-3.8 clang-runtime-3.8 @@ -321,7 +321,7 @@ (define-public clang-runtime-3.7 llvm-3.7 "10c1mz2q4bdq9bqfgr3dirc6hz1h3sq8573srd5q5lr7m7j6jiwx" '("clang-runtime-asan-build-fixes.patch" - "clang-3.5-libsantitizer-ustat-fix.patch"))) + "clang-3.5-libsanitizer-ustat-fix.patch"))) (define-public clang-3.7 (clang-from-llvm llvm-3.7 clang-runtime-3.7 diff --git a/gnu/packages/patches/clang-3.5-libsanitizer-ustat-fix.patch b/gnu/packages/patches/clang-3.5-libsanitizer-ustat-fix.patch new file mode 100644 index 0000000000..cfb09a8ce3 --- /dev/null +++ b/gnu/packages/patches/clang-3.5-libsanitizer-ustat-fix.patch @@ -0,0 +1,46 @@ +From d9d97cac3702b99a00cd113de98c41eb535d47ed Mon Sep 17 00:00:00 2001 +From: Efraim Flashner +Date: Sun, 14 Oct 2018 12:11:30 +0300 +Subject: [PATCH] patch modified from the gcc patch series, also dealing with + ustat. + +--- + .../sanitizer_platform_limits_posix.cc | 15 +++++++++++++-- + 1 file changed, 13 insertions(+), 2 deletions(-) + +diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +index 29fea6e..570b9a5 100644 +--- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc ++++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc +@@ -129,7 +129,6 @@ + #include + #include + #include +-#include + #include + #include + #include +@@ -222,7 +221,19 @@ namespace __sanitizer { + #endif // SANITIZER_LINUX || SANITIZER_FREEBSD + + #if SANITIZER_LINUX && !SANITIZER_ANDROID +- unsigned struct_ustat_sz = sizeof(struct ustat); ++ // Use pre-computed size of struct ustat to avoid which ++ // has been removed from glibc 2.28. ++#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \ ++ || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \ ++ || defined(__x86_64__) ++#define SIZEOF_STRUCT_USTAT 32 ++#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \ ++ || defined(__powerpc__) || defined(__s390__) ++#define SIZEOF_STRUCT_USTAT 20 ++#else ++#error Unknown size of struct ustat ++#endif ++ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT; + unsigned struct_rlimit64_sz = sizeof(struct rlimit64); + unsigned struct_statvfs64_sz = sizeof(struct statvfs64); + #endif // SANITIZER_LINUX && !SANITIZER_ANDROID +-- +2.19.1 + diff --git a/gnu/packages/patches/clang-3.5-libsantitizer-ustat-fix.patch b/gnu/packages/patches/clang-3.5-libsantitizer-ustat-fix.patch deleted file mode 100644 index cfb09a8ce3..0000000000 --- a/gnu/packages/patches/clang-3.5-libsantitizer-ustat-fix.patch +++ /dev/null @@ -1,46 +0,0 @@ -From d9d97cac3702b99a00cd113de98c41eb535d47ed Mon Sep 17 00:00:00 2001 -From: Efraim Flashner -Date: Sun, 14 Oct 2018 12:11:30 +0300 -Subject: [PATCH] patch modified from the gcc patch series, also dealing with - ustat. - ---- - .../sanitizer_platform_limits_posix.cc | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) - -diff --git a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -index 29fea6e..570b9a5 100644 ---- a/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -+++ b/lib/sanitizer_common/sanitizer_platform_limits_posix.cc -@@ -129,7 +129,6 @@ - #include - #include - #include --#include - #include - #include - #include -@@ -222,7 +221,19 @@ namespace __sanitizer { - #endif // SANITIZER_LINUX || SANITIZER_FREEBSD - - #if SANITIZER_LINUX && !SANITIZER_ANDROID -- unsigned struct_ustat_sz = sizeof(struct ustat); -+ // Use pre-computed size of struct ustat to avoid which -+ // has been removed from glibc 2.28. -+#if defined(__aarch64__) || defined(__s390x__) || defined (__mips64) \ -+ || defined(__powerpc64__) || defined(__arch64__) || defined(__sparcv9) \ -+ || defined(__x86_64__) -+#define SIZEOF_STRUCT_USTAT 32 -+#elif defined(__arm__) || defined(__i386__) || defined(__mips__) \ -+ || defined(__powerpc__) || defined(__s390__) -+#define SIZEOF_STRUCT_USTAT 20 -+#else -+#error Unknown size of struct ustat -+#endif -+ unsigned struct_ustat_sz = SIZEOF_STRUCT_USTAT; - unsigned struct_rlimit64_sz = sizeof(struct rlimit64); - unsigned struct_statvfs64_sz = sizeof(struct statvfs64); - #endif // SANITIZER_LINUX && !SANITIZER_ANDROID --- -2.19.1 - -- cgit v1.2.3