diff mbox

Fix Solaris 2/SPARC bootstrap

Message ID yddd3rg3c9m.fsf@manam.CeBiTec.Uni-Bielefeld.DE
State New
Headers show

Commit Message

Rainer Orth Oct. 11, 2010, 4:49 p.m. UTC
Solaris 2/SPARC bootstrap is currently broken due to one of Joseph's
recent patches: sparc/gmon-sol2.c doesn't compile since some headers now
use bool without a definition being provided:

/var/gcc/regression/trunk/10-gcc-gas/build/./gcc/xgcc -B/var/gcc/regression/trunk/10-gcc-gas/build/./gcc/ -B/vol/gcc/sparc-sun-solaris2.10/bin/ -B/vol/gcc/sparc-sun-solaris2.10/lib/ -isystem /vol/gcc/sparc-sun-solaris2.10/include -isystem /vol/gcc/sparc-sun-solaris2.10/sys-include    -g -O2 -DIN_GCC   -W -Wall -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include  -I. -I/var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/sparcv9/libgcc -I/vol/gcc/src/hg/trunk/local/gcc -I/vol/gcc/src/hg/trunk/local/gcc//var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/sparcv9/libgcc -I/vol/gcc/src/hg/trunk/local/gcc/../include -I./../intl -I/vol/gcc/src/hg/trunk/local/gcc/../libcpp/include -I/vol/gcc/include -I/vol/gcc/include -I/vol/gcc/include  -I/vol/gcc/src/hg/trunk/local/gcc/../libdecnumber -I/vol/gcc/src/hg/trunk/local/gcc/../libdecnumber/dpd -I../libdecnumber   -I/usr/include/libelf -g -O2 -m64 \
	-c /vol/gcc/src/hg/trunk/local/gcc/config/sparc/gmon-sol2.c -o /var/gcc/regression/trunk/10-gcc-gas/build/sparc-sun-solaris2.10/sparcv9/libgcc/gmon.o
In file included from ./tm.h:14:0,
                 from /vol/gcc/src/hg/trunk/local/gcc/config/sparc/gmon-sol2.c:39:
/vol/gcc/src/hg/trunk/local/gcc/flags.h:74:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'should_emit_struct_debug'
/vol/gcc/src/hg/trunk/local/gcc/flags.h:79:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'use_gnu_debug_info_extensions'
/vol/gcc/src/hg/trunk/local/gcc/flags.h:116:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'in_lto_p'
/vol/gcc/src/hg/trunk/local/gcc/flags.h:135:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'warn_larger_than'
/vol/gcc/src/hg/trunk/local/gcc/flags.h:136:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'larger_than_size'
/vol/gcc/src/hg/trunk/local/gcc/flags.h:141:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'warn_frame_larger_than'
/vol/gcc/src/hg/trunk/local/gcc/flags.h:142:22: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'frame_larger_than_size'
/vol/gcc/src/hg/trunk/local/gcc/flags.h:161:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'final_insns_dump_p'
/vol/gcc/src/hg/trunk/local/gcc/flags.h:303:13: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'flag_instrument_functions_exclude_p'
In file included from /vol/gcc/src/hg/trunk/local/gcc/flags.h:361:0,
                 from ./tm.h:14,
                 from /vol/gcc/src/hg/trunk/local/gcc/config/sparc/gmon-sol2.c:39:
./options.h:14:3: error: expected specifier-qualifier-list before 'bool'

In the case at hand, the includes of coretypes.h and tm.h are simply
superfluous and can be removed.  i386/gmon-sol2.c doesn't have this
problem, and I long meant to merge those two files.  Will probably do so
when moving Solaris 2 libgcc files to toplevel libgcc.

Bootstrap now continues (well into building target libs), so installed
on mainline.

	Rainer


2010-10-11  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

	* config/sparc/gmon-sol2.c: Don't include coretypes.h, tm.h.

Comments

Joseph Myers Oct. 11, 2010, 5:14 p.m. UTC | #1
On Mon, 11 Oct 2010, Rainer Orth wrote:

> Solaris 2/SPARC bootstrap is currently broken due to one of Joseph's
> recent patches: sparc/gmon-sol2.c doesn't compile since some headers now
> use bool without a definition being provided:

I am currently testing a patch along the lines I described at 
<http://gcc.gnu.org/ml/gcc-patches/2010-10/msg00787.html>, which I think 
should fix this through flags.h again not being included in tm.h.

The *real* problem, however, is on two levels:

* There are far too many defines used to condition target code 
(USED_FOR_TARGET, IN_LIBGCC2, IN_TARGET_LIBS, IN_RTS) in one place or 
another, plus IN_GCC which "distinguishes between code compiled into GCC 
itself and other programs built during a bootstrap" according to the 
makefile comment (but which does nothing of the sort - it's used for other 
programs such as gcov, and for generator programs, and for target code), 
plus GENERATOR_FILE which actually has a meaningful use.  The options code 
is using a subset of the target code conditionals - apparently not a 
sufficient subset - to disable some things for the target.  (Then you have 
__GCC_FLOAT_NOT_NEEDED, defined in gcc/Makefile.in but completely unused.)

This set of defines should be cut down - my guess is that it should be 
possible to have just USED_FOR_TARGET and GENERATOR_FILE, plus 
IN_CONFIGURE_TEST or similar to deal with the IN_GCC conditional in 
system.h.

* It would be better for no headers to be shared by host and target code 
in the first place; so far as target code needs configuration headers, 
they should be completely separate from host headers, and target code 
should be built and configured completely outside the gcc/ directory.  
Then you don't need macros to distinguish whether code is being built for 
the host or the target at all.
diff mbox

Patch

diff -r a6ebd063d3e0 gcc/config/sparc/gmon-sol2.c
--- a/gcc/config/sparc/gmon-sol2.c	Mon Oct 11 11:31:36 2010 +0200
+++ b/gcc/config/sparc/gmon-sol2.c	Mon Oct 11 18:40:48 2010 +0200
@@ -35,8 +35,6 @@ 
 #include "tconfig.h"
 #include "tsystem.h"
 #include <fcntl.h> /* for creat() */
-#include "coretypes.h"
-#include "tm.h"
 
 #if 0
 #include "sparc/gmon.h"