Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
gnatgcc cannot compile other gcc - misses stddef.h
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
belandor
n00b
n00b


Joined: 18 Jan 2009
Posts: 1

PostPosted: Sun Jan 18, 2009 1:57 pm    Post subject: gnatgcc cannot compile other gcc - misses stddef.h Reply with quote

Hi everyone,

I'm trying to compile another version of gnat on my Gentoo box using gnatgcc.

When configuring gcc, using gnatgcc as compiler, the configure fails.

(configure is called with)
Code:

CC=gnatgcc ../src/configure --prefix=$PREFIX --enable-languages=c,ada --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-nls --disable-checking --disable-werror --disable-libunwind-exceptions --enable-libada


The configure output is actually misleading:

Quote:

[...]
checking for correct version of gmp.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.


the actual error (in config.log) is as follows:

Quote:

[...]
configure:4507: gnatgcc -c -g -O2 conftest.c >&5
In file included from conftest.c:12:
/usr/include/gmp.h:52:40: error: stddef.h: No such file or directory
In file included from conftest.c:12:
/usr/include/gmp.h:52:40: error: stddef.h: No such file or directory
In file included from conftest.c:12:
/usr/include/gmp.h:526: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/gmp.h:526: error: expected declaration specifiers or '...' before 'size_t'
/usr/include/gmp.h:526: error: expected declaration specifiers or '...' before 'size_t'
[...]


So configure just cannot compile the test program. Not because gmp and/or mpfr are missing, but because when including gmp.h, stdio.h gets pulled in, and stdarg.h and stddef.h - and gnatgcc cannot find it.

Is there any way to tell gnatgcc to use a specific set of system headers when compiling C programs to make it able to compile gcc?

Cheers,
Andreas
Back to top
View user's profile Send private message
Maximilian_N
n00b
n00b


Joined: 28 Jul 2010
Posts: 1

PostPosted: Wed Jul 28, 2010 8:29 am    Post subject: Reply with quote

Quote:
I'm trying to compile another version of gnat on my Gentoo box using gnatgcc.

When configuring gcc, using gnatgcc as compiler, the configure fails.


First of all, issue locate stddef.c

If you are using stable version (4.1) of gnat-gcc there will be something like
/usr/lib/gnat-gcc/x86_64-pc-linux-gnu/4.1/include/stddef.h

Just use it as value for CPATH variable like :

CC=gnatgcc CPATH=/usr/lib/gnat-gcc/x86_64-pc-linux-gnu/4.1/include/ ../src/configure --prefix=$PREFIX --enable-languages=c,ada --host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --disable-nls --disable-checking --disable-werror --disable-libunwind-exceptions --enable-libada

If you are using other version of gnat-gcc (not 4.1) or maybe gnat-gpl as ada compiler it will vary.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum