diff --git a/pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch b/pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch new file mode 100644 index 000000000000..8ee5b31925f8 --- /dev/null +++ b/pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch @@ -0,0 +1,40 @@ +From 3918a2ccceb98230ff517601ad60aa6bee36e2c4 Mon Sep 17 00:00:00 2001 +From: Alex Malyshev +Date: Tue, 28 Oct 2014 15:55:34 -0700 +Subject: [PATCH] Replace use of MAX macro with std::max in ZendPack + +Summary: This has randomly bitten me in open source builds. I intermittently get +an error saying that MAX isn't defined. + +Instead of trying to figure out what's going on, I'm just gonna switch +it to std::max. + +Reviewed By: @paulbiss + +Differential Revision: D1636740 +--- + hphp/runtime/base/zend-pack.cpp | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +diff --git a/hphp/runtime/base/zend-pack.cpp b/hphp/runtime/base/zend-pack.cpp +index d878ea4..c3ee14d 100644 +--- a/hphp/runtime/base/zend-pack.cpp ++++ b/hphp/runtime/base/zend-pack.cpp +@@ -21,6 +21,8 @@ + #include "hphp/runtime/base/builtin-functions.h" + #include "hphp/util/tiny-vector.h" + ++#include ++ + namespace HPHP { + + #define INC_OUTPUTPOS(a,b) \ +@@ -294,7 +296,7 @@ Variant ZendPack::pack(const String& fmt, const Array& argv) { + case 'a': + case 'A': + case 'Z': { +- int arg_cp = (code != 'Z') ? arg : MAX(0, arg - 1); ++ int arg_cp = (code != 'Z') ? arg : std::max(0, arg - 1); + memset(&output[outputpos], (code != 'A') ? '\0' : ' ', arg); + val = argv[currentarg++].toString(); + s = val.c_str(); diff --git a/pkgs/development/compilers/hhvm/8207a31c26cc42fee79363a14c4a8f4fcbfffe63.patch b/pkgs/development/compilers/hhvm/8207a31c26cc42fee79363a14c4a8f4fcbfffe63.patch new file mode 100644 index 000000000000..f7cf29b739f0 --- /dev/null +++ b/pkgs/development/compilers/hhvm/8207a31c26cc42fee79363a14c4a8f4fcbfffe63.patch @@ -0,0 +1,40 @@ +From 8207a31c26cc42fee79363a14c4a8f4fcbfffe63 Mon Sep 17 00:00:00 2001 +From: Jordan DeLong +Date: Mon, 6 Oct 2014 18:30:28 -0700 +Subject: [PATCH] Remove some MIN/MAX macro uses in the emitter + +Summary: has preferable type-safe versions that don't double-eval +their args. + +Reviewed By: @paulbiss + +Differential Revision: D1599803 +--- + hphp/compiler/analysis/emitter.cpp | 6 +++--- + hphp/util/compatibility.h | 4 ---- + 2 files changed, 3 insertions(+), 7 deletions(-) + +diff --git a/hphp/compiler/analysis/emitter.cpp b/hphp/compiler/analysis/emitter.cpp +index 321e637..b1d3f2d 100644 +--- a/hphp/compiler/analysis/emitter.cpp ++++ b/hphp/compiler/analysis/emitter.cpp +@@ -799,8 +799,8 @@ void SymbolicStack::push(char sym) { + if (sym != StackSym::W && sym != StackSym::K && sym != StackSym::L && + sym != StackSym::T && sym != StackSym::I && sym != StackSym::H) { + m_actualStack.push_back(m_symStack.size()); +- *m_actualStackHighWaterPtr = MAX(*m_actualStackHighWaterPtr, +- (int)m_actualStack.size()); ++ *m_actualStackHighWaterPtr = std::max(*m_actualStackHighWaterPtr, ++ (int)m_actualStack.size()); + } + m_symStack.push_back(SymEntry(sym)); + } +@@ -1010,7 +1010,7 @@ int SymbolicStack::sizeActual() const { + + void SymbolicStack::pushFDesc() { + m_fdescCount += kNumActRecCells; +- *m_fdescHighWaterPtr = MAX(*m_fdescHighWaterPtr, m_fdescCount); ++ *m_fdescHighWaterPtr = std::max(*m_fdescHighWaterPtr, m_fdescCount); + } + + void SymbolicStack::popFDesc() { diff --git a/pkgs/development/compilers/hhvm/default.nix b/pkgs/development/compilers/hhvm/default.nix index e7237d9059c5..bc2629513a55 100644 --- a/pkgs/development/compilers/hhvm/default.nix +++ b/pkgs/development/compilers/hhvm/default.nix @@ -17,6 +17,11 @@ stdenv.mkDerivation rec { fetchSubmodules = true; }; + patches = [ + ./3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch + ./8207a31c26cc42fee79363a14c4a8f4fcbfffe63.patch + ]; + buildInputs = [ cmake pkgconfig boost libunwind mariadb libmemcached pcre gdb libevent gd curl libxml2 icu flex bison openssl zlib php expat libcap