This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Error compiling newlib-1.13.0


Derick Swanepoel wrote:

OK, I have checked out the CVS tree on 27 Sep and I'm now a bit closer
to understanding my problems. It seems that my particular version of
/usr/include/linux/types.h includes time.h when __KERNEL_STRICT_NAMES
is not defined, and this causes newlib's time.h to be included
prematurely. I'll take up this issue with the Gentoo developers...

After fixing this I ran into a problem with stdint.h. The version of
stdint.h that is included from
newlib/libc/sys/linux/iconv/gconv_simple.c (line 26) is
newlib/libc/sys/linux/include/stdint.h, which is slightly different
from newlib/libc/include/stdint.h. The one in sys/linux/ doesn't have
typedefs for several types like int16_t and uint16_t, so including it
fails. Here is the compile output:

<snip>
gcc -I/tmp/newlib-i686/i686-pc-linux-gnu/newlib/targ-include
-I/tmp/newlib-cvs/src/newlib/libc/include -DPACKAGE=\"newlib\"
-DVERSION=\"1.13.0\" -I.
-I../../../../../../../newlib-cvs/src/newlib/libc/sys/linux/iconv
-DGCONV_DIR=\"/usr/local/lib/newlib\"
-DGCONV_PATH=\"/usr/local/lib/newlib\"
-I../../../../../../../newlib-cvs/src/newlib/libc/sys/linux/iconv
-I../../../../../../../newlib-cvs/src/newlib/libc/sys/linux/iconv/..
-O2 -Wall -D_I386MACH_ALLOW_HW_INTERRUPTS -DHAVE_FCNTL -fPIC
-D_I386MACH_NEED_SOTYPE_FUNCTION -DMISSING_SYSCALL_NAMES -fno-builtin
-O2 -g -O2 -c ../../../../../../../newlib-cvs/src/newlib/libc/sys/linux/iconv/gconv_simple.c
-fPIC -DPIC -o .libs/gconv_simple.o
In file included from
../../../../../../../newlib-cvs/src/newlib/libc/sys/linux/iconv/gconv_simple.c:26:
/tmp/newlib-i686/i686-pc-linux-gnu/newlib/targ-include/stdint.h:48:
error: parse error before "int_least16_t"
/tmp/newlib-i686/i686-pc-linux-gnu/newlib/targ-include/stdint.h:48:
warning: type defaults to `int' in declaration of `int_least16_t'
/tmp/newlib-i686/i686-pc-linux-gnu/newlib/targ-include/stdint.h:48:
warning: data definition has no type or storage class
/tmp/newlib-i686/i686-pc-linux-gnu/newlib/targ-include/stdint.h:49:
error: parse error before "uint_least16_t"
...
</snip>

Is there a reason for these differences between
newlib/libc/sys/linux/include/stdint.h and
newlib/libc/include/stdint.h?

I see that sys/types.h has the missing typedefs, so including it
before stdint.h allows gconv_simple.c to be compiled, but I don't know
if that is in any way the right thing to do.



I have fixed this. Newlib linux has a number of these types already defined in <sys/types.h> so I was getting multiple definitions in the build. I removed them from the Linux stdint.h but neglected to add the #include <sys/types.h> which is there now.

-- Jeff J.

Thanks,
Derick

On 27/09/05, Jeff Johnston <jjohnstn@redhat.com> wrote:


Derick,

  Newlib plays a bit of a balancing act when building natively under
Linux.  It uses some of newlib's header files and some of the native
header files.  I have run into a number of problems as glibc has been
updated and also some problems as gcc has updated to gcc4.

  Anyway, I recently made a set of patches to the tree to support
building on FC4.  Could you try checking out the CVS tree to see if that
fixes your problems.  I don't have Gentoo and have never tried it so
you're partly in unchartered territory.

-- Jeff J.

Derick Swanepoel wrote:


Sorry, forgot about that. I configured newlib with the default host
and target, so in my case they are both "i686-pc-linux-gnu".

Derick

On 27/09/05, Jonathan S. Shapiro <shap@eros-os.org> wrote:



Derek:

I probably can't decipher your problem, but I *can* tell you that
*nobody* can help you without knowing:

      What environment (configuration) are you compiling *for*
      What environment are you compiling *on*.

shap

On Tue, 2005-09-27 at 15:55 +0200, Derick Swanepoel wrote:



Hi,

I am compiling newlib for the first time, but I'm not getting very
far. I get the following error:

gcc -I/home/derick/newlib-1.13.0/newlib/targ-include
-I/home/derick/newlib-1.13.0/newlib/libc/include -DPACKAGE=\"newlib\"
-DVERSION=\"1.13.0\" -I. -I. -O2 -Wall -D_I386MACH_ALLOW_HW_INTERRUPTS
-DHAVE_FCNTL -fPIC -D_I386MACH_NEED_SOTYPE_FUNCTION
-DMISSING_SYSCALL_NAMES -fno-builtin -g -O2 -c argz_add.c  -fPIC -DPIC
-o .libs/argz_add.o
In file included from /home/derick/newlib-1.13.0/newlib/targ-include/time.h:11,
               from /usr/include/linux/types.h:153,
               from
/home/derick/newlib-1.13.0/newlib/targ-include/sys/types.h:130,
               from argz_add.c:9:
/home/derick/newlib-1.13.0/newlib/targ-include/sys/linux_time.h:53:
error: parse error before "suseconds_t"
...

I have determined that it happens because my
/usr/include/linux/types.h includes time.h before suseconds_t is
defined in newlib/targ-include/sys/types.h.

Here are some details about my system:
Gentoo Linux 2005.1
gcc 3.4.4
kernel headers: 2.6.11

Any help would be appreciated.

Thanks,
Derick








Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]