conflicting types for '__loff_t'

Jeff Johnston
Thu Aug 18 23:30:00 GMT 2005

As mentioned in a previous note, I think you are in unchartered waters. 
  Getting newlib to coexist with glibc headers is a touchy thing and the 
current set up has only worked for x86 native on ia32.  It may be the 
right thing to do or it may open a can of worms.  At a minimum, you 
would at least need a check for __amd64__ in the libc/sys/linux header 
files for certain types.

-- Jeff J.

Shaun Jackman wrote:
> When compiling newlib for i686-pc-linux-gnu the build complains that
> __loff_t is being redefined:
> $ make
> ...
> In file included from
> /home/sjackman/work/debian/newlib/newlib-1.13.0/_build/i686-pc-linux-gnu/64/newlib/targ-include/sys/types.h:131,
>                  from ../../../../../../newlib/libc/argz/argz_add.c:8:
> /usr/include/bits/types.h:186: error: conflicting types for '__loff_t'
> /home/sjackman/work/debian/newlib/newlib-1.13.0/newlib/libc/include/machine/types.h:39:
> error: previous declaration of '__loff_t' was here
> make[8]: *** [argz_add.lo] Error 1
> make[8]: Leaving directory
> `/home/sjackman/work/debian/newlib/newlib-1.13.0/_build/i686-pc-linux-gnu/64/newlib/libc/argz'
> ...
> $ grep -A2 GNUC newlib/libc/include/machine/types.h
> #ifdef __GNUC__
> __extension__ typedef long long int __loff_t;
> #else
> $ grep off /usr/include/bits/types.h
> __STD_TYPE __OFF_T_TYPE __off_t;        /* Type of file sizes and offsets.  */
> __STD_TYPE __OFF64_T_TYPE __off64_t;    /* Type of file sizes and
> offsets (LFS).  */
> typedef __off64_t __loff_t;     /* Type of file sizes and offsets (LFS).  */
> Should machine/types.h include bits/types.h for the Linux target?
> Cheers,
> Shaun

More information about the Newlib mailing list