From a582eae29ac91ee5208ac73e8d961238db0a6239 Mon Sep 17 00:00:00 2001 From: Javernaut Date: Mon, 20 Apr 2020 17:57:30 +0300 Subject: [PATCH] Using clang instead of llvm-as as a workaround --- scripts/export-build-variables.sh | 8 ++++---- scripts/ffmpeg/build.sh | 7 ++++++- scripts/parse-arguments.sh | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/scripts/export-build-variables.sh b/scripts/export-build-variables.sh index 963c234..304ab54 100755 --- a/scripts/export-build-variables.sh +++ b/scripts/export-build-variables.sh @@ -66,7 +66,6 @@ export CROSS_PREFIX_WITH_PATH=${TOOLCHAIN_PATH}/bin/${CROSS_PREFIX} # The FAM_ prefix is used to eliminate passing those values implicitly to build systems export FAM_ADDR2LINE=${CROSS_PREFIX_WITH_PATH}addr2line export FAM_AR=${CROSS_PREFIX_WITH_PATH}ar -export FAM_AS=${CROSS_PREFIX_WITH_PATH}as export FAM_NM=${CROSS_PREFIX_WITH_PATH}nm export FAM_OBJCOPY=${CROSS_PREFIX_WITH_PATH}objcopy export FAM_OBJDUMP=${CROSS_PREFIX_WITH_PATH}objdump @@ -80,12 +79,13 @@ export TARGET=${TARGET_TRIPLE_MACHINE_CC}-linux-${TARGET_TRIPLE_OS}${ANDROID_PLA # The name for compiler is slightly different, so it is defined separatly. export FAM_CC=${TOOLCHAIN_PATH}/bin/${TARGET}-clang export FAM_CXX=${FAM_CC}++ +export FAM_LD=${FAM_CC} if [ $DESIRED_BINUTILS = "gnu" ] ; then - export FAM_LD=${CROSS_PREFIX_WITH_PATH}ld + export FAM_AS=${CROSS_PREFIX_WITH_PATH}as else - # If desired binutils has to be 'llvm', then use clang as linker. - export FAM_LD=${FAM_CC} + # The llvm-as stucks in the beginning of FFmpeg's configure script, so use clang + export FAM_AS=${FAM_CC} fi # TODO consider abondaning this strategy of defining the name of the clang wrapper diff --git a/scripts/ffmpeg/build.sh b/scripts/ffmpeg/build.sh index a39dbcf..9457618 100755 --- a/scripts/ffmpeg/build.sh +++ b/scripts/ffmpeg/build.sh @@ -27,9 +27,14 @@ DEP_LD_FLAGS="-L${BUILD_DIR_EXTERNAL}/${ANDROID_ABI}/lib $FFMPEG_EXTRA_LD_FLAGS" --target-os=android \ --arch=${TARGET_TRIPLE_MACHINE_BINUTILS} \ --sysroot=${SYSROOT_PATH} \ - --cross-prefix=${CROSS_PREFIX_WITH_PATH} \ --cc=${FAM_CC} \ + --cxx=${FAM_CXX} \ --ld=${FAM_LD} \ + --ar=${FAM_AR} \ + --as=${FAM_AS} \ + --nm=${FAM_NM} \ + --ranlib=${FAM_RANLIB} \ + --strip=${FAM_STRIP} \ --extra-cflags="-O3 -fPIC $DEP_CFLAGS" \ --extra-ldflags="$DEP_LD_FLAGS" \ --enable-shared \ diff --git a/scripts/parse-arguments.sh b/scripts/parse-arguments.sh index 5756530..ea9f989 100755 --- a/scripts/parse-arguments.sh +++ b/scripts/parse-arguments.sh @@ -55,7 +55,7 @@ for argument in "$@"; do SOURCE_VALUE="${argument#*=}" ;; # Which binutils to use (gnu or llvm) - --binutils=*) + --binutils=*|-binutils=*) binutils_value="${argument#*=}" case $binutils_value in gnu|llvm)