From 5d523dd6890148af1cf18a04c312738d8c2dec26 Mon Sep 17 00:00:00 2001 From: Galen Shipman Date: Fri, 6 Dec 2019 11:38:58 -0700 Subject: Add patch to fix issue building current llvm develop master on power9 (#13986) * Add patch to fix issue building current llvm develop master on power9 * Conform to proper block commenting Co-Authored-By: Adam J. Stewart --- var/spack/repos/builtin/packages/llvm/package.py | 3 +++ var/spack/repos/builtin/packages/llvm/thread-p9.patch | 16 ++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 var/spack/repos/builtin/packages/llvm/thread-p9.patch diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index 9d209adf1a..87b598263c 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -203,6 +203,9 @@ class Llvm(CMakePackage): # for a bug report about this problem in llvm master. patch('llvm_py37.patch', when='@4:6 ^python@3.7:') + # https://bugs.llvm.org/show_bug.cgi?id=39696 + patch('thread-p9.patch', when='@develop+libcxx') + @run_before('cmake') def check_darwin_lldb_codesign_requirement(self): if not self.spec.satisfies('+lldb platform=darwin'): diff --git a/var/spack/repos/builtin/packages/llvm/thread-p9.patch b/var/spack/repos/builtin/packages/llvm/thread-p9.patch new file mode 100644 index 0000000000..140473a850 --- /dev/null +++ b/var/spack/repos/builtin/packages/llvm/thread-p9.patch @@ -0,0 +1,16 @@ +diff --git a/libcxx/include/thread b/libcxx/include/thread +index 02da703..d1677a1 100644 +--- a/projects/libcxx/include/thread ++++ b/projects/libcxx/include/thread +@@ -368,9 +368,9 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d) + { + #if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__) + // GCC's long double const folding is incomplete for IBM128 long doubles. +- _LIBCPP_CONSTEXPR duration _Max = nanoseconds::max(); +-#else + _LIBCPP_CONSTEXPR duration _Max = duration(ULLONG_MAX/1000000000ULL) ; ++#else ++ _LIBCPP_CONSTEXPR duration _Max = nanoseconds::max(); + #endif + nanoseconds __ns; + if (__d < _Max) -- cgit v1.2.3-70-g09d2