GNU LIBICONV-1.13.1 standalone toolchain compile error time_t not recognized

954 views
Skip to first unread message

dom

unread,
Jun 20, 2011, 1:11:03 PM6/20/11
to android-ndk
Hi everyone,

I am trying to cross compile the GNU libiconv-1.13.1 library using the
Android standalone toolchain. I am using Android level 8 for this.
After copying the latest config.guess and config.sub scripts from the
GNU auto tools website I was able to configure the library.

I get a compile error when I do a make. The complier error is as
follows:

make[5]: Leaving directory `/data/proto/distro/commonc++/branches/
0.6.4-dti.3x/libiconv-1.13.1'
/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 -
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'

It seems like time_t is not defined in the standalone toolchain's
header files. Does anyone have any idea if there is a fix or
workaround for this? Thanks.

Dominique

mbernasocchi

unread,
Jul 18, 2011, 12:50:14 PM7/18/11
to android-ndk
Hi, i'm porting QGIS to android, and I'm stuck compiling libiconv,
with the same error as the OP. Does anybody know how to solve this
time_t problem?

thanks a lot
Marco

On Jun 20, 7:11 pm, dom <domv...@yahoo.com> wrote:
> Hi everyone,
>
> I am trying to cross compile the GNUlibiconv-1.13.1 library using the

Marco Bernasocchi

unread,
Jul 19, 2011, 4:42:02 AM7/19/11
to andro...@googlegroups.com
Hi all, It looks like my last post did not go out. I'm porting QGIS to android and I'm using ndk r5c to crosscompile all, I managed to get geos, gdal, proj4, qwt, and others to cross compile properly but now I'm stuck with libiconv. I get the same error as the OP.
can anybody help me?
thanks a lot
Marco
Hi everyone, 

I am trying to cross compile the GNU libiconv-1.13.1 library using the 

Dominique


Atsushi Eno

unread,
Jul 19, 2011, 5:35:29 PM7/19/11
to android-ndk
Hello,

While I think this is an ndk issue that needs some fix, I experienced
similar issue and got a workaround that omits bin (tools) builds.
I haven't really tried to use it though.
Here are links for
- the patch
https//gist.github.com/1093778
- compiled binaries (includes .so)
http://dl.dropbox.com/u/493047/2011/07/libiconv-1.13.1-bin.tar.bz2

Atsushi Eno

On Jul 19, 5:42 pm, Marco Bernasocchi <ma...@bernawebdesign.ch> wrote:
> Hi all, It looks like my last post did not go out. I'm porting QGIS to
> android and I'm using ndk r5c to crosscompile all, I managed to get
> geos, gdal, proj4, qwt, and others to cross compile properly but now I'm
> stuck with libiconv. I get the same error as the OP.
> can anybody help me?
> thanks a lot
> Marco
>
>
>
>
>
>
>
> > Hi everyone,
>
> > I am trying to cross compile the GNU*libiconv*-1.13.1 library using the
> > Android standalone toolchain.  I am using Android level 8 for this.
> > After copying the latest config.guess and config.sub scripts from the
> > GNU auto tools website I was able to configure the library.
>
> > I get a compile error when I do a make.  The complier error is as
> > follows:
>
> > make[5]: Leaving directory `/data/proto/distro/commonc++/branches/
> > 0.6.4-dti.3x/*libiconv*-1.13.1'

Robert Bragg

unread,
Aug 21, 2011, 6:17:20 PM8/21/11
to android-ndk
I just hit this too. It looks like libiconv uses gnulib which will
create a fallback stdint.h under the srclib/ directory during ./
configure. That fallback header then wreaks havoc because the android
toolchain itself provides headers that expect to include stdint.h and
they are being forced to include the one generated during ./configure
resulting in a circular dependency and sys/types.h doesn't get
included with the time_t typedef.

After delving a bit into the sysm4/stdinc.m4 file I luckily found it's
possible to override the gnulib macro so it never writes out a
fallback stdint.h if you set gl_cv_header_working_stdint_h=yes

So my full configure line is now:
gl_cv_header_working_stdint_h=yes ./configure --host=arm-linux-
androideabi

That seems to get things building for me with libiconv-1.14

I hope that helps,
regards,
- Robert

On Jul 19, 9:42 am, Marco Bernasocchi <ma...@bernawebdesign.ch> wrote:
> Hi all, It looks like my last post did not go out. I'm porting QGIS to
> android and I'm using ndk r5c to crosscompile all, I managed to get
> geos, gdal, proj4, qwt, and others to cross compile properly but now I'm
> stuck with libiconv. I get the same error as the OP.
> can anybody help me?
> thanks a lot
> Marco
>
>
>
>
>
>
>
> > Hi everyone,
>
> > I am trying to cross compile the GNU*libiconv*-1.13.1 library using the
> > Android standalone toolchain.  I am using Android level 8 for this.
> > After copying the latest config.guess and config.sub scripts from the
> > GNU auto tools website I was able to configure the library.
>
> > I get a compile error when I do a make.  The complier error is as
> > follows:
>
> > make[5]: Leaving directory `/data/proto/distro/commonc++/branches/
> > 0.6.4-dti.3x/*libiconv*-1.13.1'

Marco Bernasocchi

unread,
Aug 22, 2011, 4:36:14 AM8/22/11
to andro...@googlegroups.com, Robert Bragg
Robert, this is super welcome!!! I had dropped libiconv foer the moment
and just started this morning looking into it. now it builds properly THX
Marco
Reply all
Reply to author
Forward
0 new messages