From 716a79bea02a49ee97a5f7ea8dd54513e34d9cc4 Mon Sep 17 00:00:00 2001 From: Fredrik Fornwall Date: Mon, 4 Jan 2016 06:34:21 -0500 Subject: [PATCH] libevent: Fix 64-bit build The arc4random_addrandom() function has been removed from 64-bit Android libc. --- packages/libevent/evutil_rand.c.patch | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 packages/libevent/evutil_rand.c.patch diff --git a/packages/libevent/evutil_rand.c.patch b/packages/libevent/evutil_rand.c.patch new file mode 100644 index 000000000..785863935 --- /dev/null +++ b/packages/libevent/evutil_rand.c.patch @@ -0,0 +1,19 @@ +diff -u -r ../libevent-2.0.22-stable/evutil_rand.c ./evutil_rand.c +--- ../libevent-2.0.22-stable/evutil_rand.c 2013-11-01 14:18:57.000000000 -0400 ++++ ./evutil_rand.c 2016-01-03 20:05:10.168762009 -0500 +@@ -171,10 +171,15 @@ + ev_arc4random_buf(buf, n); + } + ++#ifndef __ANDROID__ ++/* The arc4random_addrandom() has been removed from 64-bit Android libc, ++ see https://bugzilla.mozilla.org/show_bug.cgi?id=931354 for motivation ++ about just removing this function completely. */ + void + evutil_secure_rng_add_bytes(const char *buf, size_t n) + { + arc4random_addrandom((unsigned char*)buf, + n>(size_t)INT_MAX ? INT_MAX : (int)n); + } ++#endif +