how to do findutils cross-compilation for ARM platform?

View: New views
4 Messages — Rating Filter:   Alert me  

how to do findutils cross-compilation for ARM platform?

by chunrong lai :: Rate this Message:

| View Threaded | Show Only this Message

I tried to build a ARM version of findutils in my ubuntu 10.10 (x86_64)
with below commands
      CC=arm-linux-gnueabi-gcc CFLAGS="-g" ./configure --build
arm-cross-linux-gnueabi --host i686-pc-linux-gnu
      make

I met errors as
        arm-linux-gnueabi-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..
 -I../../intl   -g -MT areadlink-with-size.o -MD -MP -MF $depbase.Tpo -c -o
areadlink-with-size.o areadlink-with-size.c &&\
        mv -f $depbase.Tpo $depbase.Po
        In file included from ./stdio.h:31,
              from areadlink-with-size.c:25:
        /usr/arm-linux-gnueabi/include/stdio.h:742: error: expected
declaration specifiers or ‘...’ before ‘(’ token
        /usr/arm-linux-gnueabi/include/stdio.h:742: error: conflicting
types for ‘rpl_fseeko’
       ./stdio.h:275: note: previous declaration of ‘rpl_fseeko’ was
here
but do not quite understand what happened. Any helps are appreciated.

Re: how to do findutils cross-compilation for ARM platform?

by eblake :: Rate this Message:

| View Threaded | Show Only this Message

[adding bug-gnulib]

On 12/25/2011 09:43 PM, chunrong lai wrote:
> I tried to build a ARM version of findutils in my ubuntu 10.10 (x86_64)
> with below commands
>       CC=arm-linux-gnueabi-gcc CFLAGS="-g" ./configure --build
> arm-cross-linux-gnueabi --host i686-pc-linux-gnu

In general, you should get in the habit of passing CC=... and CFLAGS= as
arguments to configure, rather than via the environment, so that
configure can properly record things so that a later run of
./config.status with a different set of environment variables will still
remember your configure choices.

>       make
>
> I met errors as
>         arm-linux-gnueabi-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..
>  -I../../intl   -g -MT areadlink-with-size.o -MD -MP -MF $depbase.Tpo -c -o
> areadlink-with-size.o areadlink-with-size.c &&\
>         mv -f $depbase.Tpo $depbase.Po
>         In file included from ./stdio.h:31,
>               from areadlink-with-size.c:25:
>         /usr/arm-linux-gnueabi/include/stdio.h:742: error: expected
> declaration specifiers or ‘...’ before ‘(’ token
>         /usr/arm-linux-gnueabi/include/stdio.h:742: error: conflicting
> types for ‘rpl_fseeko’
>        ./stdio.h:275: note: previous declaration of ‘rpl_fseeko’ was
> here
> but do not quite understand what happened. Any helps are appreciated.
This sounds like a gnulib problem.  Gnulib thinks that your ARM fseeko()
is deficient (perhaps because it is a pessimistic cross-compilation
guess, rather than an actual bug), but its attempts to replace things
via rpl_fseeko are triggering some sort of circular header inclusion
cycle where the gnulib replacement gets defined prior to the system
declaration.  A proper fix will probably require knowledge of which
header files are involved in the circular inclusion, and/or updating the
cross-compilation logic to guess correctly for your platform in the
first place.

Meanwhile, a quick workaround would be to prime the cache to avoid the
replacement in the first place (assuming that gnueabi's fseeko() is not
deficient, after all); try:

./configure CC=arm-linux-gnueabi-gcc CFLAGS="-g" \
  --build arm-cross-linux-gnueabi --host i686-pc-linux-gnu \
  gl_cv_func_fflush_stdin=yes

to see if that is enough to bypass the pessimistic cross-compilation
guess (or post more of config.log so that we know the full set of
cross-compilation guesses in effect).

--
Eric Blake   eblake@...    +1-919-301-3266
Libvirt virtualization library http://libvirt.org



signature.asc (633 bytes) Download Attachment

Re: how to do findutils cross-compilation for ARM platform?

by Mike Frysinger :: Rate this Message:

| View Threaded | Show Only this Message

On Wednesday 28 December 2011 09:09:08 Eric Blake wrote:
> On 12/25/2011 09:43 PM, chunrong lai wrote:
> > I tried to build a ARM version of findutils in my ubuntu 10.10 (x86_64)
> > with below commands
>
> ./configure CC=arm-linux-gnueabi-gcc CFLAGS="-g" \
>   --build arm-cross-linux-gnueabi --host i686-pc-linux-gnu \
>   gl_cv_func_fflush_stdin=yes

maybe i'm missing something, but this doesn't seem right.  if you want to
cross-compile the code to run on arm, then the --build/--host flags are
inverted here.
-mike


signature.asc (853 bytes) Download Attachment

Re: how to do findutils cross-compilation for ARM platform?

by Bruno Haible :: Rate this Message:

| View Threaded | Show Only this Message

> > I met errors as
> >         arm-linux-gnueabi-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../..
> >  -I../../intl   -g -MT areadlink-with-size.o -MD -MP -MF $depbase.Tpo -c -
o

> > areadlink-with-size.o areadlink-with-size.c &&\
> >         mv -f $depbase.Tpo $depbase.Po
> >         In file included from ./stdio.h:31,
> >               from areadlink-with-size.c:25:
> >         /usr/arm-linux-gnueabi/include/stdio.h:742: error: expected
> > declaration specifiers or ‘...’ before ‘(’ token
> >         /usr/arm-linux-gnueabi/include/stdio.h:742: error: conflicting
> > types for ‘rpl_fseeko’
> >        ./stdio.h:275: note: previous declaration of ‘rpl_fseeko’ was
> > here

gnulib tries to arrange things such that the libc's <stdio.h> file is read
and processed before gnulib's <stdio.h> file. Apparently here it did not
work as expected.

If you can reproduce this error with corrected --build and --host values,
please can you post the output of the preprocessing, i.e.

$ arm-linux-gnueabi-gcc -std=gnu99 -DHAVE_CONFIG_H -I. -I../.. \
    -I../../intl   -g -MT areadlink-with-size.o -E areadlink-with-size.c

Bruno