Error When Cross-Compiling with Android NDK
Posted: 2014-03-25T02:35:41-07:00
Hey all. I'm currently cross-compiling all ImageMagick delegate libs with no problem using the Android NDK. However, when I try to do so with IM itself, I'm getting the error "configure: error: cannot run test program while cross compiling". Any ideas?
Code: Select all
[ 90%] Performing configure step for 'ImageMagick'
cd /home/opsteam/vinay/3rdparty/ImageMagick/ImageMagick-6.8.7-8 && env CC=/usr/local/android-ndk-r9-clang/bin/clang "CFLAGS=-O3 -g -DNDEBUG -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -marm -D__ANDROID__ -g -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fno-strict-aliasing -Wa,--noexecstack -Wl,--fix-cortex-a8 -fPIC" AR=/usr/local/android-ndk-r9-clang//bin/arm-linux-androideabi-ar RANLIB=/usr/local/android-ndk-r9-clang//bin/arm-linux-androideabi-ranlib "CFLAGS=-O3 -g -DNDEBUG -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -marm -D__ANDROID__ -g -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fno-strict-aliasing -Wa,--noexecstack -Wl,--fix-cortex-a8 -fPIC" "CXXFLAGS=-O3 -g -DNDEBUG -std=c++11 -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -mthumb -marm -D__ANDROID__ -g -ffunction-sections -funwind-tables -fstack-protector -no-canonical-prefixes -fno-strict-aliasing -Wa,--noexecstack -Wl,--fix-cortex-a8" CPPFLAGS=-I/home/opsteam/vinay/3rdparty/ImageMagick/dist/ImageMagick/include LDFLAGS=-L/home/opsteam/vinay/3rdparty/ImageMagick/dist/ImageMagick/linux "LIBS=-ljpeg -lz -lpng" ./configure --host=arm-linux-androideabi --enable-static --disable-shared --disable-installed --prefix=/home/opsteam/vinay/3rdparty/ImageMagick/build/ImageMagick --without-bzlib --without-djvu --without-dps --without-fftw --without-fpx --without-fontconfig --without-freetype --without-jbig --without-jp2 --without-lcms --without-lcms2 --without-lqr --without-lzma --without-magick-plus-plus --without-openexr --without-pango --without-perl --without-tiff --without-webp --without-x --without-xml
configuring ImageMagick 6.8.7-8
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking target system type... arm-unknown-linux-androideabi
checking whether build environment is sane... yes
checking for a BSD-compatible install... /usr/bin/install -c
checking for arm-linux-androideabi-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
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 arm-linux-androideabi-gcc... /usr/local/android-ndk-r9-clang/bin/clang
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/local/android-ndk-r9-clang/bin/clang accepts -g... yes
checking for /usr/local/android-ndk-r9-clang/bin/clang option to accept ISO C89... none needed
checking whether /usr/local/android-ndk-r9-clang/bin/clang understands -c and -o together... yes
checking dependency style of /usr/local/android-ndk-r9-clang/bin/clang... gcc3
checking how to run the C preprocessor... /usr/local/android-ndk-r9-clang/bin/clang -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for arm-linux-androideabi-gcc... (cached) /usr/local/android-ndk-r9-clang/bin/clang
checking whether we are using the GNU C compiler... (cached) yes
checking whether /usr/local/android-ndk-r9-clang/bin/clang accepts -g... (cached) yes
checking for /usr/local/android-ndk-r9-clang/bin/clang option to accept ISO C89... (cached) none needed
checking whether /usr/local/android-ndk-r9-clang/bin/clang understands -c and -o together... (cached) yes
checking dependency style of /usr/local/android-ndk-r9-clang/bin/clang... (cached) gcc3
checking whether we are using the GNU C++ compiler... yes
checking whether /usr/local/android-ndk-r9-clang//bin/clang++ accepts -g... yes
checking dependency style of /usr/local/android-ndk-r9-clang//bin/clang++... gcc3
checking for /usr/local/android-ndk-r9-clang/bin/clang option to accept ISO C99... none needed
checking for /usr/local/android-ndk-r9-clang/bin/clang option to accept ISO Standard C... (cached) none needed
checking how to run the C preprocessor... /usr/local/android-ndk-r9-clang/bin/clang -E
checking for a sed that does not truncate output... /bin/sed
checking for fgrep... /bin/grep -F
checking how to print strings... printf
checking for ld used by /usr/local/android-ndk-r9-clang/bin/clang... /usr/local/android-ndk-r9-clang/arm-linux-androideabi/bin/ld
checking if the linker (/usr/local/android-ndk-r9-clang/arm-linux-androideabi/bin/ld) is GNU ld... yes
checking for /usr/local/android-ndk-r9-clang/bin/clang option to accept ISO C99... (cached) none needed
checking CFLAGS for maximum warnings... -Wall
checking whether make sets $(MAKE)... (cached) yes
checking whether ln -s works... yes
checking for a sed that does not truncate output... (cached) /bin/sed
checking for gawk... (cached) mawk
checking if malloc debugging is wanted... no
checking for __attribute__... yes
checking for gcc architecture flag...
checking for gcc architecture flag... unknown
checking for arm-linux-androideabi-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
configure: WARNING: using cross tools not prefixed with host triplet
checking pkg-config is at least version 0.9.0... yes
checking if LD -Wl,--version-script works... yes
checking size of size_t... 4
checking for C compiler vendor... clang
checking CFLAGS for maximum warnings... (cached) -Wall
checking for linker lazyload option... none
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... no
checking for /usr/local/android-ndk-r9-clang/bin/clang option to support OpenMP... unsupported
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for PTHREAD_PRIO_INHERIT... (cached) no
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... unknown
checking for _LARGE_FILES value needed for large files... unknown
checking for _LARGEFILE_SOURCE value needed for large files... no
checking for native large file support... configure: error: in `/home/opsteam/vinay/3rdparty/ImageMagick/ImageMagick-6.8.7-8':
configure: error: cannot run test program while cross compiling
See `config.log' for more details
make[6]: *** [ImageMagick-prefix/src/ImageMagick-stamp/ImageMagick-configure] Error 1
make[6]: Leaving directory `/home/opsteam/vinay/3rdparty/ImageMagick'
make[5]: *** [CMakeFiles/ImageMagick.dir/all] Error 2
make[5]: Leaving directory `/home/opsteam/vinay/3rdparty/ImageMagick'
make[4]: *** [all] Error 2
make[4]: Leaving directory `/home/opsteam/vinay/3rdparty/ImageMagick'
make[3]: *** [ImageMagick-prefix/src/ImageMagick-stamp/ImageMagick-build] Error 2
make[3]: Leaving directory `/home/opsteam/vinay/3rdparty/build/android'
make[2]: *** [CMakeFiles/ImageMagick.dir/all] Error 2
make[2]: Leaving directory `/home/opsteam/vinay/3rdparty/build/android'
make[1]: *** [all] Error 2
make[1]: Leaving directory `/home/opsteam/vinay/3rdparty/build/android'
make: *** [android] Error 2