2hamed
2hamed

Reputation: 9047

Failing to build ffmpeg for Android

I'm trying build the ffmpeg sources for Android using two different approaches:

  1. https://yesimroy.gitbooks.io/android-note/content/compile_ffmpeg_for_android.html
  2. https://github.com/Khang-NT/ffmpeg-binary-android

The problem here is that I am facing a somewhat similar problem in both the approaches so I guess the problem lies not with those scripts but there is some thing off in my environment. Here are the outputs of both build scripts:

For approach #1:

/home/hamed/dev/android-tools/android-sdk-linux/ndk-bundle/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/i686-linux-android-gcc is unable to create an executable file.
C compiler test failed.

If you think configure made a mistake, make sure you are using the latest
version from Git.  If the latest version fails, report the problem to the
[email protected] mailing list or IRC #ffmpeg on irc.freenode.net.
Include the log file "conflog.txt" produced by configure as this will help
solve the problem.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:90: /libavutil/Makefile: No such file or directory
Makefile:90: /ffbuild/library.mak: No such file or directory
Makefile:92: /fftools/Makefile: No such file or directory
Makefile:93: /doc/Makefile: No such file or directory
Makefile:94: /doc/examples/Makefile: No such file or directory
Makefile:159: /tests/Makefile: No such file or directory
make: *** No rule to make target '/tests/Makefile'.  Stop.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:90: /libavutil/Makefile: No such file or directory
Makefile:90: /ffbuild/library.mak: No such file or directory
Makefile:92: /fftools/Makefile: No such file or directory
Makefile:93: /doc/Makefile: No such file or directory
Makefile:94: /doc/examples/Makefile: No such file or directory
Makefile:159: /tests/Makefile: No such file or directory
make: *** No rule to make target '/tests/Makefile'.  Stop.
Makefile:2: ffbuild/config.mak: No such file or directory
Makefile:40: /tools/Makefile: No such file or directory
Makefile:41: /ffbuild/common.mak: No such file or directory
Makefile:90: /libavutil/Makefile: No such file or directory
Makefile:90: /ffbuild/library.mak: No such file or directory
Makefile:92: /fftools/Makefile: No such file or directory
Makefile:93: /doc/Makefile: No such file or directory
Makefile:94: /doc/examples/Makefile: No such file or directory
Makefile:159: /tests/Makefile: No such file or directory
make: *** No rule to make target '/tests/Makefile'.  Stop.
Android X86 builds finished

And for approach #2:

checking how to print strings... printf
checking for style of include used by make... GNU
checking for arm-linux-androideabi-gcc... /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
checking whether the C compiler works... no
configure: error: in `/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/opus-1.1.5':
configure: error: C compiler cannot create executables

I even tried redownloading the NDK fearing that the gcc compiler was corrupt but still the same error line appears.

And this is the config.log file from the OPUS module of the second approach:

This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by opus configure 1.1.5, which was
generated by GNU Autoconf 2.69.  Invocation command line was

  $ ./configure -v --prefix=/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir --host=arm-linux-androideabi --enable-static --disable-shared --disable-doc --disable-extra-programs

## --------- ##
## Platform. ##
## --------- ##

hostname = putech-laptop
uname -m = x86_64
uname -r = 4.15.0-36-generic
uname -s = Linux
uname -v = #39-Ubuntu SMP Mon Sep 24 16:19:09 UTC 2018

/usr/bin/uname -p = unknown
/bin/uname -X     = unknown

/bin/arch              = unknown
/usr/bin/arch -k       = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo      = unknown
/bin/machine           = unknown
/usr/bin/oslevel       = unknown
/bin/universe          = unknown

PATH: /home/hamed/.local/bin
PATH: /home/hamed/.local/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
PATH: /usr/local/games
PATH: /snap/bin
PATH: /home/hamed/dev/go/bin
PATH: /home/hamed/dev/android-tools/android-sdk-linux/platform-tools/
PATH: /home/hamed/dev/go/bin
PATH: /home/hamed/dev/android-tools/android-sdk-linux/platform-tools/
PATH: /home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir/bin/


## ----------- ##
## Core tests. ##
## ----------- ##

configure:2354: checking whether make supports nested variables
configure:2371: result: yes
configure:2437: checking for a BSD-compatible install
configure:2505: result: /usr/bin/install -c
configure:2516: checking whether build environment is sane
configure:2571: result: yes
configure:2630: checking for arm-linux-androideabi-strip
configure:2657: result: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip
configure:2722: checking for a thread-safe mkdir -p
configure:2761: result: /bin/mkdir -p
configure:2768: checking for gawk
configure:2798: result: no
configure:2768: checking for mawk
configure:2784: found /usr/bin/mawk
configure:2795: result: mawk
configure:2806: checking whether make sets $(MAKE)
configure:2828: result: yes
configure:2953: checking whether to enable maintainer-specific portions of Makefiles
configure:2962: result: yes
configure:2980: checking build system type
configure:2994: result: x86_64-unknown-linux-gnu
configure:3014: checking host system type
configure:3027: result: arm-unknown-linux-androideabi
configure:3099: checking how to print strings
configure:3126: result: printf
configure:3159: checking for style of include used by make
configure:3187: result: GNU
configure:3218: checking for arm-linux-androideabi-gcc
configure:3245: result: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
configure:3514: checking for C compiler version
configure:3523: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc --version >&5
Android (4751641 based on r328903) clang version 7.0.2 (https://android.googlesource.com/toolchain/clang 003100370607242ddd5815e4a043907ea9004281) (https://android.googlesource.com/toolchain/llvm 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
Target: arm--linux-android
Thread model: posix
InstalledDir: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../../../../llvm/prebuilt/linux-x86_64/bin
configure:3534: $? = 0
configure:3523: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -v >&5
Android (4751641 based on r328903) clang version 7.0.2 (https://android.googlesource.com/toolchain/clang 003100370607242ddd5815e4a043907ea9004281) (https://android.googlesource.com/toolchain/llvm 1d739ffb0366421d383e04ff80ec2ee591315116) (based on LLVM 7.0.2svn)
Target: arm--linux-android
Thread model: posix
InstalledDir: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../../../../llvm/prebuilt/linux-x86_64/bin
configure:3534: $? = 0
configure:3523: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3534: $? = 1
configure:3523: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -qversion >&5
clang: error: unknown argument '-qversion', did you mean '--version'?
clang: error: no input files
configure:3534: $? = 1
configure:3554: checking whether the C compiler works
configure:3576: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -mfloat-abi=softfp -marm -march=armv7-a -Os -O3   -I/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir/include --sysroot=/home/hamed/dev/android-tools/android-ndk-r18/platforms/android-16/arch-arm/ -fPIE  --sysroot=/home/hamed/dev/android-tools/android-ndk-r18/platforms/android-16/arch-arm/  -L/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir/lib -fPIE -pie  conftest.c  >&5
/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)
configure:3580: $? = 1
configure:3618: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "opus"
| #define PACKAGE_TARNAME "opus"
| #define PACKAGE_VERSION "1.1.5"
| #define PACKAGE_STRING "opus 1.1.5"
| #define PACKAGE_BUGREPORT "[email protected]"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
| 
| int
| main ()
| {
| 
|   ;
|   return 0;
| }
configure:3623: error: in `/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/opus-1.1.5':
configure:3625: error: C compiler cannot create executables
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=x86_64-unknown-linux-gnu
ac_cv_env_ARM_NEON_INTR_CFLAGS_set=
ac_cv_env_ARM_NEON_INTR_CFLAGS_value=
ac_cv_env_CCASFLAGS_set=
ac_cv_env_CCASFLAGS_value=
ac_cv_env_CCAS_set=
ac_cv_env_CCAS_value=
ac_cv_env_CC_set=set
ac_cv_env_CC_value=/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-mfloat-abi=softfp -marm -march=armv7-a -Os -O3   -I/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir/include --sysroot=/home/hamed/dev/android-tools/android-ndk-r18/platforms/android-16/arch-arm/ -fPIE '
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value='--sysroot=/home/hamed/dev/android-tools/android-ndk-r18/platforms/android-16/arch-arm/ '
ac_cv_env_CPP_set=set
ac_cv_env_CPP_value=/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-cpp
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-L/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir/lib -fPIE -pie '
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_LT_SYS_LIBRARY_PATH_set=
ac_cv_env_LT_SYS_LIBRARY_PATH_value=
ac_cv_env_X86_AVX_CFLAGS_set=
ac_cv_env_X86_AVX_CFLAGS_value=
ac_cv_env_X86_SSE2_CFLAGS_set=
ac_cv_env_X86_SSE2_CFLAGS_value=
ac_cv_env_X86_SSE4_1_CFLAGS_set=
ac_cv_env_X86_SSE4_1_CFLAGS_value=
ac_cv_env_X86_SSE_CFLAGS_set=
ac_cv_env_X86_SSE_CFLAGS_value=
ac_cv_env_build_alias_set=
ac_cv_env_build_alias_value=
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=arm-linux-androideabi
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=arm-unknown-linux-androideabi
ac_cv_path_install='/usr/bin/install -c'
ac_cv_path_mkdir=/bin/mkdir
ac_cv_prog_AWK=mawk
ac_cv_prog_CC=/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
ac_cv_prog_STRIP=/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip
ac_cv_prog_make_make_set=yes
am_cv_make_support_nested_variables=yes

## ----------------- ##
## Output variables. ##
## ----------------- ##

ACLOCAL='${SHELL} /home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/opus-1.1.5/missing aclocal-1.15'
AMDEPBACKSLASH='\'
AMDEP_FALSE='#'
AMDEP_TRUE=''
AMTAR='$${TAR-tar}'
AM_BACKSLASH='\'
AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
AM_DEFAULT_VERBOSITY='0'
AM_V='$(V)'
AR='/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar'
ARM2GNU_PARAMS=''
ARM_NEON_INTR_CFLAGS=''
AUTOCONF='${SHELL} /home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/opus-1.1.5/missing autoconf'
AUTOHEADER='${SHELL} /home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/opus-1.1.5/missing autoheader'
AUTOMAKE='${SHELL} /home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/opus-1.1.5/missing automake-1.15'
AWK='mawk'
CC='/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc'
CCAS=''
CCASDEPMODE=''
CCASFLAGS=''
CCDEPMODE=''
CFLAGS='-mfloat-abi=softfp -marm -march=armv7-a -Os -O3   -I/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir/include --sysroot=/home/hamed/dev/android-tools/android-ndk-r18/platforms/android-16/arch-arm/ -fPIE '
CPP='/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-cpp'
CPPFLAGS='--sysroot=/home/hamed/dev/android-tools/android-ndk-r18/platforms/android-16/arch-arm/ '
CPU_ARM_FALSE=''
CPU_ARM_TRUE=''
CUSTOM_MODES_FALSE=''
CUSTOM_MODES_TRUE=''
CYGPATH_W='echo'
DEFS=''
DEPDIR='.deps'
DISABLE_FLOAT_API_FALSE=''
DISABLE_FLOAT_API_TRUE=''
DLLTOOL=''
DSYMUTIL=''
DUMPBIN=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
EXEEXT=''
EXTRA_PROGRAMS_FALSE=''
EXTRA_PROGRAMS_TRUE=''
FGREP=''
FIXED_POINT_FALSE=''
FIXED_POINT_TRUE=''
GREP=''
HAVE_ARM_NE10=''
HAVE_ARM_NE10_FALSE=''
HAVE_ARM_NE10_TRUE=''
HAVE_ARM_NEON_INTR_FALSE=''
HAVE_ARM_NEON_INTR_TRUE=''
HAVE_AVX_FALSE=''
HAVE_AVX_TRUE=''
HAVE_DOXYGEN=''
HAVE_DOXYGEN_FALSE=''
HAVE_DOXYGEN_TRUE=''
HAVE_PERL=''
HAVE_SSE2_FALSE=''
HAVE_SSE2_TRUE=''
HAVE_SSE4_1_FALSE=''
HAVE_SSE4_1_TRUE=''
HAVE_SSE_FALSE=''
HAVE_SSE_TRUE=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL}'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM='$(install_sh) -c -s'
LD='/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld'
LDFLAGS='-L/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir/lib -fPIE -pie '
LIBM=''
LIBOBJS=''
LIBS=''
LIBTOOL=''
LIPO=''
LN_S=''
LTLIBOBJS=''
LT_SYS_LIBRARY_PATH=''
MAINT=''
MAINTAINER_MODE_FALSE='#'
MAINTAINER_MODE_TRUE=''
MAKEINFO='${SHELL} /home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/opus-1.1.5/missing makeinfo'
MANIFEST_TOOL=''
MKDIR_P='/bin/mkdir -p'
NE10_CFLAGS=''
NE10_LIBS=''
NM='/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm'
NMEDIT=''
OBJDUMP=''
OBJEXT=''
OPUS_ARM_EXTERNAL_ASM_FALSE=''
OPUS_ARM_EXTERNAL_ASM_TRUE=''
OPUS_ARM_INLINE_ASM_FALSE=''
OPUS_ARM_INLINE_ASM_TRUE=''
OPUS_ARM_MAY_HAVE_EDSP=''
OPUS_ARM_MAY_HAVE_MEDIA=''
OPUS_ARM_MAY_HAVE_NEON=''
OPUS_ARM_NEON_INTR_CFLAGS=''
OPUS_HAVE_RTCD=''
OPUS_LT_AGE='5'
OPUS_LT_CURRENT='5'
OPUS_LT_REVISION='5'
OPUS_X86_AVX_CFLAGS=''
OPUS_X86_SSE2_CFLAGS=''
OPUS_X86_SSE4_1_CFLAGS=''
OPUS_X86_SSE_CFLAGS=''
OTOOL64=''
OTOOL=''
PACKAGE='opus'
PACKAGE_BUGREPORT='[email protected]'
PACKAGE_NAME='opus'
PACKAGE_STRING='opus 1.1.5'
PACKAGE_TARNAME='opus'
PACKAGE_URL=''
PACKAGE_VERSION='1.1.5'
PATH_SEPARATOR=':'
PC_BUILD=''
RANLIB='/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib'
SED=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP='/home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-strip'
VERSION='1.1.5'
X86_AVX_CFLAGS=''
X86_SSE2_CFLAGS=''
X86_SSE4_1_CFLAGS=''
X86_SSE_CFLAGS=''
ac_ct_AR=''
ac_ct_CC=''
ac_ct_DUMPBIN=''
am__EXEEXT_FALSE=''
am__EXEEXT_TRUE=''
am__fastdepCCAS_FALSE=''
am__fastdepCCAS_TRUE=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__include='include'
am__isrc=''
am__leading_dot='.'
am__nodep='_no'
am__quote=''
am__tar='$${TAR-tar} chof - "$$tardir"'
am__untar='$${TAR-tar} xf -'
bindir='${exec_prefix}/bin'
build='x86_64-unknown-linux-gnu'
build_alias=''
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='unknown'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
dvidir='${docdir}'
exec_prefix='NONE'
host='arm-unknown-linux-androideabi'
host_alias='arm-linux-androideabi'
host_cpu='arm'
host_os='linux-androideabi'
host_vendor='unknown'
htmldir='${docdir}'
includedir='${prefix}/include'
infodir='${datarootdir}/info'
install_sh='${SHELL} /home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/opus-1.1.5/install-sh'
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
mandir='${datarootdir}/man'
mkdir_p='$(MKDIR_P)'
oldincludedir='/usr/include'
pdfdir='${docdir}'
prefix='/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir'
program_transform_name='s,x,x,'
psdir='${docdir}'
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
sysconfdir='${prefix}/etc'
target_alias=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

/* confdefs.h */
#define PACKAGE_NAME "opus"
#define PACKAGE_TARNAME "opus"
#define PACKAGE_VERSION "1.1.5"
#define PACKAGE_STRING "opus 1.1.5"
#define PACKAGE_BUGREPORT "[email protected]"
#define PACKAGE_URL ""

configure: exit 77

Upvotes: 4

Views: 3090

Answers (1)

Dan Albert
Dan Albert

Reputation: 10499

As you can see from the log, the gcc binaries in NDK r18 are not GCC; they're Clang. GCC has not been supported in the NDK for a few years now and was finally removed in NDK r18. To maintain some compatibility for cases where the project built fine with Clang but simply hadn't updated their build scripts, we keep around some scripts named gcc that simply invoke Clang with the right set of arguments.

configure:3576: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -mfloat-abi=softfp -marm -march=armv7-a -Os -O3   -I/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir/include --sysroot=/home/hamed/dev/android-tools/android-ndk-r18/platforms/android-16/arch-arm/ -fPIE  --sysroot=/home/hamed/dev/android-tools/android-ndk-r18/platforms/android-16/arch-arm/  -L/home/hamed/dev/projects/ffmpeg/ffmpeg-binary-android/build_scripts/build_dir/lib -fPIE -pie  conftest.c  >&5
/usr/bin/ld: unrecognised emulation mode: armelf_linux_eabi
Supported emulations: elf_x86_64 elf32_x86_64 elf_i386 elf_iamcu i386linux elf_l1om elf_k1om i386pep i386pe
clang: error: linker command failed with exit code 1 (use -v to see invocation)

The bug here is that those wrapper scripts don't include -gcc-toolchain like they need to. I've just filed https://github.com/android-ndk/ndk/issues/805 to track this.

However, even with this fixed, it looks like this project won't build anyway:

configure:3523: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -V >&5
clang: error: argument to '-V' is missing (expected 1 value)
clang: error: no input files
configure:3534: $? = 1
configure:3523: /home/hamed/dev/android-tools/android-ndk-r18/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -qversion >&5
clang: error: unknown argument '-qversion', did you mean '--version'?
clang: error: no input files

I'm not sure if that's the build scripts you're using causing that or if it's the autoconf system used by ffmpeg, but something here needs to be fixed if it's going to work with NDK r18. The best option is probably to use a standalone toolchain.

Otherwise, you'll need to either fix the project to build with Clang or revert to an older NDK.

Upvotes: 5

Related Questions