Index: ports/libxcb/nacl.patch |
diff --git a/ports/libxcb/nacl.patch b/ports/libxcb/nacl.patch |
index 5d72c02fcb0b530b32e0c483947f6c6f72a24c20..60958756f16e412ba73d3134459ce284c994b986 100644 |
--- a/ports/libxcb/nacl.patch |
+++ b/ports/libxcb/nacl.patch |
@@ -1,7 +1,36 @@ |
diff --git a/configure b/configure |
--- a/configure |
+++ b/configure |
-@@ -13123,7 +13123,9 @@ else |
+@@ -6048,7 +6048,8 @@ irix5* | irix6* | nonstopux*) |
+ ;; |
+ |
+ # This must be glibc/ELF. |
+-linux* | k*bsd*-gnu | kopensolaris*-gnu) |
++# Patched by naclports using patch_configure.py |
++linux* | k*bsd*-gnu | kopensolaris*-gnu | nacl*) |
+ lt_cv_deplibs_check_method=pass_all |
+ ;; |
+ |
+@@ -11523,6 +11524,18 @@ uts4*) |
+ shlibpath_var=LD_LIBRARY_PATH |
+ ;; |
+ |
++nacl) |
++ # Patched by naclports using patch_configure.py |
++ if libc_so=`$CC -print-file-name=libc.so` && [ "$libc_so" != libc.so ]; then |
++ dynamic_linker="GNU/NaCl ld.so" |
++ version_type=linux |
++ library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' |
++ soname_spec='${libname}${release}${shared_ext}$major' |
++ else |
++ dynamic_linker=no |
++ fi |
++ ;; |
++ |
+ *) |
+ dynamic_linker=no |
+ ;; |
+@@ -13123,7 +13136,9 @@ else |
$as_echo "yes" >&6; } |
fi |
@@ -42,41 +71,3 @@ diff --git a/src/xcb_conn.c b/src/xcb_conn.c |
static int set_fd_flags(const int fd) |
{ |
/* Win32 doesn't have file descriptors and the fcntl function. This block sets the socket in non-blocking mode */ |
-@@ -179,7 +199,8 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count) |
- int n; |
- assert(!c->out.queue_len); |
- |
--#ifdef _WIN32 |
-+ /* Using writev emulation for nacl newlib. */ |
-+#if defined(_WIN32) || (defined(__native_client__) && defined(_NEWLIB_VERSION)) |
- int i = 0; |
- int ret = 0,err = 0; |
- struct iovec *vec; |
-@@ -190,11 +211,26 @@ static int write_vec(xcb_connection_t *c, struct iovec **vector, int *count) |
- vec = *vector; |
- while(i < *count) |
- { |
-- ret = send(c->fd,vec->iov_base,vec->iov_len,0); |
-+ /* |
-+ * TODO(bradnelson): Drop if nacl_io supports zero length sends. |
-+ * https://code.google.com/p/naclports/issues/detail?id=228 |
-+ */ |
-+ if (vec->iov_len != 0) { |
-+ ret = send(c->fd,vec->iov_base,vec->iov_len,0); |
-+ } else { |
-+ ret = 0; |
-+ } |
-+ /* Generalize to posix so this can be used with nacl newlib. */ |
-+#if defined(__native_client__) && defined(_NEWLIB_VERSION) |
-+ if(ret < 0) |
-+ { |
-+ if(errno == EWOULDBLOCK) |
-+#else |
- if(ret == SOCKET_ERROR) |
- { |
- err = WSAGetLastError(); |
- if(err == WSAEWOULDBLOCK) |
-+#endif |
- { |
- return 1; |
- } |