From 39ad0efb9a70321b3bffc429febd4d05123a6ae9 Mon Sep 17 00:00:00 2001 From: Dan Lipsa Date: Fri, 16 Aug 2019 15:27:35 -0400 Subject: Solve compilation error on summit. (#12305) * This constexpr does not compile on summit. I tried gcc6.4 and gcc7.4 * Add link the the llvm bug report. --- .../builtin/packages/llvm/constexpr_longdouble.patch | 15 +++++++++++++++ var/spack/repos/builtin/packages/llvm/package.py | 4 ++++ 2 files changed, 19 insertions(+) create mode 100644 var/spack/repos/builtin/packages/llvm/constexpr_longdouble.patch diff --git a/var/spack/repos/builtin/packages/llvm/constexpr_longdouble.patch b/var/spack/repos/builtin/packages/llvm/constexpr_longdouble.patch new file mode 100644 index 0000000000..337b068d4b --- /dev/null +++ b/var/spack/repos/builtin/packages/llvm/constexpr_longdouble.patch @@ -0,0 +1,15 @@ +--- a/projects/libcxx/include/thread ++++ b/projects/libcxx/include/thread +@@ -435,7 +435,12 @@ sleep_for(const chrono::duration<_Rep, _Period>& __d) + using namespace chrono; + if (__d > duration<_Rep, _Period>::zero()) + { ++#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) ; ++#endif + nanoseconds __ns; + if (__d < _Max) + { diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py index ef5eaed1eb..407898d5f0 100644 --- a/var/spack/repos/builtin/packages/llvm/package.py +++ b/var/spack/repos/builtin/packages/llvm/package.py @@ -583,6 +583,10 @@ class Llvm(CMakePackage): # Github issue #4986 patch('llvm_gcc7.patch', when='@4.0.0:4.0.1+lldb %gcc@7.0:') + # Backport from llvm master + additional fix + # see https://bugs.llvm.org/show_bug.cgi?id=39696 + # for a bug report about this problem in llvm master. + patch('constexpr_longdouble.patch', when='@7:8+libcxx') @run_before('cmake') def check_darwin_lldb_codesign_requirement(self): -- cgit v1.2.3-70-g09d2