From ab51c6f98dc13e08db1870514157b4d6849b011d Mon Sep 17 00:00:00 2001 From: Javernaut Date: Sat, 25 Jul 2020 15:17:07 +0300 Subject: [PATCH] Libvpx. Using native android targets with specified compiler and binutils --- scripts/export-build-variables.sh | 2 +- scripts/ffmpeg/build.sh | 2 +- scripts/libvpx/build.sh | 17 ++++++++--------- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/scripts/export-build-variables.sh b/scripts/export-build-variables.sh index 843bd70..7f69983 100755 --- a/scripts/export-build-variables.sh +++ b/scripts/export-build-variables.sh @@ -65,6 +65,7 @@ export CROSS_PREFIX_WITH_PATH=${TOOLCHAIN_PATH}/bin/${CROSS_PREFIX} # Exporting Binutils paths, if passing just CROSS_PREFIX_WITH_PATH is not enough # The FAM_ prefix is used to eliminate passing those values implicitly to build systems export FAM_ADDR2LINE=${CROSS_PREFIX_WITH_PATH}addr2line +export FAM_AS=${CROSS_PREFIX_WITH_PATH}as export FAM_AR=${CROSS_PREFIX_WITH_PATH}ar export FAM_NM=${CROSS_PREFIX_WITH_PATH}nm export FAM_OBJCOPY=${CROSS_PREFIX_WITH_PATH}objcopy @@ -80,7 +81,6 @@ export TARGET=${TARGET_TRIPLE_MACHINE_CC}-linux-${TARGET_TRIPLE_OS}${ANDROID_PLA export FAM_CC=${TOOLCHAIN_PATH}/bin/${TARGET}-clang export FAM_CXX=${FAM_CC}++ export FAM_LD=${FAM_CC} -export FAM_AS=${FAM_CC} # TODO consider abondaning this strategy of defining the name of the clang wrapper # in favour of just passing -mstackrealign and -fno-addrsig depending on diff --git a/scripts/ffmpeg/build.sh b/scripts/ffmpeg/build.sh index 9457618..402e442 100755 --- a/scripts/ffmpeg/build.sh +++ b/scripts/ffmpeg/build.sh @@ -31,7 +31,7 @@ DEP_LD_FLAGS="-L${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/lib $FFMPEG_EXTRA_LD_FLAGS" --cxx=${FAM_CXX} \ --ld=${FAM_LD} \ --ar=${FAM_AR} \ - --as=${FAM_AS} \ + --as=${FAM_CC} \ --nm=${FAM_NM} \ --ranlib=${FAM_RANLIB} \ --strip=${FAM_STRIP} \ diff --git a/scripts/libvpx/build.sh b/scripts/libvpx/build.sh index 7005f61..c0b1372 100755 --- a/scripts/libvpx/build.sh +++ b/scripts/libvpx/build.sh @@ -1,21 +1,21 @@ #!/usr/bin/env bash -#Use --cpu - -#Try x-android-gcc with manual CC, CXX and other +VPX_AS=${FAM_AS} case $ANDROID_ABI in x86) - EXTRA_BUILD_FLAGS="--enable-sse2 --enable-sse3 --enable-ssse3" + EXTRA_BUILD_FLAGS="--target=x86-android-gcc --disable-sse4_1 --disable-avx --disable-avx2 --disable-avx512" + VPX_AS=${FAM_YASM} ;; x86_64) - EXTRA_BUILD_FLAGS="--enable-sse2 --enable-sse3 --enable-ssse3 --enable-sse4_1" + EXTRA_BUILD_FLAGS="--target=x86_64-android-gcc --disable-avx --disable-avx2 --disable-avx512" + VPX_AS=${FAM_YASM} ;; armeabi-v7a) - EXTRA_BUILD_FLAGS="--enable-thumb --enable-neon --enable-neon-asm" + EXTRA_BUILD_FLAGS="--target=armv7-android-gcc" ;; arm64-v8a) - EXTRA_BUILD_FLAGS="--enable-thumb --enable-neon --enable-neon-asm" + EXTRA_BUILD_FLAGS="--target=arm64-android-gcc" ;; esac @@ -23,13 +23,12 @@ CC=${FAM_CC} \ CXX=${FAM_CXX} \ AR=${FAM_AR} \ LD=${FAM_LD} \ -AS=${FAM_AS} \ +AS=${VPX_AS} \ STRIP=${FAM_STRIP} \ NM=${FAM_NM} \ ./configure \ ${EXTRA_BUILD_FLAGS} \ --prefix=${INSTALL_DIR} \ - --target=generic-gnu \ --libc=${SYSROOT_PATH} \ --enable-pic \ --enable-realtime-only \