aboutsummaryrefslogtreecommitdiff
path: root/depends/patches
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2019-11-04 13:32:05 +0100
committerWladimir J. van der Laan <laanwj@protonmail.com>2019-11-04 13:32:19 +0100
commit91fbcf41b35c024e62d13942acac20c48cc40894 (patch)
tree62cbc69f104b1920f235731f4a10f2fce62aaa62 /depends/patches
parentc4b8dd20600f72e20c513a33e2df6928c06facfc (diff)
parentf9af3ced1c69d65c5c530ec5526f5eefaf786126 (diff)
Merge #16110: depends: Add Android NDK support
f9af3ced1c69d65c5c530ec5526f5eefaf786126 Android: add all arch support (Block Mechanic) d419ca7e32bfc71e8dd1f1b91870463eacd6ad8e depends: export dynamic JNI symbols from static qtforandroid.a (Igor Cota) ed30684d03d3a1d5496e69c488d848fe92ae6fb4 Qt: patch androidjnimain.cpp to make sure JNI is initialised when statically compiled (Igor Cota) e4c319e8a1c6e40a953036b942bd5d732b0bbf69 builds: remove superfluous config_opts_aarch64_android (Igor Cota) 24ffef0c271739a2ca75feecb816f3218c1850bf Patch libevent when building for Android (fix arc4random_addrandom) (Igor Cota) f1e40b3e7114b18bc03f45c3a97f9f673543ddef Update bitcoin_qt.m4 (BlockMechanic) b4057d82618a21720f39f448b689cebf475cc2dc Define TARGET_OS when host is android (Igor Cota) 80b475f159525737e242161397f35d0729449545 Fix Android zlib cross compilation issue (https://stackoverflow.com/questions/21396988/zlib-build-not-configuring-properly-with-cross-compiler-ignores-ar) (Igor Cota) 45f82190150b3feef333724ea7395ba080e700b1 Add full Android build example command and instructions on getting SDK/NDK (Igor Cota) b68f2a68c211aa2264e9ca824d10a90f4a5a5af4 Add config opts and patch for aarch64_android build of Qt (Igor Cota) 9c4cb0166e801471f8cb3d82656c86bacf051db6 Add ranlib to android.mk hosts file (fix OSX Android NDK build) (Igor Cota) c2a749c9c16697e744ecfb283fdf4095d0278066 Add example Android host-platform-triplet and options (Igor Cota) 0b0cff3c61610fb56f8c5c9451ace01598117a8d Add support for building Android dependencies (Igor Cota) Pull request description: This allows one to build the dependencies with the Android SDK and goes towards fixing #11844. It has been tested to work with: `make HOST=aarch64-linux-android ANDROID_API_LEVEL=28 ANDROID_TOOLCHAIN_BIN=/home/user/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin NO_QT=1 NO_WALLET=1` ACKs for top commit: Sjors: ACK f9af3ce. I'm OK with merging and then improving later. Tree-SHA512: cb805115ebe5c9e33db2bf3eab8628808fe3f50052053d8877d8b8e4406d6fea1ed9e5c4dff85d777fb99c81be6ffb9d95a0e6d32344e728e5e0da6c653e2ce7
Diffstat (limited to 'depends/patches')
-rw-r--r--depends/patches/libevent/fix_android_arc4random_addrandom.patch68
-rw-r--r--depends/patches/qt/fix_android_jni_static.patch18
-rw-r--r--depends/patches/qt/fix_android_qmake_conf.patch20
3 files changed, 106 insertions, 0 deletions
diff --git a/depends/patches/libevent/fix_android_arc4random_addrandom.patch b/depends/patches/libevent/fix_android_arc4random_addrandom.patch
new file mode 100644
index 0000000000..5bcc64bef6
--- /dev/null
+++ b/depends/patches/libevent/fix_android_arc4random_addrandom.patch
@@ -0,0 +1,68 @@
+From cadae3ab7abf45e61ecae8aac39d97d1f3cbd336 Mon Sep 17 00:00:00 2001
+From: Lawrence Nahum <lawrence@greenaddress.it>
+Date: Sun, 3 Dec 2017 22:56:09 +0100
+Subject: [PATCH] fixup
+
+---
+ configure.ac | 1 +
+ evutil_rand.c | 3 +++
+ include/event2/util.h | 4 ++--
+ 3 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 7528d37..3bb2121 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -341,6 +341,7 @@ dnl Checks for library functions.
+ AC_CHECK_FUNCS([ \
+ accept4 \
+ arc4random \
++ arc4random_addrandom \
+ arc4random_buf \
+ eventfd \
+ epoll_create1 \
+diff --git a/evutil_rand.c b/evutil_rand.c
+index 046a14b..3f0bf2c 100644
+--- a/evutil_rand.c
++++ b/evutil_rand.c
+@@ -191,6 +191,7 @@ evutil_secure_rng_get_bytes(void *buf, size_t n)
+ {
+ ev_arc4random_buf(buf, n);
+ }
++#ifdef HAVE_ARC4RANDOM_ADDRANDOM
+
+ void
+ evutil_secure_rng_add_bytes(const char *buf, size_t n)
+@@ -199,6 +200,8 @@ evutil_secure_rng_add_bytes(const char *buf, size_t n)
+ n>(size_t)INT_MAX ? INT_MAX : (int)n);
+ }
+
++#endif
++
+ void
+ evutil_free_secure_rng_globals_(void)
+ {
+diff --git a/include/event2/util.h b/include/event2/util.h
+index dd4bbb6..a9a169d 100644
+--- a/include/event2/util.h
++++ b/include/event2/util.h
+@@ -841,7 +841,7 @@ int evutil_secure_rng_init(void);
+ */
+ EVENT2_EXPORT_SYMBOL
+ int evutil_secure_rng_set_urandom_device_file(char *fname);
+-
++#ifdef HAVE_ARC4RANDOM_ADDRANDOM
+ /** Seed the random number generator with extra random bytes.
+
+ You should almost never need to call this function; it should be
+@@ -858,7 +858,7 @@ int evutil_secure_rng_set_urandom_device_file(char *fname);
+ */
+ EVENT2_EXPORT_SYMBOL
+ void evutil_secure_rng_add_bytes(const char *dat, size_t datlen);
+-
++#endif
+ #ifdef __cplusplus
+ }
+ #endif
+--
+2.14.3
diff --git a/depends/patches/qt/fix_android_jni_static.patch b/depends/patches/qt/fix_android_jni_static.patch
new file mode 100644
index 0000000000..2f6ff00f40
--- /dev/null
+++ b/depends/patches/qt/fix_android_jni_static.patch
@@ -0,0 +1,18 @@
+--- old/qtbase/src/plugins/platforms/android/androidjnimain.cpp
++++ new/qtbase/src/plugins/platforms/android/androidjnimain.cpp
+@@ -890,6 +890,14 @@
+ __android_log_print(ANDROID_LOG_FATAL, "Qt", "registerNatives failed");
+ return -1;
+ }
++
++ const jint ret = QT_PREPEND_NAMESPACE(QtAndroidPrivate::initJNI(vm, env));
++ if (ret != 0)
++ {
++ __android_log_print(ANDROID_LOG_FATAL, "Qt", "initJNI failed");
++ return ret;
++ }
++
+ QWindowSystemInterfacePrivate::TabletEvent::setPlatformSynthesizesMouse(false);
+
+ m_javaVM = vm;
+
diff --git a/depends/patches/qt/fix_android_qmake_conf.patch b/depends/patches/qt/fix_android_qmake_conf.patch
new file mode 100644
index 0000000000..13bfff9776
--- /dev/null
+++ b/depends/patches/qt/fix_android_qmake_conf.patch
@@ -0,0 +1,20 @@
+--- old/qtbase/mkspecs/android-clang/qmake.conf
++++ new/qtbase/mkspecs/android-clang/qmake.conf
+@@ -30,7 +30,7 @@
+ QMAKE_CFLAGS += -target mips64el-none-linux-android
+
+ QMAKE_CFLAGS += -gcc-toolchain $$NDK_TOOLCHAIN_PATH
+-QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a
++QMAKE_LINK = $$QMAKE_CXX $$QMAKE_CFLAGS -Wl,--exclude-libs,libgcc.a -nostdlib++
+ QMAKE_CFLAGS += -DANDROID_HAS_WSTRING --sysroot=$$NDK_ROOT/sysroot \
+ -isystem $$NDK_ROOT/sysroot/usr/include/$$NDK_TOOLS_PREFIX \
+ -isystem $$NDK_ROOT/sources/cxx-stl/llvm-libc++/include \
+@@ -40,7 +40,7 @@
+ ANDROID_SOURCES_CXX_STL_LIBDIR = $$NDK_ROOT/sources/cxx-stl/llvm-libc++/libs/$$ANDROID_TARGET_ARCH
+
+ ANDROID_STDCPP_PATH = $$ANDROID_SOURCES_CXX_STL_LIBDIR/libc++_shared.so
+-ANDROID_CXX_STL_LIBS = -lc++
++ANDROID_CXX_STL_LIBS = -lc++_shared
+
+ QMAKE_ARM_CFLAGS_RELEASE = -Oz
+ QMAKE_ARM_CFLAGS_RELEASE_WITH_DEBUGINFO = -g -Oz