From 2e894498786b33c015eb4af4dd9eb1e8588860be Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Tue, 8 Sep 2015 18:37:21 -0400 Subject: [PATCH] libuv: Avoid pthread_sigmask workaround --- packages/libuv/build.sh | 1 + packages/libuv/pthread-sigmask.patch | 57 ++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 packages/libuv/pthread-sigmask.patch diff --git a/packages/libuv/build.sh b/packages/libuv/build.sh index dcd754202..263745fb7 100644 --- a/packages/libuv/build.sh +++ b/packages/libuv/build.sh @@ -1,6 +1,7 @@ TERMUX_PKG_HOMEPAGE=https://github.com/joyent/libuv TERMUX_PKG_DESCRIPTION="Support library with a focus on asynchronous I/O" TERMUX_PKG_VERSION=1.7.3 +TERMUX_PKG_BUILD_REVISION=1 TERMUX_PKG_SRCURL=http://dist.libuv.org/dist/v${TERMUX_PKG_VERSION}/libuv-v${TERMUX_PKG_VERSION}.tar.gz TERMUX_PKG_EXTRA_CONFIGURE_ARGS="--disable-dtrace" # needed for building on mac diff --git a/packages/libuv/pthread-sigmask.patch b/packages/libuv/pthread-sigmask.patch new file mode 100644 index 000000000..cb069324b --- /dev/null +++ b/packages/libuv/pthread-sigmask.patch @@ -0,0 +1,57 @@ +Remove no longer needed workaround which breaks node.js build. + +diff -u -r ../libuv-v1.7.3/include/pthread-fixes.h ./include/pthread-fixes.h +--- ../libuv-v1.7.3/include/pthread-fixes.h 2015-08-27 17:42:36.000000000 -0400 ++++ ./include/pthread-fixes.h 2015-09-08 17:31:47.658023853 -0400 +@@ -57,16 +57,4 @@ + + int pthread_yield(void); + +-/* Workaround pthread_sigmask() returning EINVAL on versions < 4.1 by +- * replacing all calls to pthread_sigmask with sigprocmask. See: +- * https://android.googlesource.com/platform/bionic/+/9bf330b5 +- * https://code.google.com/p/android/issues/detail?id=15337 +- */ +-int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset); +- +-#ifdef pthread_sigmask +-#undef pthread_sigmask +-#endif +-#define pthread_sigmask(how, set, oldset) uv__pthread_sigmask(how, set, oldset) +- + #endif /* GOOGLE_BREAKPAD_COMMON_ANDROID_TESTING_PTHREAD_FIXES_H */ +diff -u -r ../libuv-v1.7.3/src/unix/pthread-fixes.c ./src/unix/pthread-fixes.c +--- ../libuv-v1.7.3/src/unix/pthread-fixes.c 2015-08-27 17:42:36.000000000 -0400 ++++ ./src/unix/pthread-fixes.c 2015-09-08 17:31:31.562244293 -0400 +@@ -29,31 +29,6 @@ + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +-/* Android versions < 4.1 have a broken pthread_sigmask. +- * Note that this block of code must come before any inclusion of +- * pthread-fixes.h so that the real pthread_sigmask can be referenced. +- * */ +-#include +-#include +-#include +- +-int uv__pthread_sigmask(int how, const sigset_t* set, sigset_t* oset) { +- static int workaround; +- +- if (workaround) { +- return sigprocmask(how, set, oset); +- } else if (pthread_sigmask(how, set, oset)) { +- if (errno == EINVAL && sigprocmask(how, set, oset) == 0) { +- workaround = 1; +- return 0; +- } else { +- return -1; +- } +- } else { +- return 0; +- } +-} +- + /*Android doesn't provide pthread_barrier_t for now.*/ + #ifndef PTHREAD_BARRIER_SERIAL_THREAD +