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 <ajstewart426@gmail.com>
This commit is contained in:
Galen Shipman 2019-12-06 11:38:58 -07:00 committed by Adam J. Stewart
parent dd26cc4004
commit 5d523dd689
2 changed files with 19 additions and 0 deletions

View File

@ -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'):

View File

@ -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<long double> _Max = nanoseconds::max();
-#else
_LIBCPP_CONSTEXPR duration<long double> _Max = duration<long double>(ULLONG_MAX/1000000000ULL) ;
+#else
+ _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
#endif
nanoseconds __ns;
if (__d < _Max)