From c4b28a6a62388c5ad4004962edb43cadbfba5ddb Mon Sep 17 00:00:00 2001 From: Czarek Nakamoto Date: Thu, 23 May 2024 08:03:35 +0200 Subject: [PATCH] -DCMAKE_SYSTEM_VERSION=1 is the workaround to update to newer ndk without breaking the entire build system --- .github/workflows/compat.yaml | 33 ++++- README.md | 2 +- build_single.sh | 46 +++---- monero_libwallet2_api_c/CMakeLists.txt | 6 +- .../0013-android-ndk-version-bump.patch | 113 ++++++++++++++++++ 5 files changed, 172 insertions(+), 28 deletions(-) create mode 100644 patches/monero/0013-android-ndk-version-bump.patch diff --git a/.github/workflows/compat.yaml b/.github/workflows/compat.yaml index 8f973e5..57380e9 100644 --- a/.github/workflows/compat.yaml +++ b/.github/workflows/compat.yaml @@ -128,4 +128,35 @@ jobs: uses: softprops/action-gh-release@v2 if: startsWith(github.ref, 'refs/tags/') with: - files: release/gh/* \ No newline at end of file + files: release/gh/* + macos-host: + runs-on: macos-13 + steps: + - uses: maxim-lobanov/setup-xcode@v1 + with: + xcode-version: '15.4' + - name: Set up Homebrew + id: set-up-homebrew + uses: Homebrew/actions/setup-homebrew@master + - name: Install brew dependencies + run: | + brew install unbound boost@1.76 zmq + brew link boost@1.76 + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + submodules: recursive + - name: Patch sources + run: | + git config --global --add safe.directory '*' + git config --global user.email "ci@mrcyjanek.net" + git config --global user.name "CI mrcyjanek.net" + ./apply_patches.sh monero + ./apply_patches.sh wownero + - name: monero/host-apple-darwin + run: | + ./build-single.sh monero host-apple-darwin -j$(sysctl -n hw.activecpu) + - name: wownero/host-apple-darwin + run: | + ./build-single.sh wownero host-apple-darwin -j$(sysctl -n hw.activecpu) + \ No newline at end of file diff --git a/README.md b/README.md index 5e31f0f..d9aeee4 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ While building I aim to compile the code at oldest supported release of debian, | x86_64-w64-mingw32 | debian:buster | -"- | | x86_64-apple-darwin11 | debian:bookworm | extra build step: `${HOST_ABI}-ranlib $PWD/$repo/contrib/depends/${HOST_ABI}/lib/libpolyseed.a` | | aarch64-apple-darwin11 | debian:bookworm | -"- | -| host-apple-darwin | arm64-apple-darwin23 | dependencies: `brew install unbound boost@1.76 zmq` | +| host-apple-darwin | arm64-apple-darwin23 | dependencies: `brew install unbound boost@1.76 zmq && brew link boost@1.76` | | host-apple-ios | arm64-apple-darwin23 | | Libraries on CI are build using the following docker images: diff --git a/build_single.sh b/build_single.sh index f62cd67..04aef9f 100755 --- a/build_single.sh +++ b/build_single.sh @@ -59,23 +59,23 @@ case "$HOST_ABI" in ;; "x86_64-linux-android") export PATH="$WDIR/$repo/contrib/depends/${HOST_ABI}/native/bin/:$PATH" - export CC=${HOST_ABI}-clang - export CXX=${HOST_ABI}-clang++ + export CC=x86_64-linux-android21-clang + export CXX=x86_64-linux-android21-clang++ ;; "i686-linux-android") export PATH="$WDIR/$repo/contrib/depends/${HOST_ABI}/native/bin/:$PATH" - export CC=${HOST_ABI}-clang - export CXX=${HOST_ABI}-clang++ + export CC=i686-linux-android21-clang + export CXX=i686-linux-android21-clang++ ;; "aarch64-linux-android") export PATH="$WDIR/$repo/contrib/depends/${HOST_ABI}/native/bin/:$PATH" - export CC=${HOST_ABI}-clang - export CXX=${HOST_ABI}-clang++ + export CC=aarch64-linux-android21-clang + export CXX=aarch64-linux-android21-clang++ ;; "arm-linux-androideabi") export PATH="$WDIR/$repo/contrib/depends/${HOST_ABI}/native/bin/:$PATH" - export CC=${HOST_ABI}-clang - export CXX=${HOST_ABI}-clang++ + export CC=aarch64-linux-android21-clang + export CXX=aarch64-linux-android21-clang++ ;; "i686-w64-mingw32") update-alternatives --set i686-w64-mingw32-gcc /usr/bin/i686-w64-mingw32-gcc-posix @@ -256,40 +256,40 @@ mkdir -p $repo/build/${HOST_ABI} pushd $repo/build/${HOST_ABI} case "$HOST_ABI" in "x86_64-linux-gnu") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="x86-64" -D STATIC=ON -D BUILD_64="ON" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=false -D BUILD_TAG="linux-x64" -D CMAKE_SYSTEM_NAME="Linux" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="x86-64" -D STATIC=ON -D BUILD_64="ON" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=false -D BUILD_TAG="linux-x64" -D CMAKE_SYSTEM_NAME="Linux" ../.. ;; "i686-linux-gnu") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="i686" -D STATIC=ON -D BUILD_64="OFF" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=false -D BUILD_TAG="linux-x86" -D CMAKE_SYSTEM_NAME="Linux" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="i686" -D STATIC=ON -D BUILD_64="OFF" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=false -D BUILD_TAG="linux-x86" -D CMAKE_SYSTEM_NAME="Linux" ../.. ;; "aarch64-linux-gnu") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="armv8-a" -D STATIC=ON -D BUILD_64="ON" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=false -D BUILD_TAG="linux-armv8" -D CMAKE_SYSTEM_NAME="Linux" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="armv8-a" -D STATIC=ON -D BUILD_64="ON" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=false -D BUILD_TAG="linux-armv8" -D CMAKE_SYSTEM_NAME="Linux" ../.. ;; "x86_64-linux-android") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="x86-64" -D STATIC=ON -D BUILD_64="ON" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=true -D BUILD_TAG="android-x86_64" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_ARCH_ABI="x86_64" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="x86-64" -D STATIC=ON -D BUILD_64="ON" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=true -D BUILD_TAG="android-x86_64" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_ARCH_ABI="x86_64" ../.. ;; "i686-linux-android") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="x86" -D STATIC=ON -D BUILD_64="OFF" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=true -D BUILD_TAG="android-x86" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_ARCH_ABI="x86" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="x86" -D STATIC=ON -D BUILD_64="OFF" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=true -D BUILD_TAG="android-x86" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_ARCH_ABI="x86" ../.. ;; "aarch64-linux-android") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="armv8-a" -D STATIC=ON -D BUILD_64="ON" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=true -D BUILD_TAG="android-armv8" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_ARCH_ABI="arm64-v8a" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="armv8-a" -D STATIC=ON -D BUILD_64="ON" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=true -D BUILD_TAG="android-armv8" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_ARCH_ABI="arm64-v8a" ../.. ;; "arm-linux-androideabi") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="armv7-a" -D STATIC=ON -D BUILD_64="OFF" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=true -D BUILD_TAG="android-armv7" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_ARCH_ABI="armeabi-v7a" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_SYSTEM_VERSION=1 -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D ARCH="armv7-a" -D STATIC=ON -D BUILD_64="OFF" -D CMAKE_BUILD_TYPE=$buildType -D ANDROID=true -D BUILD_TAG="android-armv7" -D CMAKE_SYSTEM_NAME="Android" -D CMAKE_ANDROID_ARCH_ABI="armeabi-v7a" ../.. ;; "x86_64-w64-mingw32") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType -D BUILD_TAG="win-x64" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType -D BUILD_TAG="win-x64" ../.. ;; "i686-w64-mingw32") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D ARCH="i686" -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=$buildType -D BUILD_TAG="win-x32" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D ARCH="i686" -D BUILD_64=OFF -D CMAKE_BUILD_TYPE=$buildType -D BUILD_TAG="win-x32" ../.. ;; "x86_64-apple-darwin11") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType -D BUILD_TAG="mac-x64" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D ARCH="x86-64" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType -D BUILD_TAG="mac-x64" ../.. ;; "aarch64-apple-darwin11") - env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D ARCH="armv8-a" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType -D BUILD_TAG="mac-armv8" ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_TOOLCHAIN_FILE=$PWD/../../contrib/depends/${HOST_ABI}/share/toolchain.cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D ARCH="armv8-a" -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType -D BUILD_TAG="mac-armv8" ../.. ;; "host-apple-darwin" | "x86_64-host-apple-darwin" | "aarch64-host-apple-darwin") - env CC="${CC}" CXX="${CXX}" cmake -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType ../.. + env CC="${CC}" CXX="${CXX}" cmake -DCMAKE_POSITION_INDEPENDENT_CODE=ON -D USE_DEVICE_TREZOR=OFF -D BUILD_GUI_DEPS=1 -D BUILD_TESTS=OFF -D STATIC=ON -D BUILD_64=ON -D CMAKE_BUILD_TYPE=$buildType ../.. ;; "host-apple-ios") PREFIX="$(realpath "${PWD}/../../../external/ios/build/ios")" @@ -323,7 +323,8 @@ pushd ${repo}_libwallet2_api_c mkdir -p build/${HOST_ABI} -p pushd build/${HOST_ABI} case $HOST_ABI in - "x86_64-linux-gnu" | "i686-linux-gnu" | "aarch64-linux-gnu" | "x86_64-linux-android" | "i686-linux-android" | "aarch64-linux-android" | "arm-linux-androideabi" | "i686-w64-mingw32" | "x86_64-w64-mingw32" | "x86_64-apple-darwin11" | "aarch64-apple-darwin11" | "host-apple-darwin" | "x86_64-host-apple-darwin" | "aarch64-host-apple-darwin") + "x86_64-linux-gnu" | "i686-linux-gnu" | "aarch64-linux-gnu" | "i686-w64-mingw32" | "x86_64-w64-mingw32" | "x86_64-apple-darwin11" | "aarch64-apple-darwin11" | "host-apple-darwin" | "x86_64-host-apple-darwin" | "aarch64-host-apple-darwin" | "x86_64-linux-android" | "i686-linux-android" | "aarch64-linux-android" | "arm-linux-androideabi") + echo $CC env CC="${CC}" CXX="${CXX}" cmake -DMONERO_FLAVOR=$repo -DCMAKE_BUILD_TYPE=Debug -DHOST_ABI=${HOST_ABI} ../.. CC="${CC}" CXX="${CXX}" make $NPROC ;; @@ -386,8 +387,7 @@ pushd release/$repo fi if [[ "$HOST_ABI" == "x86_64-linux-android" || "$HOST_ABI" == "i686-linux-android" || "$HOST_ABI" == "aarch64-linux-android" || "$HOST_ABI" == "arm-linux-androideabi" ]]; then - cp ../../monero/contrib/depends/$HOST_ABI/native/$HOST_ABI/lib*/libc++_shared.so ${HOST_ABI}_libc++_shared.so || \ - cp ../../monero/contrib/depends/$HOST_ABI/native/$HOST_ABI/lib/armv7-a/libc++_shared.so ${HOST_ABI}_libc++_shared.so + cp ../../monero/contrib/depends/${HOST_ABI}/native/sysroot/usr/lib/${HOST_ABI}/libc++_shared.so ${HOST_ABI}_libc++_shared.so rm ${HOST_ABI}_libc++_shared.so.xz || true xz -e ${HOST_ABI}_libc++_shared.so fi diff --git a/monero_libwallet2_api_c/CMakeLists.txt b/monero_libwallet2_api_c/CMakeLists.txt index d6dd7b5..e9691b7 100644 --- a/monero_libwallet2_api_c/CMakeLists.txt +++ b/monero_libwallet2_api_c/CMakeLists.txt @@ -306,8 +306,7 @@ include_directories( ${EXTERNAL_LIBS_DIR}/include ) message(STATUS EXTERNAL_LIBS_DIR : ${EXTERNAL_LIBS_DIR}) if(${HOST_ABI} STREQUAL "x86_64-linux-gnu" OR - ${HOST_ABI} STREQUAL "x86_64-apple-darwin11" OR - ${HOST_ABI} STREQUAL "x86_64-linux-android") + ${HOST_ABI} STREQUAL "x86_64-apple-darwin11") set(EXTRA_LIBS "wallet-crypto") else() set(EXTRA_LIBS "") @@ -349,6 +348,7 @@ endif() if (${MONERO_FLAVOR} STREQUAL "monero") target_compile_definitions(wallet2_api_c PRIVATE FLAVOR_MONERO) + set(BCUR_ENABLED bc-ur) elseif(${MONERO_FLAVOR} STREQUAL "wownero") target_compile_definitions(wallet2_api_c PRIVATE FLAVOR_WOWNERO) endif() @@ -414,7 +414,7 @@ target_link_libraries( wallet2_api_c ${EXTRA_LIBS_WOWNEROSEED} utf8proc - bc-ur + ${BCUR_ENABLED} ssl crypto diff --git a/patches/monero/0013-android-ndk-version-bump.patch b/patches/monero/0013-android-ndk-version-bump.patch new file mode 100644 index 0000000..dbc9ace --- /dev/null +++ b/patches/monero/0013-android-ndk-version-bump.patch @@ -0,0 +1,113 @@ +From 29bdcc2760da4e26ca4320394560e4fdf1d3736f Mon Sep 17 00:00:00 2001 +From: Czarek Nakamoto +Date: Thu, 23 May 2024 08:02:49 +0200 +Subject: [PATCH] android ndk version bump + +--- + contrib/depends/hosts/android.mk | 16 +++++++++++++--- + contrib/depends/packages/android_ndk.mk | 12 +++++++----- + contrib/depends/packages/boost.mk | 1 + + contrib/depends/toolchain.cmake.in | 11 ++++++----- + 4 files changed, 27 insertions(+), 13 deletions(-) + +diff --git a/contrib/depends/hosts/android.mk b/contrib/depends/hosts/android.mk +index d6f8b99dd..e1c99aef3 100644 +--- a/contrib/depends/hosts/android.mk ++++ b/contrib/depends/hosts/android.mk +@@ -1,12 +1,22 @@ + ANDROID_API=21 +- ++host_toolchain=nonexistent + ifeq ($(host_arch),arm) +-host_toolchain=arm-linux-androideabi- ++host_toolchain=armv7a-linux-androideabi${ANDROID_API}- ++endif ++ifeq ($(host_arch),x86_64) ++host_toolchain=x86_64-linux-android${ANDROID_API}- ++endif ++ifeq ($(host_arch),i686) ++host_toolchain=i686-linux-android${ANDROID_API}- ++endif ++ifeq ($(host_arch),aarch64) ++host_toolchain=aarch64-linux-android${ANDROID_API}- + endif + + android_CC=$(host_toolchain)clang + android_CXX=$(host_toolchain)clang++ +-android_RANLIB=: ++android_RANLIB=llvm-ranlib ++android_AR=llvm-ar + + android_CFLAGS=-pipe + android_CXXFLAGS=$(android_CFLAGS) +diff --git a/contrib/depends/packages/android_ndk.mk b/contrib/depends/packages/android_ndk.mk +index 5deff76c7..e5a433a38 100644 +--- a/contrib/depends/packages/android_ndk.mk ++++ b/contrib/depends/packages/android_ndk.mk +@@ -1,8 +1,8 @@ + package=android_ndk +-$(package)_version=17b ++$(package)_version=26d + $(package)_download_path=https://dl.google.com/android/repository/ +-$(package)_file_name=android-ndk-r$($(package)_version)-linux-x86_64.zip +-$(package)_sha256_hash=5dfbbdc2d3ba859fed90d0e978af87c71a91a5be1f6e1c40ba697503d48ccecd ++$(package)_file_name=android-ndk-r$($(package)_version)-linux.zip ++$(package)_sha256_hash=eefeafe7ccf177de7cc57158da585e7af119bb7504a63604ad719e4b2a328b54 + + define $(package)_set_vars + $(package)_config_opts_arm=--arch arm +@@ -17,8 +17,10 @@ define $(package)_extract_cmds + endef + + define $(package)_stage_cmds ++ mkdir -p $(build_prefix) &&\ ++ echo $(build_prefix)/toolchain && \ + android-ndk-r$($(package)_version)/build/tools/make_standalone_toolchain.py --api 21 \ +- --install-dir $(build_prefix) --stl=libc++ $($(package)_config_opts) &&\ +- mv $(build_prefix) $($(package)_staging_dir)/$(host_prefix) ++ --install-dir $(build_prefix)/toolchain --stl=libc++ $($(package)_config_opts) &&\ ++ mv $(build_prefix)/toolchain $($(package)_staging_dir)/$(host_prefix)/native + endef + +diff --git a/contrib/depends/packages/boost.mk b/contrib/depends/packages/boost.mk +index fd06c5393..c17e863cc 100644 +--- a/contrib/depends/packages/boost.mk ++++ b/contrib/depends/packages/boost.mk +@@ -25,6 +25,7 @@ $(package)_archiver_darwin=$($(package)_libtool) + $(package)_config_libraries=chrono,filesystem,program_options,system,thread,test,date_time,regex,serialization,locale + $(package)_cxxflags=-std=c++11 + $(package)_cxxflags_linux=-fPIC ++$(package)_cxxflags_android=-fPIC + $(package)_cxxflags_freebsd=-fPIC + endef + +diff --git a/contrib/depends/toolchain.cmake.in b/contrib/depends/toolchain.cmake.in +index f26655d68..96a95ceb8 100644 +--- a/contrib/depends/toolchain.cmake.in ++++ b/contrib/depends/toolchain.cmake.in +@@ -104,16 +104,17 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "Android") + SET(CMAKE_ANDROID_ARCH_ABI "armeabi-v7a") + SET(CMAKE_SYSTEM_PROCESSOR "armv7-a") + SET(CMAKE_ANDROID_ARM_MODE ON) +- SET(CMAKE_C_COMPILER_TARGET arm-linux-androideabi) +- SET(CMAKE_CXX_COMPILER_TARGET arm-linux-androideabi) +- SET(_CMAKE_TOOLCHAIN_PREFIX arm-linux-androideabi-) ++ SET(CMAKE_C_COMPILER_TARGET arm-linux-androideabi21) ++ SET(CMAKE_CXX_COMPILER_TARGET arm-linux-androideabi21) ++ SET(_CMAKE_TOOLCHAIN_PREFIX arm-linux-androideabi21-) + elseif(ARCHITECTURE STREQUAL "aarch64") + SET(CMAKE_ANDROID_ARCH_ABI "arm64-v8a") + SET(CMAKE_SYSTEM_PROCESSOR "aarch64") + endif() + SET(CMAKE_ANDROID_STANDALONE_TOOLCHAIN @prefix@/native) +- SET(CMAKE_C_COMPILER "${_CMAKE_TOOLCHAIN_PREFIX}clang") +- SET(CMAKE_CXX_COMPILER "${_CMAKE_TOOLCHAIN_PREFIX}clang++") ++ SET(_ANDROID_STANDALONE_TOOLCHAIN_API 21) ++ SET(CMAKE_C_COMPILER @CC@) ++ SET(CMAKE_CXX_COMPILER @CXX@) + else() + SET(CMAKE_C_COMPILER @CC@) + SET(CMAKE_CXX_COMPILER @CXX@) +-- +2.39.2 +