libuv: Avoid pthread_sigmask workaround
authorFredrik Fornwall <fredrik@fornwall.net>
Tue, 8 Sep 2015 22:37:21 +0000 (18:37 -0400)
committerFredrik Fornwall <fredrik@fornwall.net>
Tue, 8 Sep 2015 22:37:21 +0000 (18:37 -0400)
packages/libuv/build.sh
packages/libuv/pthread-sigmask.patch [new file with mode: 0644]

index dcd7542..263745f 100644 (file)
@@ -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_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
 
 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 (file)
index 0000000..cb06932
--- /dev/null
@@ -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 <errno.h>
+-#include <pthread.h>
+-#include <signal.h>
+-
+-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