summary refs log tree commit diff
path: root/pkgs/development/compilers
diff options
context:
space:
mode:
authorDomen Kožar <domen@dev.si>2014-12-13 15:22:31 +0100
committerDomen Kožar <domen@dev.si>2014-12-13 15:28:12 +0100
commitf4bde46b0f21c4b0e64729af21b4401254e369b0 (patch)
tree72a71e940cf7de882c74a4563fb3e3cb2e25d850 /pkgs/development/compilers
parent5c405a815266bb7cec25f06bd5877c11e23a71bc (diff)
downloadnixlib-f4bde46b0f21c4b0e64729af21b4401254e369b0.tar
nixlib-f4bde46b0f21c4b0e64729af21b4401254e369b0.tar.gz
nixlib-f4bde46b0f21c4b0e64729af21b4401254e369b0.tar.bz2
nixlib-f4bde46b0f21c4b0e64729af21b4401254e369b0.tar.lz
nixlib-f4bde46b0f21c4b0e64729af21b4401254e369b0.tar.xz
nixlib-f4bde46b0f21c4b0e64729af21b4401254e369b0.tar.zst
nixlib-f4bde46b0f21c4b0e64729af21b4401254e369b0.zip
hhvm: use upstream patches to fix the build
(cherry picked from commit b7894032b4708a8c9ccee99aca1b7d6166546d4d)
Signed-off-by: Domen Kožar <domen@dev.si>
Diffstat (limited to 'pkgs/development/compilers')
-rw-r--r--pkgs/development/compilers/hhvm/3918a2ccceb98230ff517601ad60aa6bee36e2c4.patch40
-rw-r--r--pkgs/development/compilers/hhvm/8207a31c26cc42fee79363a14c4a8f4fcbfffe63.patch40
-rw-r--r--pkgs/development/compilers/hhvm/default.nix5
3 files changed, 85 insertions, 0 deletions
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 <alexanderm@fb.com>
+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 <algorithm>
++
+ 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 <jdelong@fb.com>
+Date: Mon, 6 Oct 2014 18:30:28 -0700
+Subject: [PATCH] Remove some MIN/MAX macro uses in the emitter
+
+Summary: <algorithm> 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