public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [vta] revamp bootstrap-debug with -fcompare-debug, fix LIBCFLAGS uses
@ 2008-10-07  8:31 Alexandre Oliva
  2008-10-07  8:41 ` Ralf Wildenhues
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Alexandre Oliva @ 2008-10-07  8:31 UTC (permalink / raw)
  To: gcc-patches

[-- Attachment #1: Type: text/plain, Size: 2360 bytes --]

This patch introduces support for BUILD_CONFIG, a Makefile macro that,
if set to say "a b", will cause config/a.mk and config/b.mk to be
included in the top-level Makefile.  The plan was to use this to add
-fcompare-debug to certain variables, and eventually add a configure
option to set a default (non-empty) value for BUILD_CONFIG.

I ran into a number of problems.  First of all, I needed CFLAGS and
CFLAGS_FOR_TARGET to vary across bootstrap levels, so that I could
build say stage2 without -fcompare-debug and stage3 with it.

Second, I found that LIBCFLAGS was not used consistently.  IMHO, we
should only use LIBCFLAGS for builds using the pre-installed host
compiler.  For target builds, we should use LIBCFLAGS_FOR_TARGET, and
for host builds in in stage2+ I can see that it makes sense to use
either STAGE_CFLAGS (being the preferred flags for GCC for that stage,
without any of the magic flags required by the compiler used to build
stage1) or CFLAGS_FOR_TARGET (being the preferred flags for the GCC
built in the previous stage).  I chose the former, for simplicity.

I also moved SYSROOT and DEBUG_PREFIX flags from *FLAGS_FOR_TARGET to
XGCC_FLAGS_FOR_TARGET, which is added to CC, CXX, GCJ and GFORTRAN
passed to target builds, along with the newly-introduced TFLAGS, which
may vary from stage to stage.

Overriding GCJ proved to be "interesting".  gcc/java/Make-lang.in
didn't want it overridden, using it internally as a target name, and
libjava/configure didn't use GCJ passed in the environment.  I fixed
both.

I also added a bunch of BUILD_CONFIGs to bootstrap with -O1 and -O3
(BOOT_CFLAGS overriders), bootstrap-debug (a much simpler
implementation of the previous bootstrap target, still using the
compare-debug script), bootstrap-debug-lib (a much simpler and faster
implementation of the previous bootstrap4-debug target, that uses
-fcompare-debug for both compiler and libraries verification in
stage3, with further optional testing in stage4),
bootstrap-debug-ckovw (that arranges for errors to be issued when
using a newly-built compiler without -fcompare-debug) and
bootstrap-time (that arranges for xgcc to dump compile, assembly and
link times to a global log file; this is useful to verify VTA compile
overhead in -fcompare-debug builds).

Here's the patch, omitting the generated files.  I'm installing it in
the VTA branch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: bootstrap-configs.patch --]
[-- Type: text/x-patch, Size: 32002 bytes --]

for ChangeLog.vta
from  Alexandre Oliva  <aoliva@redhat.com>

	* Makefile.def (flags_to_pass): Remove redundant and incomplete
	STAGE1_CFLAGS, STAGE2_CFLAGS, STAGE3_CFLAGS, and STAGE4_CFLAGS.
	Add FLAGS_FOR_TARGET and BUILD_CONFIG.
	(bootstrap_stage): Remove bootstrap-debug custom stages.  Turn
	stage_configureflags, stage_cflags and stage_libcflags into
	explicit Makefile macros.
	* Makefile.tpl (HOST_EXPORTS, EXTRA_HOST_FLAGS): Pass GCJ and
	GFORTRAN.
	(POSTSTAGE1_HOST_EXPORTS): Add XGCC_FLAGS_FOR_TARGET and TFLAGS to
	CC.  Set CC_FOR_BUILD from CC.
	(BASE_TARGET_EXPORTS, RAW_CXX_TARGET_EXPORTS,
	NORMAL_TARGET_EXPORTS): Move SYSROOT_CFLAGS_FOR_TARGET and
	DEBUG_PREFIX_CFLAGS_FOR_TARGET from CFLAGS and CXXFLAGS to
	XGCC_FLAGS_FOR_TARGET.  Add it along with TFLAGS to CC, CXX, GCJ,
	and GFORTRAN.
	(TFLAGS, STAGE_CFLAGS, STAGE_TFLAGS, STAGE_CONFIGURE_FLAGS): New.
	(_LIBCFLAGS): Renamed to _TFLAGS.
	(do-compare-debug, do-compare3-debug): Drop.
	(CC, GCC_FOR_TARGET, CXX_FOR_TARGET, RAW_CXX_FOR_TARGET,
	GCJ_FOR_TARGET, GFORTRAN_FOR_TARGET): Remove FLAGS_FOR_TARGET.
	(FLAGS_FOR_TARGET, SYSROOT_CFLAGS_FOR_TARGET,
	DEBUG_PREFIX_CFLAGS_FOR_TARGET): Move down.
	(XGCC_FLAGS_FOR_TARGET): New.
	(BASE_FLAGS_TO_PASS): Pass STAGEid_CFLAGS, STAGEid_TFLAGS and TFLAGS.
	(EXTRA_HOST_FLAGS): Pass GCJ and GFORTRAN.
	(POSTSTAGE1_FLAGS_TO_PASS): Move SYSROOT_CFLAGS_FOR_TARGET and
	DEBUG_PREFIX_CFLAGS_FOR_TARGET from CFLAGS, CXXFLAGS, LIBCFLAGS,
	LIBCXXFLAGS to XGCC_FLAGS_FOR_TARGET.    Add it along with TFLAGS
	to CC, CXX, GCJ, and GFORTRAN.  Pass XGCC_FLAGS_FOR_TARGET and
	TFLAGS.
	(BUILD_CONFIG): Include if requested.
	(all): Set TFLAGS on bootstrap.
	(configure-stageid-prefixmodule): Pass TFLAGS, adjust FLAGS.
	(all-stageid-prefixmodule): Likewise.
	(do-clean, distclean-stageid): Set TFLAGS.
	(restrap): Fix whitespace.
	(bootstrap4-debug): Drop.
	* Makefile.in: Rebuilt.
	* config/mt-gnu (CXXFLAGS_FOR_TARGET): Adjust.
	* config/bootstrap-O1.mk: New.
	* config/bootstrap-O3.mk: New.
	* config/bootstrap-time.mk: New.
	* config/bootstrap-debug.mk: New.
	* config/bootstrap-debug-ckovw.mk: New.
	* config/bootstrap-debug-lib.mk: New.
	* libjava/configure.ac: Insert libgcjdir in the GCJ passed in the
	environment, rather than overriding completely.
	* libjava/configure: Rebuilt.

for gcc/java/ChangeLog.vta
from Alexandre Oliva  <aoliva@redhat.com>

	* Make-lang.in (GCJ): Renamed to...
	(XGCJ): ... this.

Index: Makefile.def
===================================================================
--- Makefile.def.orig	2008-10-03 15:38:23.000000000 -0300
+++ Makefile.def	2008-10-07 05:02:35.000000000 -0300
@@ -236,12 +236,8 @@ flags_to_pass = { flag= CXXFLAGS ; };
 flags_to_pass = { flag= LDFLAGS ; };
 flags_to_pass = { flag= LIBCFLAGS ; };
 flags_to_pass = { flag= LIBCXXFLAGS ; };
-flags_to_pass = { flag= STAGE1_CFLAGS ; };
 flags_to_pass = { flag= STAGE1_CHECKING ; };
 flags_to_pass = { flag= STAGE1_LANGUAGES ; };
-flags_to_pass = { flag= STAGE2_CFLAGS ; };
-flags_to_pass = { flag= STAGE3_CFLAGS ; };
-flags_to_pass = { flag= STAGE4_CFLAGS ; };
 flags_to_pass = { flag= GNATBIND ; };
 flags_to_pass = { flag= GNATMAKE ; };
 
@@ -254,6 +250,7 @@ flags_to_pass = { flag= CPPFLAGS_FOR_TAR
 flags_to_pass = { flag= CXX_FOR_TARGET ; };
 flags_to_pass = { flag= CXXFLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= DLLTOOL_FOR_TARGET ; };
+flags_to_pass = { flag= FLAGS_FOR_TARGET ; };
 flags_to_pass = { flag= GCJ_FOR_TARGET ; };
 flags_to_pass = { flag= GFORTRAN_FOR_TARGET ; };
 flags_to_pass = { flag= LD_FOR_TARGET ; };
@@ -269,6 +266,7 @@ flags_to_pass = { flag= WINDRES_FOR_TARG
 flags_to_pass = { flag= WINDMC_FOR_TARGET ; };
 
 // Miscellaneous
+flags_to_pass = { flag= BUILD_CONFIG ; };
 flags_to_pass = { flag= LANGUAGES ; optional=true ; };
 flags_to_pass = { flag= LEAN ; };
 
@@ -511,69 +509,21 @@ dependencies = { module=all-target-winsu
 dependencies = { module=all-target-winsup; on=all-target-libtermcap; };
 
 // Toplevel bootstrap
-bootstrap_stage = {
-	id=1 ;
-
-	// * We force-disable intermodule optimizations, even if
-	//   --enable-intermodule was passed, since the installed compiler
-	//   probably can't handle them.  Luckily, autoconf always respects
-	//   the last argument when conflicting --enable arguments are passed.
-	// * Likewise, we force-disable coverage flags, since the installed
-	//   compiler probably has never heard of them.
-	stage_configure_flags='--disable-intermodule $(STAGE1_CHECKING) \
-	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"' ;
-	stage_cflags='$(STAGE1_CFLAGS)' ;
-	stage_libcflags='$(STAGE1_LIBCFLAGS)' ; };
+bootstrap_stage = { id=1 ; };
 bootstrap_stage = {
 	id=2 ; prev=1 ;
-	bootstrap_target=bootstrap2 ;
-	stage_configure_flags="@stage2_werror_flag@" ;
-	stage_cflags="$(STAGE2_CFLAGS)" ;
-	stage_libcflags="$(STAGE2_LIBCFLAGS)" ; };
-bootstrap_stage = {
-	id=b2g0 ; prev=1 ;
-	bootstrap_target=bootstrap2-debug ;
-	stage_configure_flags="@stage2_werror_flag@" ;
-	stage_cflags="$(STAGE2_CFLAGS) -g0" ;
-	stage_libcflags="$(STAGE2_LIBCFLAGS) -g0" ; };
+	bootstrap_target=bootstrap2 ; };
 bootstrap_stage = {
 	id=3 ; prev=2 ; lean=1 ;
 	compare_target=compare ;
 	bootstrap_target=bootstrap ;
-	cleanstrap_target=cleanstrap ;
-	stage_configure_flags="@stage2_werror_flag@" ;
-	stage_cflags="$(STAGE3_CFLAGS)" ;
-	stage_libcflags="$(STAGE3_LIBCFLAGS)" ; };
-bootstrap_stage = {
-	id=b3g2 ; prev=b2g0 ; lean=1 ;
-	compare_target=compare-debug ;
-	bootstrap_target=bootstrap-debug ;
-	cleanstrap_target=cleanstrap-debug ;
-	stage_configure_flags="@stage2_werror_flag@" ;
-	stage_cflags="$(STAGE3_CFLAGS) -g2" ;
-	stage_libcflags="$(STAGE3_LIBCFLAGS) -g2" ; };
+	cleanstrap_target=cleanstrap ; };
 bootstrap_stage = {
 	id=4 ; prev=3 ; lean=2 ;
 	compare_target=compare3 ;
-	bootstrap_target=bootstrap4 ;
-	stage_configure_flags="@stage2_werror_flag@" ;
-	stage_cflags="$(STAGE4_CFLAGS)" ;
-	stage_libcflags="$(STAGE4_CFLAGS)" ; };
-bootstrap_stage = {
-	id=b4g ; prev=b3g2 ; lean=2 ;
-	compare_target=compare3-debug ;
-	bootstrap_target=bootstrap4-debug ;
-	stage_configure_flags="@stage2_werror_flag@" ;
-	stage_cflags="$(STAGE4_CFLAGS) -g2" ;
-	stage_libcflags="$(STAGE4_LIBCFLAGS) -g2" ; };
+	bootstrap_target=bootstrap4 ; };
 bootstrap_stage = {
-	id=profile ; prev=1 ;
-	stage_configure_flags="@stage2_werror_flag@" ;
-	stage_cflags='$(STAGE2_CFLAGS) -fprofile-generate' ;
-	stage_libcflags='$(STAGE2_LIBCFLAGS)' ; };
+	id=profile ; prev=1 ; };
 bootstrap_stage = {
 	id=feedback ; prev=profile ;
-	bootstrap_target=profiledbootstrap ;
-	stage_configure_flags="@stage2_werror_flag@" ;
-	stage_cflags='$(STAGE3_CFLAGS) -fprofile-use' ;
-	stage_libcflags='$(STAGE3_LIBCFLAGS) -fprofile-use' ; };
+	bootstrap_target=profiledbootstrap ; };
Index: Makefile.tpl
===================================================================
--- Makefile.tpl.orig	2008-10-03 15:38:23.000000000 -0300
+++ Makefile.tpl	2008-10-07 05:02:35.000000000 -0300
@@ -6,7 +6,8 @@ in
 #
 # Makefile for directory with subdirs to build.
 #   Copyright (C) 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
-#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 Free Software Foundation
+#   1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
+#   Free Software Foundation
 #
 # This file is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -171,6 +172,8 @@ HOST_EXPORTS = \
 	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
 	CXX="$(CXX)"; export CXX; \
 	CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \
+	GCJ="$(GCJ)"; export GCJ; \
+	GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \
 	AR="$(AR)"; export AR; \
 	AS="$(AS)"; export AS; \
 	CC_FOR_BUILD="$(CC_FOR_BUILD)"; export CC_FOR_BUILD; \
@@ -202,11 +205,9 @@ HOST_EXPORTS = \
 POSTSTAGE1_HOST_EXPORTS = \
 	$(HOST_EXPORTS) \
 	CC="$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
-	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/"; export CC; \
-	CC_FOR_BUILD="$(STAGE_CC_WRAPPER) \
-	  $$r/$(HOST_SUBDIR)/prev-gcc/xgcc$(exeext) \
-	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ \
-	  -B$(build_tooldir)/bin/"; export CC_FOR_BUILD; \
+	  -B$$r/$(HOST_SUBDIR)/prev-gcc/ -B$(build_tooldir)/bin/ \
+	  $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
+	CC_FOR_BUILD="$$CC"; export CC_FOR_BUILD; \
 	LDFLAGS="$(BOOT_LDFLAGS)"; export LDFLAGS;
 
 # Target libraries are put under this directory:
@@ -220,13 +221,13 @@ BASE_TARGET_EXPORTS = \
 	$(BASE_EXPORTS) \
 	AR="$(AR_FOR_TARGET)"; export AR; \
 	AS="$(COMPILER_AS_FOR_TARGET)"; export AS; \
-	CC="$(CC_FOR_TARGET)"; export CC; \
-	CFLAGS="$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CC="$(CC_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CC; \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
 	CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \
 	CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \
-	CXXFLAGS="$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; \
-	GCJ="$(GCJ_FOR_TARGET)"; export GCJ; \
-	GFORTRAN="$(GFORTRAN_FOR_TARGET)"; export GFORTRAN; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	GCJ="$(GCJ_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GCJ; \
+	GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \
 	DLLTOOL="$(DLLTOOL_FOR_TARGET)"; export DLLTOOL; \
 	LD="$(COMPILER_LD_FOR_TARGET)"; export LD; \
 	LDFLAGS="$(LDFLAGS_FOR_TARGET)"; export LDFLAGS; \
@@ -242,11 +243,11 @@ BASE_TARGET_EXPORTS = \
 RAW_CXX_TARGET_EXPORTS = \
 	$(BASE_TARGET_EXPORTS) \
 	CXX_FOR_TARGET="$(RAW_CXX_FOR_TARGET)"; export CXX_FOR_TARGET; \
-	CXX="$(RAW_CXX_FOR_TARGET)"; export CXX;
+	CXX="$(RAW_CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
 
 NORMAL_TARGET_EXPORTS = \
 	$(BASE_TARGET_EXPORTS) \
-	CXX="$(CXX_FOR_TARGET)"; export CXX;
+	CXX="$(CXX_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export CXX;
 
 # Where to find GMP
 HOST_GMPLIBS = @gmplibs@
@@ -337,49 +338,65 @@ LIBCFLAGS = $(CFLAGS)
 CXXFLAGS = @CXXFLAGS@
 LIBCXXFLAGS = $(CXXFLAGS) -fno-implicit-templates
 
+TFLAGS =
+
+# Defaults for all stages; some are overridden below.
+
+STAGE_CFLAGS = $(BOOT_CFLAGS)
+STAGE_TFLAGS = $(TFLAGS)
+STAGE_CONFIGURE_FLAGS=@stage2_werror_flag@
+
+[+ FOR bootstrap-stage +]
+# Defaults for stage [+id+]; some are overridden below.
+STAGE[+id+]_CFLAGS = $(STAGE_CFLAGS)
+STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS)
+STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+[+ ENDFOR bootstrap-stage +]
+
 # Only build the C compiler for stage1, because that is the only one that
 # we can guarantee will build with the native compiler, and also it is the
 # only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS),
 # MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them
 # overrideable (for a bootstrap build stage1 also builds gcc.info).
 
+STAGE1_CFLAGS = @stage1_cflags@
 STAGE1_CHECKING=@stage1_checking@
 STAGE1_LANGUAGES=@stage1_languages@
+# * We force-disable intermodule optimizations, even if
+#   --enable-intermodule was passed, since the installed compiler
+#   probably can't handle them.  Luckily, autoconf always respects
+#   the last argument when conflicting --enable arguments are passed.
+# * Likewise, we force-disable coverage flags, since the installed
+#   compiler probably has never heard of them.
+STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
+	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)"
+
+STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
+STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
-STAGE1_CFLAGS=@stage1_cflags@
-STAGE2_CFLAGS=$(BOOT_CFLAGS)
-STAGE3_CFLAGS=$(BOOT_CFLAGS)
-STAGE4_CFLAGS=$(BOOT_CFLAGS)
-
-STAGE1_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
-STAGE2_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
-STAGE3_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
-STAGE4_LIBCFLAGS=$(CFLAGS_FOR_TARGET)
+STAGEfeedback_CFLAGS = $(STAGE3_CFLAGS) -fprofile-use
+STAGEfeedback_TFLAGS = $(STAGE3_TFLAGS)
 
 do-compare = @do_compare@
 do-compare3 = $(do-compare)
-do-compare-debug = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
-do-compare3-debug = $(do-compare-debug)
 
 # -----------------------------------------------
 # Programs producing files for the TARGET machine
 # -----------------------------------------------
 
-FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
-
 AR_FOR_TARGET=@AR_FOR_TARGET@
 AS_FOR_TARGET=@AS_FOR_TARGET@
-CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
+CC_FOR_TARGET=$(STAGE_CC_WRAPPER) @CC_FOR_TARGET@
 
 # If GCC_FOR_TARGET is not overriden on the command line, then this
 # variable is passed down to the gcc Makefile, where it is used to
 # build libgcc2.a.  We define it here so that it can itself be
 # overridden on the command line.
-GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@ $(FLAGS_FOR_TARGET)
-CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
-RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@ $(FLAGS_FOR_TARGET)
-GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@ $(FLAGS_FOR_TARGET)
-GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@ $(FLAGS_FOR_TARGET)
+GCC_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCC_FOR_TARGET@
+CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @CXX_FOR_TARGET@
+RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) @RAW_CXX_FOR_TARGET@
+GCJ_FOR_TARGET=$(STAGE_CC_WRAPPER) @GCJ_FOR_TARGET@
+GFORTRAN_FOR_TARGET=$(STAGE_CC_WRAPPER) @GFORTRAN_FOR_TARGET@
 DLLTOOL_FOR_TARGET=@DLLTOOL_FOR_TARGET@
 LD_FOR_TARGET=@LD_FOR_TARGET@
 
@@ -397,13 +414,17 @@ COMPILER_NM_FOR_TARGET=@COMPILER_NM_FOR_
 
 CFLAGS_FOR_TARGET = @CFLAGS_FOR_TARGET@
 CXXFLAGS_FOR_TARGET = @CXXFLAGS_FOR_TARGET@
-SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
-DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
 
 LIBCFLAGS_FOR_TARGET = $(CFLAGS_FOR_TARGET)
 LIBCXXFLAGS_FOR_TARGET = $(CXXFLAGS_FOR_TARGET) -fno-implicit-templates
 LDFLAGS_FOR_TARGET = 
 
+FLAGS_FOR_TARGET = @FLAGS_FOR_TARGET@
+SYSROOT_CFLAGS_FOR_TARGET = @SYSROOT_CFLAGS_FOR_TARGET@
+DEBUG_PREFIX_CFLAGS_FOR_TARGET = @DEBUG_PREFIX_CFLAGS_FOR_TARGET@
+
+XGCC_FLAGS_FOR_TARGET = $(FLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)
+
 # ------------------------------------
 # Miscellaneous targets and flag lists
 # ------------------------------------
@@ -453,7 +474,10 @@ HOST_LIB_PATH_[+module+] = \
 # Flags to pass down to all sub-makes.
 BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \
 	"`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \
-	"[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +] \
+	"[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +][+ FOR bootstrap-stage +] \
+	"STAGE[+id+]_CFLAGS=$(STAGE[+id+]_CFLAGS)" \
+	"STAGE[+id+]_TFLAGS=$(STAGE[+id+]_TFLAGS)"[+ ENDFOR bootstrap-stage +] \
+	"TFLAGS=$(TFLAGS)" \
 	"CONFIG_SHELL=$(SHELL)" \
 	"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" 
 
@@ -468,6 +492,8 @@ EXTRA_HOST_FLAGS = \
 	'CC=$(CC)' \
 	'CXX=$(CXX)' \
 	'DLLTOOL=$(DLLTOOL)' \
+	'GCJ=$(GCJ)' \
+	'GFORTRAN=$(GFORTRAN)' \
 	'LD=$(LD)' \
 	'LIPO=$(LIPO)' \
 	'NM=$(NM)' \
@@ -507,20 +533,24 @@ POSTSTAGE1_FLAGS_TO_PASS = \
 EXTRA_TARGET_FLAGS = \
 	'AR=$$(AR_FOR_TARGET)' \
 	'AS=$(COMPILER_AS_FOR_TARGET)' \
-	'CC=$$(CC_FOR_TARGET)' \
-	'CFLAGS=$$(CFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
-	'CXX=$$(CXX_FOR_TARGET)' \
-	'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
+	'CC=$$(CC_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+	'CFLAGS=$$(CFLAGS_FOR_TARGET)' \
+	'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+	'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \
 	'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \
+	'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
+	'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \
 	'LD=$(COMPILER_LD_FOR_TARGET)' \
 	'LDFLAGS=$$(LDFLAGS_FOR_TARGET)' \
-	'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
-	'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET) $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)' \
+	'LIBCFLAGS=$$(LIBCFLAGS_FOR_TARGET)' \
+	'LIBCXXFLAGS=$$(LIBCXXFLAGS_FOR_TARGET)' \
 	'NM=$(COMPILER_NM_FOR_TARGET)' \
 	'OBJDUMP=$$(OBJDUMP_FOR_TARGET)' \
 	'RANLIB=$$(RANLIB_FOR_TARGET)' \
 	'WINDRES=$$(WINDRES_FOR_TARGET)' \
-	'WINDMC=$$(WINDMC_FOR_TARGET)'
+	'WINDMC=$$(WINDMC_FOR_TARGET)' \
+	'XGCC_FLAGS_FOR_TARGET=$(XGCC_FLAGS_FOR_TARGET)' \
+	"TFLAGS=$$TFLAGS"
 
 TARGET_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_TARGET_FLAGS)
 
@@ -540,6 +570,13 @@ EXTRA_GCC_FLAGS = \
 
 GCC_FLAGS_TO_PASS = $(BASE_FLAGS_TO_PASS) $(EXTRA_HOST_FLAGS) $(EXTRA_GCC_FLAGS)
 
+@if gcc
+BUILD_CONFIG =
+ifneq ($(BUILD_CONFIG),)
+include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
+endif
+@endif gcc
+
 .PHONY: configure-host
 configure-host: [+
   FOR host_modules +] \
@@ -563,11 +600,17 @@ all:
 	@: $(MAKE); $(unstage)
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	if [ -f stage_last ]; then \
+@if gcc-bootstrap
+	if [ -f stage_last ]; then : ; \
+	  TFLAGS="$(STAGE$(shell sed s,^stage,, stage_last)_TFLAGS)"; \
 	  $(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target; \
 	else \
+@endif gcc-bootstrap
 	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-host all-target; \
-	fi
+@if gcc-bootstrap
+	fi; \
+@endif gcc-bootstrap
+	:
 
 .PHONY: all-build
 [+ FOR build_modules +]
@@ -848,6 +891,7 @@ configure-stage[+id+]-[+prefix+][+module
 	@$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+]
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
 	[+ IF check_multilibs
 	+]echo "Checking multilib configuration for [+module+]..."; \
 	$(CC_FOR_TARGET) --print-multi-lib > [+subdir+]/[+module+]/multilib.tmp 2> /dev/null ; \
@@ -863,11 +907,14 @@ configure-stage[+id+]-[+prefix+][+module
 	fi; \
 	[+ ENDIF check_multilibs +]test ! -f [+subdir+]/[+module+]/Makefile || exit 0; \
 	[+exports+][+ IF prev +] \
-	[+poststage1_exports+][+ ENDIF prev +] [+ IF prefix +] \
-	CFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CFLAGS; \
-	CXXFLAGS="[+stage_libcflags+] $(SYSROOT_CFLAGS_FOR_TARGET) $(DEBUG_PREFIX_CFLAGS_FOR_TARGET)"; export CXXFLAGS; [+ ELSE +] \
-	CFLAGS="[+stage_cflags+]"; export CFLAGS; \
-	CXXFLAGS="[+stage_cflags+]"; export CXXFLAGS; [+ ENDIF +] \
+	[+poststage1_exports+][+ ENDIF prev +][+ IF prefix +] \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;[+ ELSE prefix +] \
+	CFLAGS="$(STAGE[+id+]_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGE[+id+]_CFLAGS)"; export CXXFLAGS;[+ IF prev +] \
+	LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
+	LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +]; export LIBCFLAGS;[+ ENDIF prefix +] \
 	echo Configuring stage [+id+] in [+subdir+]/[+module+] ; \
 	$(SHELL) $(srcdir)/mkinstalldirs [+subdir+]/[+module+] ; \
 	cd [+subdir+]/[+module+] || exit 1; \
@@ -880,9 +927,10 @@ configure-stage[+id+]-[+prefix+][+module
 	libsrcdir="$$s/[+module+]"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  [+args+] --build=${build_alias} --host=[+host_alias+] \
-	  --target=[+target_alias+] $${srcdiroption} \
-	  [+ IF prev +]--with-build-libsubdir=$(HOST_SUBDIR)[+ ENDIF prev +] \
-	  [+stage_configure_flags+] [+extra_configure_flags+]
+	  --target=[+target_alias+] $${srcdiroption} [+ IF prev +]\
+	  --with-build-libsubdir=$(HOST_SUBDIR) [+ ENDIF prev +]\
+	  $(STAGE[+id+]_CONFIGURE_FLAGS)[+ IF extra_configure_flags +] \
+	  [+extra_configure_flags+][+ ENDIF extra_configure_flags +]
 @endif [+prefix+][+module+]-bootstrap
 [+ ENDFOR bootstrap_stage +]
 [+ ENDIF bootstrap +]
@@ -922,16 +970,25 @@ all-stage[+id+]-[+prefix+][+module+]: co
 	@[ $(current_stage) = stage[+id+] ] || $(MAKE) stage[+id+]-start
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
 	[+exports+][+ IF prev +] \
 	[+poststage1_exports+][+ ENDIF prev +] \
 	cd [+subdir+]/[+module+] && \
-	$(MAKE) $(BASE_FLAGS_TO_PASS) \
-		CFLAGS="[+stage_cflags+]" CXXFLAGS="[+stage_cflags+]" \
-		LIBCFLAGS="[+stage_libcflags+]" \
-		CFLAGS_FOR_TARGET="[+stage_libcflags+]" \
-		CXXFLAGS_FOR_TARGET="[+stage_libcflags+]" [+args+] [+
+	$(MAKE) $(BASE_FLAGS_TO_PASS)[+ IF prefix +] \
+		CFLAGS="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"[+ ELSE prefix +] \
+		CFLAGS="$(STAGE[+id+]_CFLAGS)" \
+		CXXFLAGS="$(STAGE[+id+]_CFLAGS)"[+ IF prev +] \
+		LIBCFLAGS="$(STAGE[+id+]_CFLAGS)"[+ ELSE prev +] \
+		LIBCFLAGS="$(LIBCFLAGS)"[+ ENDIF prev +][+ ENDIF prefix +] \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		[+args+] [+
 		IF prev +][+poststage1_args+][+ ENDIF prev
 		+] [+extra_make_flags+] \
+		TFLAGS="$(STAGE[+id+]_TFLAGS)" \
 		$(TARGET-stage[+id+]-[+prefix+][+module+])
 
 maybe-clean-stage[+id+]-[+prefix+][+module+]: clean-stage[+id+]-[+prefix+][+module+]
@@ -1394,6 +1451,7 @@ do-clean: clean-stage[+id+]
 	@: $(MAKE); $(unstage)
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
 	$(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
 
 [+bootstrap-target+]-lean:
@@ -1404,6 +1462,7 @@ do-clean: clean-stage[+id+]
 	@: $(MAKE); $(unstage)
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
 	$(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
 [+ ENDIF bootstrap-target +]
 
@@ -1426,6 +1485,7 @@ distclean-stage[+id+]::
 	@: $(MAKE); $(unstage)
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGE[+id+]_TFLAGS)"; \
 	$(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
 [+ ENDIF cleanstrap-target +]
 @endif gcc-bootstrap
@@ -1461,8 +1521,8 @@ stage_current:
 .PHONY: restrap
 restrap::
 	@: $(MAKE); $(stage)
-	rm -rf stage1-$(TARGET_SUBDIR) [+ FOR bootstrap-stage +][+ IF prev
-	  +]stage[+id+]-* [+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
+	rm -rf stage1-$(TARGET_SUBDIR)[+ FOR bootstrap-stage +][+ IF prev
+	  +] stage[+id+]-*[+ ENDIF prev +][+ ENDFOR bootstrap-stage +]
 restrap:: all
 @endif gcc-bootstrap
 
@@ -1629,53 +1689,6 @@ configure-gdb: $(CONFIGURE_GDB_TK)
 all-gdb: $(gdbnlmrequirements) $(GDB_TK)
 install-gdb: $(INSTALL_GDB_TK)
 
-@if gcc-bootstrap
-bootstrap4-debug-init = stgsrc=stageb3g2 stgdst=stageb4g
-bootstrap4-debug-lib-gcc-clean = stamp-gnatlib* stamp-tools ada/rts
-
-cp-lR = cp -lR
-
-.PHONY: prepare-bootstrap4-debug-lib
-prepare-bootstrap4-debug-lib:
-	@r=`${PWD_COMMAND}`; export r; \
-	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	: $(MAKE); $(stage); \
-	$(bootstrap4-debug-init) didgcc=false; \
-	for d3 in $$stgsrc-*; do \
-	  case $$d3 in "$$stgsrc-$(TARGET_SUBDIR)") continue ;; esac; \
-	  d4=`echo $$d3 | sed s,^$$stgsrc,$$stgdst,`; \
-	  if test -d $$d4; then \
-	    echo $$d4 already set up, skipping...; \
-	    continue; \
-	  fi; \
-	  d4t=$$d4.tmp; \
-	  rm -rf $$d4t || :; \
-	  $(cp-lR) $$d3/. $$d4t; \
-	  case $$d3 in "$$stgsrc-gcc") \
-	    (cd $$d4t && rm -rf $(bootstrap4-debug-lib-gcc-clean)) || :;; \
-	  esac; \
-	  mv $$d4t $$d4; \
-	done
-
-.PHONY: clean-bootstrap4-debug-lib
-clean-bootstrap4-debug-lib: prepare-bootstrap4-debug-lib
-	@$(bootstrap4-debug-init); \
-	rm -rf $$stgdst-$(TARGET_SUBDIR) || :; \
-	(cd $$stgdst-gcc && rm -rf $(bootstrap4-debug-lib-gcc-clean)) || :
-
-sed-script-prepare-bootstrap4-debug-lib-g0 = 's,%{g\*},,'
-sed-script-prepare-bootstrap4-debug-lib-novta = 's,%{g\*},& %{!fvar-tracking-assignments:%{!fno-var-tracking-assignments:-fno-var-tracking-assignments}},'
-sed-script-prepare-bootstrap4-debug-lib-custom = 's,x,x,'
-
-.PHONY: prepare-bootstrap4-debug-lib-g0 prepare-bootstrap4-debug-lib-novta prepare-bootstrap4-debug-lib-custom
-prepare-bootstrap4-debug-lib-g0 prepare-bootstrap4-debug-lib-novta \
-prepare-bootstrap4-debug-lib-custom: prepare-bootstrap4-debug-lib
-	@$(bootstrap4-debug-init); \
-	rm -f $$stgdst-gcc/specs; \
-	sed $(sed-script-$@) < $$stgsrc-gcc/specs > $$stgdst-gcc/specs
-
-@endif gcc-bootstrap
-
 # Serialization dependencies.  Host configures don't work well in parallel to
 # each other, due to contention over config.cache.  Target configures and 
 # build configures are similar.
Index: config/mt-gnu
===================================================================
--- config/mt-gnu.orig	2008-10-03 15:38:23.000000000 -0300
+++ config/mt-gnu	2008-10-07 05:02:35.000000000 -0300
@@ -1,2 +1 @@
-CXXFLAGS_FOR_TARGET = $(CXXFLAGS) $(SYSROOT_CFLAGS_FOR_TARGET) \
-	$(DEBUG_PREFIX_CFLAGS_FOR_TARGET) -D_GNU_SOURCE
+CXXFLAGS_FOR_TARGET = $(CXXFLAGS) -D_GNU_SOURCE
Index: config/bootstrap-O1.mk
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ config/bootstrap-O1.mk	2008-10-07 05:02:35.000000000 -0300
@@ -0,0 +1 @@
+BOOT_CFLAGS := -O1 $(filter-out -O%, $(BOOT_CFLAGS))
Index: config/bootstrap-O3.mk
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ config/bootstrap-O3.mk	2008-10-07 05:02:35.000000000 -0300
@@ -0,0 +1 @@
+BOOT_CFLAGS := -O3 $(filter-out -O%, $(BOOT_CFLAGS))
Index: config/bootstrap-time.mk
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ config/bootstrap-time.mk	2008-10-07 05:02:35.000000000 -0300
@@ -0,0 +1,2 @@
+BOOT_CFLAGS += -time=$(shell pwd)/time.log
+TFLAGS += -time=$(shell pwd)/time.log
Index: config/bootstrap-debug.mk
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ config/bootstrap-debug.mk	2008-10-07 05:02:35.000000000 -0300
@@ -0,0 +1,2 @@
+STAGE2_CFLAGS += -gtoggle
+do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
Index: config/bootstrap-debug-ckovw.mk
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ config/bootstrap-debug-ckovw.mk	2008-10-07 05:02:35.000000000 -0300
@@ -0,0 +1,12 @@
+# These arrange for a simple warning to be issued if -fcompare-debug
+# is not given.
+# BOOT_CFLAGS += -fcompare-debug="-w%n-fcompare-debug not overridden"
+# TFLAGS += -fcompare-debug="-w%n-fcompare-debug not overridden"
+
+# GCC_COMPARE_DEBUG="-w%n-fcompare-debug not overridden";
+
+FORCE_COMPARE_DEBUG = \
+	GCC_COMPARE_DEBUG=$${GCC_COMPARE_DEBUG--fcompare-debug-not-overridden}; \
+	export GCC_COMPARE_DEBUG;
+POSTSTAGE1_HOST_EXPORTS += $(FORCE_COMPARE_DEBUG)
+BASE_TARGET_EXPORTS += $(FORCE_COMPARE_DEBUG)
Index: config/bootstrap-debug-lib.mk
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ config/bootstrap-debug-lib.mk	2008-10-07 05:02:35.000000000 -0300
@@ -0,0 +1,12 @@
+# Stage1 compiler may not support this flag.
+# STAGE1_CFLAGS += -fcompare-debug=-gtoggle
+STAGE2_CFLAGS += -gtoggle -fcompare-debug=
+STAGE3_CFLAGS += -fcompare-debug=-gtoggle
+STAGE4_CFLAGS += -fcompare-debug=-fvar-tracking-assignments-toggle
+# This might be enough after testing:
+# TFLAGS += -fcompare-debug=-g0
+STAGE1_TFLAGS += -gtoggle -fcompare-debug=
+STAGE2_TFLAGS += -fcompare-debug=-fvar-tracking-assignments-toggle
+STAGE3_TFLAGS += -fcompare-debug=-gtoggle
+STAGE4_TFLAGS += -fcompare-debug=-fvar-tracking-assignments-toggle
+do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
Index: libjava/configure.ac
===================================================================
--- libjava/configure.ac.orig	2008-10-03 15:38:23.000000000 -0300
+++ libjava/configure.ac	2008-10-07 05:02:35.000000000 -0300
@@ -352,23 +352,30 @@ else
      which_gcj=path
   fi
 fi
+libgcjdir=`${PWDCMD-pwd}`
+case $libgcjdir in
+*,*) libgcjdir=`echo "$libgcjdir" | sed 's:,:\\,:g'`;;
+esac
+case $GCJ in
+*" -B"*)
+  GCJ=`echo "$GCJ" | sed "s, -B, -B$libgcjdir/&,"`
+  ;;
+*)
+  GCJ=$GCJ" -B$libgcjdir/"
+  ;;
+esac
 case "${which_gcj}" in
    built)
-      GCJ="$built_gcc_dir/gcj -B`${PWDCMD-pwd}`/ -B$built_gcc_dir/"
       GCJH='$(top_builddir)/$(MULTIBUILDTOP)../../$(host_subdir)/gcc/gcjh'
    ;;
    cross)
       if test "x${with_newlib}" = "xyes"; then
          # FIXME (comment): Why is this needed?
          GCC_UNWIND_INCLUDE=
-         GCJ="${target_noncanonical}-gcj"
-      else
-         GCJ="${target_noncanonical}-gcj -B`${PWDCMD-pwd}`/"
       fi
       GCJH='$(target_noncanonical)-gcjh'
    ;;
    path)
-      GCJ="gcj -B`${PWDCMD-pwd}`/"
       GCJH=gcjh
    ;;
 esac
Index: gcc/java/Make-lang.in
===================================================================
--- gcc/java/Make-lang.in.orig	2008-10-03 15:38:23.000000000 -0300
+++ gcc/java/Make-lang.in	2008-10-07 05:02:36.000000000 -0300
@@ -44,10 +44,10 @@
 JAVA_INSTALL_NAME := $(shell echo gcj|sed '$(program_transform_name)')
 JAVA_TARGET_INSTALL_NAME := $(target_noncanonical)-$(shell echo gcj|sed '$(program_transform_name)')
 
-GCJ = gcj
+XGCJ = gcj
 
 # Define the names for selecting java in LANGUAGES.
-java: jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) jcf-dump$(exeext)
+java: jc1$(exeext) $(XGCJ)$(exeext) jvgenmain$(exeext) jcf-dump$(exeext)
 
 # Define the name of target independent tools to be installed in $(bindir)
 # Names are subject to changes
@@ -62,17 +62,17 @@ jvspec.o: $(srcdir)/java/jvspec.c $(SYST
 	$(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(DRIVER_DEFINES) \
 		$(INCLUDES) $(srcdir)/java/jvspec.c $(OUTPUT_OPTION))
 
-# Create the compiler driver for $(GCJ).
-$(GCJ)$(exeext): $(GCC_OBJS) jvspec.o java/jcf-path.o version.o \
+# Create the compiler driver for $(XGCJ).
+$(XGCJ)$(exeext): $(GCC_OBJS) jvspec.o java/jcf-path.o version.o \
 	   prefix.o intl.o $(LIBDEPS) $(EXTRA_GCC_OBJS)
 	$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ $(GCC_OBJS) jvspec.o \
 	  java/jcf-path.o prefix.o intl.o \
 	  version.o $(EXTRA_GCC_OBJS) $(LIBS)
 
-# Create a version of the $(GCJ) driver which calls the cross-compiler.
-$(GCJ)-cross$(exeext): $(GCJ)$(exeext)
-	-rm -f $(GCJ)-cross$(exeext)
-	cp $(GCJ)$(exeext) $(GCJ)-cross$(exeext)
+# Create a version of the $(XGCJ) driver which calls the cross-compiler.
+$(XGCJ)-cross$(exeext): $(XGCJ)$(exeext)
+	-rm -f $(XGCJ)-cross$(exeext)
+	cp $(XGCJ)$(exeext) $(XGCJ)-cross$(exeext)
 
 java.srcextra:
 
@@ -115,8 +115,8 @@ jvgenmain$(exeext): $(JVGENMAIN_OBJS) $(
 #\f
 # Build hooks:
 
-java.all.cross: $(GCJ)-cross$(exeext)
-java.start.encap: $(GCJ)$(exeext)
+java.all.cross: $(XGCJ)-cross$(exeext)
+java.start.encap: $(XGCJ)$(exeext)
 java.rest.encap:
 
 
@@ -157,11 +157,11 @@ check-java :
 
 # Install gcj as well as the target-independent tools.
 java.install-common: installdirs
-	-if [ -f $(GCJ)$(exeext) ]; then \
+	-if [ -f $(XGCJ)$(exeext) ]; then \
 	  rm -f $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
-	  $(INSTALL_PROGRAM) $(GCJ)$(exeext) $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
+	  $(INSTALL_PROGRAM) $(XGCJ)$(exeext) $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
 	  chmod a+x $(DESTDIR)$(bindir)/$(JAVA_INSTALL_NAME)$(exeext); \
-	  if [ -f $(GCJ)-cross$(exeext) ]; then \
+	  if [ -f $(XGCJ)-cross$(exeext) ]; then \
 	    true; \
 	  else \
 	    rm -f $(DESTDIR)$(bindir)/$(JAVA_TARGET_INSTALL_NAME)$(exeext); \
@@ -210,7 +210,7 @@ java.install-pdf: $(JAVA_PDFFILES)
 java.mostlyclean:
 	-rm -f java/*$(objext) $(DEMANGLER_PROG)
 	-rm -f java/*$(coverageexts)
-	-rm -f jc1$(exeext) $(GCJ)$(exeext) jvgenmain$(exeext) \
+	-rm -f jc1$(exeext) $(XGCJ)$(exeext) jvgenmain$(exeext) \
           jcf-dump$(exeext) s-java
 java.clean:
 java.distclean:

[-- Attachment #3: Type: text/plain, Size: 257 bytes --]


-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}
FSFLA Board Member       ¡Sé Libre! => http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2009-05-12  5:48 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-10-07  8:31 [vta] revamp bootstrap-debug with -fcompare-debug, fix LIBCFLAGS uses Alexandre Oliva
2008-10-07  8:41 ` Ralf Wildenhues
2008-10-07  9:01   ` Andreas Schwab
2008-10-07 18:09   ` Alexandre Oliva
2008-10-10 13:42     ` Alexandre Oliva
2008-10-07  9:41 ` Paolo Bonzini
2009-05-12  5:48   ` Alexandre Oliva
2008-10-08  2:27 ` Adam Nemet
2008-10-10  9:23   ` Alexandre Oliva

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).