Two Problems Cross-compiling

Richard Kiss kiss at
Tue Sep 21 21:14:44 GMT 2004

I am cross-compiling rsync 2.6.2 on Linux i386 for Linux ARM. I pass the 
following to configure:

./configure --host=arm-linux

(1) The build fails on the first file because of rsync.h.


#if (SIZEOF_LONG == 8)
#define uint64 unsigned long
#elif (SIZEOF_INT == 8)
#define uint64 unsigned int
#define uint64 unsigned long long
/* As long as it gets... */
#define uint64 unsigned off_t


The last arm of the #if/#else is taken, but "unsigned off_t" causes a 
problem the first time it is used.

kiss at debian_sh:~/buildroot/build_arm_nofpu/rsync-2.6.2$ make
~/buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-uclibc-gcc -I. -I. 
-g -O2 -DHAVE_CONFIG_H -Wall -W -I./popt  -c rsync.c -o rsync.o
In file included from rsync.c:23:
rsync.h:353: warning: no semicolon at end of struct or union
rsync.h:353: error: parse error before "inode"
rsync.h:354: error: parse error before "dev"
rsync.h:354: warning: type defaults to `int' in declaration of `dev'
rsync.h:354: warning: data definition has no type or storage class
make: *** [rsync.o] Error 1

I replace "unsigned off_t" with __uint64_t and all is well.

(2) The file lib/compat.c fails:

~/buildroot/build_arm_nofpu/staging_dir/bin/arm-linux-uclibc-gcc -I. -I. 
-g -O2 -DHAVE_CONFIG_H -Wall -W -I./popt  -c lib/compat.c -o lib/compat.o
lib/compat.c: In function `sys_gettimeofday':
lib/compat.c:202: error: too few arguments to function `gettimeofday'
make: *** [lib/compat.o] Error 1

So the problem here is that the second arm of the #if/#else/#end if 
taken when the first should be.


/* some systems don't take the 2nd argument */
int sys_gettimeofday(struct timeval *tv)
         return gettimeofday(tv, NULL);
         return gettimeofday(tv);


I tried rsync-HEAD-20040921-1616GMT and both problems still exist.

I can make the build work locally, but it seems that the work of an 
autoconf wizard is in order. I would be happy to test any patches or 
provide any additional information.

-- Richard

Richard Kiss
Health Hero Network, Inc.
2570 El Camino Real, Suite 111
Mountain View, CA 94040
E-mail: kiss at

More information about the rsync mailing list