summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--var/spack/repos/builtin/packages/llvm/constexpr_longdouble.patch15
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py4
2 files changed, 19 insertions, 0 deletions
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<long double> _Max = nanoseconds::max();
++#else
++ _LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(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):