git.iko.soy/typeable/nixpkgs
on master help sign in
hhvm: use upstream patches to fix the build

(cherry picked from commit b7894032b4708a8c9ccee99aca1b7d6166546d4d) Signed-off-by: Domen Kožar <domen@dev.si>

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