From eaf19f25d0dff0f4e468629e6c5e0913e0642a5b Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 6 Mar 2017 16:53:08 +0100 Subject: [PATCH] Use clang to compile for Android. Except on mips64, where we have to stick to gcc. --- dist-build/android-build.sh | 2 ++ dist-build/android-mips32.sh | 4 ++-- dist-build/android-mips64.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dist-build/android-build.sh b/dist-build/android-build.sh index 24066e81..42422411 100755 --- a/dist-build/android-build.sh +++ b/dist-build/android-build.sh @@ -31,6 +31,8 @@ export PREFIX="$(pwd)/libsodium-android-${TARGET_ARCH}" export TOOLCHAIN_DIR="$(pwd)/android-toolchain-${TARGET_ARCH}" export PATH="${PATH}:${TOOLCHAIN_DIR}/bin" +export CC=${CC:-"${HOST_COMPILER}-clang"} + rm -rf "${TOOLCHAIN_DIR}" "${PREFIX}" echo diff --git a/dist-build/android-mips32.sh b/dist-build/android-mips32.sh index 6e33c938..f17081c8 100755 --- a/dist-build/android-mips32.sh +++ b/dist-build/android-mips32.sh @@ -1,4 +1,4 @@ #!/bin/sh export TARGET_ARCH=mips32 -export CFLAGS="-Os -march=${TARGET_ARCH}" -ARCH=mips HOST_COMPILER=mipsel-linux-android "$(dirname "$0")/android-build.sh" +export CFLAGS="-Os" +ARCH=mips HOST_COMPILER=mips64el-linux-android "$(dirname "$0")/android-build.sh" diff --git a/dist-build/android-mips64.sh b/dist-build/android-mips64.sh index 4eeeda4a..f4f3385f 100755 --- a/dist-build/android-mips64.sh +++ b/dist-build/android-mips64.sh @@ -1,4 +1,4 @@ #!/bin/sh export TARGET_ARCH=mips64r6 export CFLAGS="-Os -march=${TARGET_ARCH}" -NDK_PLATFORM_COMPAT=android-21 ARCH=mips64 HOST_COMPILER=mips64el-linux-android "$(dirname "$0")/android-build.sh" +CC="mips64el-linux-android-gcc" NDK_PLATFORM_COMPAT=android-21 ARCH=mips64 HOST_COMPILER=mips64el-linux-android "$(dirname "$0")/android-build.sh"