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.
This commit is contained in:
Dan Lipsa 2019-08-16 15:27:35 -04:00 committed by Chuck Atkins
parent cef1e4e0b4
commit 39ad0efb9a
2 changed files with 19 additions and 0 deletions

View File

@ -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)
{

View File

@ -583,6 +583,10 @@ class Llvm(CMakePackage):
# Github issue #4986 # Github issue #4986
patch('llvm_gcc7.patch', when='@4.0.0:4.0.1+lldb %gcc@7.0:') 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') @run_before('cmake')
def check_darwin_lldb_codesign_requirement(self): def check_darwin_lldb_codesign_requirement(self):