[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug-gnu-libiconv] libiconv doesn't build as an Android native library

From: Van Rafelghem Dominique
Subject: [bug-gnu-libiconv] libiconv doesn't build as an Android native library
Date: Thu, 23 Jun 2011 19:27:17 -0400

Hi everyone,

I’m trying to build libiconv-1.13.1 as a native library to be used on Android.  I used a standalone toolchain as described in the Android NDK documentation.  I generated an Android application level 8 compiler using the android-ndk-r5b for linux on an x86 platform.  I’m building on a Ubuntu 10.10 distribution which has all the GNU Autotools needed to build libiconv.


I chose this method of building the library (instead of Google’s build tools) since I can still run the normal configure command and make commands.  Unfortunately, this isn’t working for me.  The configure script executes normally and seems to run to completion properly, generating the Makefile and any other files it needs.  This is my configure invocation:

Ø  ./configure –host=arm-linux-androideabi –prefix=/usr/local/android8 –disable-nls –disable-xmp –disable-shared CC=/data/android-8-toolchain/bin/arm-linux-androideabi-gcc \

Ø  CXX=/data/android-8-toolchain/bin/arm-linux-androideabi-g++ CFLAGS=’-mthumb –g –DANDROID –Wno-multichar’ CXXFLAGS=’-mthumb –g –DANDROID –Wno-multichar’ \

Ø  LDFLAGS=’-Wl, --fix-cortex-a8’ LIBS=’-lstdc++ -lsupc++’

For configure I did have to update config.guess and config.sub in the build-aux and libcharset/build-aux directories to a newer version which I obtained  from the GNU libtool website at http://www.gnu.org/software/libtool/.  The timestamp on the config.sub is 2011-03-23 and on the config.guess it is 2011-05-11.  Once these scripts were update the configure script seemed to run correctly.


The problem is when executing make the compile errors out when trying to compile srclib/areadlink.c.  Here is a snippet of the log file which I’ve attached:


make[2]: Entering directory `/home/dtitest/Downloads/libiconv-1.13.1/srclib'
/data/android-8-toolchain/bin/arm-linux-androideabi-gcc -DHAVE_CONFIG_H -DEXEEXT=\"\" -I. -I.. -I../lib  -I../intl -DDEPENDS_ON_LIBICONV=1 -DDEPENDS_ON_LIBINTL=1   -mthumb -g -DANDROID -Wno-multichar -c areadlink.c
In file included from /data/android-8-toolchain/bin/../sysroot/usr/include/sys/time.h:33,
                 from /data/android-8-toolchain/bin/../sysroot/usr/include/time.h:32,
                 from /data/android-8-toolchain/bin/../sysroot/usr/include/wchar.h:39,
                 from ./stdint.h:483,
                 from /data/android-8-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:43,
                 from areadlink.c:30:
/data/android-8-toolchain/bin/../sysroot/usr/include/linux/time.h:20: error: expected specifier-qualifier-list before 'time_t'
/data/android-8-toolchain/bin/../sysroot/usr/include/linux/time.h:26: error: expected specifier-qualifier-list before 'time_t'
In file included from /data/android-8-toolchain/bin/../sysroot/usr/include/asm/siginfo.h:15,
                 from /data/android-8-toolchain/bin/../sysroot/usr/include/time.h:35,
                 from /data/android-8-toolchain/bin/../sysroot/usr/include/wchar.h:39,
                 from ./stdint.h:483,
                 from /data/android-8-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.4.3/include-fixed/sys/types.h:43,
                 from areadlink.c:30:


The strange thing is that even though the build fails the libraries seem to have been generated.  The compile error seems to be an issue in which the stdint.h file, from the srclib directory which looks to be generated, is not compatible with the Android toolchain and libraries.  I realize that Android is using a pared down version of libc called Bionic so maybe that is what is causing this problem.  It is possible that the header files they use don’t match the header for libiconv so that might be causing the problem.


I’ve attached the output of the make command with the error.  I also did an ls command on the lib/.libs directory which does have the libiconv libraries in it.  Any help with this would be greatly appreciated.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]