diff --git a/packages/wrk/build.sh b/packages/wrk/build.sh index a3b401fda..dc1604ea6 100644 --- a/packages/wrk/build.sh +++ b/packages/wrk/build.sh @@ -2,7 +2,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/wg/wrk TERMUX_PKG_DESCRIPTION="Modern HTTP benchmarking tool" TERMUX_PKG_LICENSE="Apache-2.0" TERMUX_PKG_VERSION=4.1.0 -TERMUX_PKG_REVISION=1 +TERMUX_PKG_REVISION=2 TERMUX_PKG_SRCURL=https://github.com/wg/wrk/archive/${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_SHA256=6fa1020494de8c337913fd139d7aa1acb9a020de6f7eb9190753aa4b1e74271e TERMUX_PKG_DEPENDS="openssl, luajit" diff --git a/packages/wrk/crash-fix.patch b/packages/wrk/crash-fix.patch new file mode 100644 index 000000000..91e2ae65d --- /dev/null +++ b/packages/wrk/crash-fix.patch @@ -0,0 +1,25 @@ +diff -ur wrk-4.1.0-orig/src/zmalloc.c wrk-4.1.0/src/zmalloc.c +--- wrk-4.1.0-orig/src/zmalloc.c 2020-05-07 01:47:50.562052028 +0000 ++++ wrk-4.1.0/src/zmalloc.c 2020-05-07 01:48:12.281671231 +0000 +@@ -45,13 +45,19 @@ + #include "zmalloc.h" + #include "atomicvar.h" + ++#ifdef _LP64 ++#define ALIGMENT (16) ++#else ++#define ALIGMENT (8) ++#endif ++#define ROUND_UP(n,r) (((n + r - 1) / r ) * r) + #ifdef HAVE_MALLOC_SIZE + #define PREFIX_SIZE (0) + #else + #if defined(__sun) || defined(__sparc) || defined(__sparc__) +-#define PREFIX_SIZE (sizeof(long long)) ++#define PREFIX_SIZE (ROUND_UP(sizeof(long long), ALIGMENT)) + #else +-#define PREFIX_SIZE (sizeof(size_t)) ++#define PREFIX_SIZE (ROUND_UP(sizeof(size_t), ALIGMENT)) + #endif + #endif +