Android Compiling Error "C compiler cannot create executables"
#1
Im trying to compile an modified kodi with mfc-hwdecoder for android and running in this error:

Code:
test -z "/home/fleixi/kodi_android/xbmc-depends/x86_64-linux-gnu-native/bin" || /bin/mkdir -p "/home/fleixi/kodi_android/xbmc-depends/x86_64-linux-gnu-native/bin"
  /usr/bin/install -c JsonSchemaBuilder '/home/fleixi/kodi_android/xbmc-depends/x86_64-linux-gnu-native/bin'
make[4]: Nothing to be done for 'install-data-am'.
make[4]: Leaving directory '/home/fleixi/kodi_android/kodi_mfc/tools/depends/native/JsonSchemaBuilder/x86_64-linux-gnu-native'
make[3]: Leaving directory '/home/fleixi/kodi_android/kodi_mfc/tools/depends/native/JsonSchemaBuilder/x86_64-linux-gnu-native'
touch .installed-x86_64-linux-gnu-native
make[2]: Leaving directory '/home/fleixi/kodi_android/kodi_mfc/tools/depends/native/JsonSchemaBuilder'
Dependencies built successfully.
make[1]: Leaving directory '/home/fleixi/kodi_android/kodi_mfc/tools/depends/native'
make -C target
make[1]: Entering directory '/home/fleixi/kodi_android/kodi_mfc/tools/depends/target'
make -C pcre
make[2]: Entering directory '/home/fleixi/kodi_android/kodi_mfc/tools/depends/target/pcre'
rm -rf arm-linux-androidabi-android-14/*; mkdir -p arm-linux-androidabi-android-14
cd arm-linux-androidabi-android-14; /bin/tar --strip-components=1 -xf /home/fleixi/kodi_android/xbmc-depends/xbmc-tarballs/pcre-8.33.tar.gz
cd arm-linux-androidabi-android-14; cp -f /home/fleixi/kodi_android/xbmc-depends/x86_64-linux-gnu-native/share/automake-1.11/config.sub /home/fleixi/kodi_android/xbmc-depends/x86_64-linux-gnu-native/share/automake-1.11/config.guess .; ./configure --prefix=/home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14 --disable-shared --disable-stack-for-recursion --enable-pcre8 --disable-pcre16 --disable-pcre32 --enable-jit --enable-utf --enable-unicode-properties --enable-newline-is-anycrlf
configure: loading site script /home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14/share/config.site
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for strip... /usr/bin/strip
configure: WARNING: using cross tools not prefixed with host triplet
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for gcc... /usr/bin/gcc
checking whether the C compiler works... no
configure: error: in `/home/fleixi/kodi_android/kodi_mfc/tools/depends/target/pcre/arm-linux-androidabi-android-14':
configure: error: C compiler cannot create executables
See `config.log' for more details
Makefile:27: recipe for target 'arm-linux-androidabi-android-14' failed
make[2]: *** [arm-linux-androidabi-android-14] Error 77
make[2]: Leaving directory '/home/fleixi/kodi_android/kodi_mfc/tools/depends/target/pcre'
Makefile:110: recipe for target 'pcre' failed
make[1]: *** [pcre] Error 2
make[1]: Leaving directory '/home/fleixi/kodi_android/kodi_mfc/tools/depends/target'
Makefile:11: recipe for target 'target/.installed-arm-linux-androidabi-android-14' failed
make: *** [target/.installed-arm-linux-androidabi-android-14] Error 2

config.log:

Code:
....

Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.9.2-10ubuntu13' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.9.2 (Ubuntu 4.9.2-10ubuntu13)
configure:3756: $? = 0
configure:3745: /usr/bin/gcc -V >&5
gcc: error: unrecognized command line option '-V'
gcc: fatal error: no input files
compilation terminated.
configure:3756: $? = 4
configure:3745: /usr/bin/gcc -qversion >&5
gcc: error: unrecognized command line option '-qversion'
gcc: fatal error: no input files
compilation terminated.
configure:3756: $? = 4
configure:3776: checking whether the C compiler works
configure:3798: /usr/bin/gcc -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon  -I/home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14/include/android-14 -isystem /home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14/include  -DANDROID -Os -fexceptions -march=armv7-a -mtune=cortex-a9 -mfloat-abi=softfp -mfpu=neon  -I/home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14/include/android-14 -isystem /home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14/include  -L/home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14/lib -L/home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14/lib/android-14    conftest.c  >&5
gcc: error: unrecognized command line option '-mfloat-abi=softfp'
gcc: error: unrecognized command line option '-mfpu=neon'
gcc: error: unrecognized command line option '-mfloat-abi=softfp'
gcc: error: unrecognized command line option '-mfpu=neon'
configure:3802: $? = 1
configure:3840: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "PCRE"
| #define PACKAGE_TARNAME "pcre"
| #define PACKAGE_VERSION "8.33"
| #define PACKAGE_STRING "PCRE 8.33"
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| #define PACKAGE "pcre"
| #define VERSION "8.33"
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|   ;
|   return 0;
| }
configure:3845: error: in `/home/fleixi/kodi_android/kodi_mfc/tools/depends/target/pcre/arm-linux-androidabi-android-14':
configure:3847: error: C compiler cannot create executables
See `config.log' for more details

.....

My setup:

Code:
drwxrwxr-x  7 fleixi fleixi      4096 Jun  7 12:30 .
drwxr-xr-x 19 fleixi fleixi      4096 Jun  5 21:53 ..
drwxr-x--- 10 fleixi fleixi      4096 Apr  7 13:33 android-ndk-r10e
-rwxr-xr-x  1 fleixi fleixi 401522849 Jun  5 20:32 android-ndk-r10e-linux-x86_64.bin
drwxrwxr-x  8 fleixi fleixi      4096 Jun  7 00:07 android-sdk-linux
-rwxr-xr-x  1 fleixi fleixi 168119905 Jun  5 20:29 android-sdk_r24.2-linux.tar
drwxrwxr-x  3 fleixi fleixi      4096 Jun  7 00:11 android-toolchain-x86
drwxrwxr-x 18 fleixi fleixi      4096 Jun  7 12:27 kodi_mfc
drwxrwxr-x  5 fleixi fleixi      4096 Jun  7 12:30 xbmc-depends

Code:
./configure --host=arm-linux-androidabi --with-toolchain=/home/fleixi/kodi_android/android-toolchain-x86/android-17 --with-ndk=/home/fleixi/kodi_android/android-ndk-r10e --with-sdk-path=/home/fleixi/kodi_android/android-sdk-linux  --prefix=/home/fleixi/kodi_android/xbmc-depends

Output:

checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androidabi
checking for unzip... yes
checking for zip... yes
checking for curl... /usr/bin/curl
checking for tar... /bin/tar
checking for arm-linux-androidabi-ranlib... no
checking for ranlib... /usr/bin/ranlib
configure: WARNING: using cross tools not prefixed with host triplet
checking for arm-linux-androidabi-ld... no
checking for ld... /usr/bin/ld
checking for arm-linux-androidabi-ar... no
checking for ar... /usr/bin/ar
checking for arm-linux-androidabi-readelf... no
checking for readelf... /usr/bin/readelf
checking for arm-linux-androidabi-strip... no
checking for strip... /usr/bin/strip
checking for arm-linux-androidabi-as... no
checking for as... /usr/bin/as
checking for arm-linux-androidabi-nm... no
checking for nm... /usr/bin/nm
checking for arm-linux-androidabi-objdump... no
checking for objdump... /usr/bin/objdump
checking for arm-linux-androidabi-gcc... no
checking for gcc... /usr/bin/gcc
checking for arm-linux-androidabi-g++... no
checking for g++... /usr/bin/g++
checking for arm-linux-androidabi-gcc... /usr/bin/gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /usr/bin/gcc accepts -g... yes
checking for /usr/bin/gcc option to accept ISO C89... none needed
checking how to run the C preprocessor... /usr/bin/gcc -E
checking for ranlib... /usr/bin/ranlib
checking for ld... /usr/bin/ld
checking for ar... /usr/bin/ar
checking for readelf... /usr/bin/readelf
checking for strip... /usr/bin/strip
checking for as... /usr/bin/as
checking for nm... /usr/bin/nm
checking for objdump... /usr/bin/objdump
checking for gcc... /usr/bin/gcc
checking for g++... /usr/bin/g++
checking for main in -lz... yes
checking for library containing iconv_open... none required
checking for main in -lcrystax... no
checking for aapt... /home/fleixi/kodi_android/android-sdk-linux/build-tools/23.0.0_rc2/aapt
checking for dx... /home/fleixi/kodi_android/android-sdk-linux/build-tools/23.0.0_rc2/dx
checking for zipalign... /home/fleixi/kodi_android/android-sdk-linux/build-tools/23.0.0_rc2/zipalign


configure: creating ./config.status
config.status: creating target/config.site
config.status: creating native/config.site.native
config.status: creating Makefile.include
config.status: creating target/Toolchain.cmake
toolchain:       /home/fleixi/kodi_android/android-toolchain-x86/android-17
cpu:             armeabi-v7a
host:            arm-linux-androidabi
sdk-platform:    android-14
'target/config.site' -> '/home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14/share/config.site'
'target/Toolchain.cmake' -> '/home/fleixi/kodi_android/xbmc-depends/arm-linux-androidabi-android-14/share/Toolchain.cmake'
'native/config.site.native' -> '/home/fleixi/kodi_android/xbmc-depends/x86_64-linux-gnu-native/share/config.site'



I have followed the README.android with build-tools 23.0.0_r2

Im using an x86_64 Ubuntu 15.05 for crosscompiling and no root or sudo is involded.
Reply
#2
Your configure line for depends is wrong. Not sure if you want to build for android-x86 or android-arm. Those are the corresponding lines from our jenkins buildserver (you need to adapt this with your pathes obviously):


for arm:

Code:
./configure --with-tarballs=/home/jenkins/xbmc-tarballs --host=arm-linux-androideabi --with-sdk-path=/home/jenkins/android-dev/android-sdk-linux --with-ndk=/home/jenkins/android-dev//android-ndk-r10d --with-sdk=android-17 --with-toolchain=/home/jenkins/android-dev//android-toolchain-arm-17-r10d --prefix=/home/jenkins/workspace/Android-ARM/tools/depends/xbmc-depends --enable-neon

for x86:

Code:
./configure --with-tarballs=/home/jenkins/xbmc-tarballs --host=i686-linux-android --with-sdk-path=/home/jenkins/android-dev/android-sdk-linux --with-ndk=/home/jenkins/android-dev//android-ndk-r10d --with-sdk=android-17 --with-toolchain=/home/jenkins/android-dev//android-toolchain-x86-17-r10d --prefix=/home/jenkins/workspace/Android-X86/tools/depends/xbmc-depends

You are missing the --host and --with-sdk options on yours at the least.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#3
and
Quote:./configure --host=arm-linux-androidabi ...

means you are configuring for ARM, but you don't have an arm toolchain installed.
Reply
#4
I'm having similar problems. Below is my setup for the toolchain, my build process and config.log and the tail end of my log file but can provide the entire log file if interested.
--my build
#!/bin/bash

export KODI_HOME=/home/spart/xbmc-master
export PREFIX=${KODI_HOME}/xbmc-depends
export NDK_HOME=/home/spart/Android/android-ndk-r12
export SDK_HOME=/home/spart/Android/Sdk/

cd ${KODI_HOME}/tools/depends
#git clean -xfd
#git reset --hard
#git pull --rebase
make distclean

./bootstrap
echo "done bootstraping about to configure"

./configure \
--with-toolchain=${NDK_HOME}/toolchains/arm-linux-androideabi-4.9/android-24 \
--with-ndk=${NDK_HOME} \
--with-sdk-path=${SDK_HOME} \
--prefix=${PREFIX} \
--host=arm-linux-androideabi \
--with-sdk=android-24
--enable-neon

echo "done configuring about to make"

export PATH=/usr/bin/:$PATH
make
echo "done make"

#make -C tools/depends/target/xbmc
#echo "done make -C tools/depends/target/xbmc about to make apk"

#make apk
#echo "done make apk"
--creating my toolchain
./make-standalone-toolchain.sh --ndk-dir=../../ \
--install-dir=/home/spart/Android/android-ndk-r12/toolchains/arm-linux-androideabi-4.9/android-24 --platform=android-24 \
--toolchain=arm-linux-androideabi-4.9

---config.log from xbmc-master
http://pastebin.com/EFPTFDmd

--tail end of the output from the console is
http://pastebin.com/azrE4ivK

--tail end of the log file created when I redirect output to a log file(couldn't past the entire log file since it exceeded the max size).
http://pastebin.com/jmzJzBH5
Reply
#5
Use pastebin.com for the log and remove it from the forum
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#6
Any chance you might know why the master branch seems to be having these problems? Let me know if you come up with any good ideas Martijn. Smile
Reply
#7
kodi doesn't see your toolchain at all. Make sure paths are correct are the ndk is working
Reply
#8
You're right, I've updated my build script above in my original post to the correct path, missing a forward slash. The NDK does seem to be working since I'm able to create a toolchain. Thank you.

By the way, how did you know it was the toolchain that was causing issues? Were you able to see something wrong with the toolchain from the config.log? The reason I ask is because it was an issue which was not apparent to me.

I am now getting a fatal error due to localealias.c but was wondering if this has been a known issue or what you would recommend: compiling kodi for android using xbmc-master. What operating system would you recommend? I'm running what is recommended on the readme but I'm using kodi master with the latest sdk and ndk.

./localealias.c:31:24: fatal error: stdio_ext.h: No such file or directory

tail end from the console
http://pastebin.com/rBTd2seP

my console.log
http://pastebin.com/kcNmEYbk

tail end of my log file
http://pastebin.com/4aqyeSpa

Thank you for all your help. If I can get this to build I think I may save countless others some time by updating the compilation notes that way they are up to date. Any help is greatly appreciated.

Thank you. Smile
Reply
#9
Have a look into docs/README.android - i doubt it states that you should use ndk r12 ...
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#10
r12 also had big changes and we don't use platform-24 yet. So RTFM Smile

If you do get it to work please tell us how and send the code changes.
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#11
from README.ANDROID
[NOTICE] Compiling Kodi for Android requires Android NDK
Revision at least 10e. For the SDK just use the latest available.
It will work.

I'm trying to get it to work with correctly with kodi and would not mind supplying any changes I've made.
Reply
#12
MrMC is at android-ndk-r11b with android-21

The _OFF_T_DEFINED_ trick for SMB vanished and has to be put back

You might browse the mrmc github for other changes in depends and elsewhere.

When we move to android-ndk-r12, we will also be switching to clang.
MrMC Forums : http://forum.mrmc.tv
Reply
#13
Yes, I noticed clang being moved to in the more recent versions. A couple of concerns I have is why hasn't kodi been updated to handle the latest ndk, sdk, and jdk? They all seem to be interconnected.

Another questions, if you look at the android.jar MANIFEST.MF file created in the sdk for platform 17 you will notice they were Created-By: 1.6.0_45 (Sun Microsystems Inc.): I mention this because the kodi instructions use open jdk( in theory shouldn't make a huge difference) but I would imagine using the same jdk to do what you want it do for the ndk, sdk, and kodi would make a lot of sense. I have nothing against the openJDK effort in fact it has some very advanced features from a JDK perspective which are not in the oracle JDK. That being the case I would think that it would be a wise idea to have a build which could work with the latest ndk, sdk, and kodi: while using the preferred JDK for all three. Most of those platforms including the jdk have made significant improvements from a performance perspective. The latest SDK recommends using the oracle JDK 8.
Reply
#14
The simple reason is time. So if you are willing to do some work on it we would be very grateful if you could send us the changes on github
Read/follow the forum rules.
For troubleshooting and bug reporting, read this first
Interested in seeing some YouTube videos about Kodi? Go here and subscribe
Reply
#15
Okay, I'm willing to do this but may need some help. Also, the readme all specifies open jdk 6 for platform 17, has anyone gotten it to work with an oracle jdk?
Reply

Logout Mark Read Team Forum Stats Members Help
Compiling Error "C compiler cannot create executables"0