public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.
@ 2017-05-25 10:00 Martin Liška
  2017-05-25 10:00 ` Martin Liška
                   ` (3 more replies)
  0 siblings, 4 replies; 32+ messages in thread
From: Martin Liška @ 2017-05-25 10:00 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener, Jan Hubicka

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

Hi.

As I spoke about the PGO with Honza and Richi, current 3-stage is not ideal for following
2 reasons:

1) stageprofile compiler is train just on libraries that are built during stage2
2) apart from that, as the compiler is also used to build the final compiler, profile
is being updated during the build. So the stage2 compiler is making different decisions.

Both problems can be resolved by adding another step in between current stage2 and stage3
where we train stage2 compiler by building compiler with default options.

I'm going to do some measurements.

Ready for trunk?
Martin

[-- Attachment #2: 0001-Introduce-4-stages-profiledbootstrap-to-get-a-better.patch --]
[-- Type: text/x-patch, Size: 2954 bytes --]

From 0a9c9a7f7d335e5e053ab37c5649371996e95325 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 25 May 2017 11:35:29 +0200
Subject: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.

gcc/ChangeLog:

2017-05-25  Martin Liska  <mliska@suse.cz>

	* doc/install.texi: Document that PGO runs in 4 stages.

ChangeLog:

2017-05-25  Martin Liska  <mliska@suse.cz>

	* Makefile.def: Define 4 stages PGO bootstrap.
	* Makefile.tpl: Define FLAGS.
	* Makefile.in: Regenerate.
---
 Makefile.in          | 7 +++++--
 Makefile.tpl         | 7 +++++--
 gcc/doc/install.texi | 5 +++--
 3 files changed, 13 insertions(+), 6 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index b824e0a0ca1..75e5a1a912b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -522,8 +522,11 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
-STAGEfeedback_CFLAGS = $(STAGE3_CFLAGS) -fprofile-use
-STAGEfeedback_TFLAGS = $(STAGE3_TFLAGS)
+STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
+STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
+
+STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
+STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
 
 STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
 STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
diff --git a/Makefile.tpl b/Makefile.tpl
index d0fa07005be..5fcd7e358d9 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -455,8 +455,11 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
-STAGEfeedback_CFLAGS = $(STAGE3_CFLAGS) -fprofile-use
-STAGEfeedback_TFLAGS = $(STAGE3_TFLAGS)
+STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
+STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
+
+STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
+STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
 
 STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
 STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index b13fc1f6f42..386771872ba 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2611,8 +2611,9 @@ bootstrap the compiler with profile feedback, use @code{make profiledbootstrap}.
 When @samp{make profiledbootstrap} is run, it will first build a @code{stage1}
 compiler.  This compiler is used to build a @code{stageprofile} compiler
 instrumented to collect execution counts of instruction and branch
-probabilities.  Then runtime libraries are compiled with profile collected.
-Finally a @code{stagefeedback} compiler is built using the information collected.
+probabilities.  Training run is done by building @code{stagetrain}
+compiler.  Finally a @code{stagefeedback} compiler is built
+using the information collected.
 
 Unlike standard bootstrap, several additional restrictions apply.  The
 compiler used to build @code{stage1} needs to support a 64-bit integral type.
-- 
2.12.2


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

* Re: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.
  2017-05-25 10:00 [PATCH] Introduce 4-stages profiledbootstrap to get a better profile Martin Liška
@ 2017-05-25 10:00 ` Martin Liška
  2017-05-25 11:38 ` Markus Trippelsdorf
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 32+ messages in thread
From: Martin Liška @ 2017-05-25 10:00 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener, Jan Hubicka

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

I added not complete patch, fixed.

Martin

[-- Attachment #2: 0001-Introduce-4-stages-profiledbootstrap-to-get-a-better.patch --]
[-- Type: text/x-patch, Size: 183732 bytes --]

From 33affadc1ab47b551ed19ac118f8ae8b3ca7bec3 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 25 May 2017 11:35:29 +0200
Subject: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.

gcc/ChangeLog:

2017-05-25  Martin Liska  <mliska@suse.cz>

	* doc/install.texi: Document that PGO runs in 4 stages.

ChangeLog:

2017-05-25  Martin Liska  <mliska@suse.cz>

	* Makefile.def: Define 4 stages PGO bootstrap.
	* Makefile.tpl: Define FLAGS.
	* Makefile.in: Regenerate.
---
 Makefile.def         |    5 +-
 Makefile.in          | 2749 +++++++++++++++++++++++++++++++++++++++++++++++++-
 Makefile.tpl         |    7 +-
 gcc/doc/install.texi |    5 +-
 4 files changed, 2709 insertions(+), 57 deletions(-)

diff --git a/Makefile.def b/Makefile.def
index abfa9efe959..13a6e513b1a 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -622,7 +622,10 @@ bootstrap_stage = {
 bootstrap_stage = {
 	id=profile ; prev=1 ; };
 bootstrap_stage = {
-	id=feedback ; prev=profile ;
+	id=train; prev=profile ;
+	bootstrap_target=profiledbootstrap ; };
+bootstrap_stage = {
+	id=feedback ; prev=train;
 	bootstrap_target=profiledbootstrap ; };
 bootstrap_stage = {
 	id=autoprofile ; prev=1 ;
diff --git a/Makefile.in b/Makefile.in
index b824e0a0ca1..dfb4188ba2e 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -470,6 +470,16 @@ STAGEprofile_CXXFLAGS = $(STAGEprofile_CFLAGS)
 STAGEprofile_TFLAGS = $(STAGE_TFLAGS)
 STAGEprofile_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
 
+# Defaults for stage train; some are overridden below.
+STAGEtrain_CFLAGS = $(STAGE_CFLAGS)
+STAGEtrain_CXXFLAGS = $(CXXFLAGS)
+@if target-libstdc++-v3-bootstrap
+# Override the above if we're bootstrapping C++.
+STAGEtrain_CXXFLAGS = $(STAGEtrain_CFLAGS)
+@endif target-libstdc++-v3-bootstrap
+STAGEtrain_TFLAGS = $(STAGE_TFLAGS)
+STAGEtrain_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS)
+
 # Defaults for stage feedback; some are overridden below.
 STAGEfeedback_CFLAGS = $(STAGE_CFLAGS)
 STAGEfeedback_CXXFLAGS = $(CXXFLAGS)
@@ -522,8 +532,11 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
-STAGEfeedback_CFLAGS = $(STAGE3_CFLAGS) -fprofile-use
-STAGEfeedback_TFLAGS = $(STAGE3_TFLAGS)
+STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
+STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
+
+STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
+STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
 
 STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
 STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
@@ -805,6 +818,9 @@ BASE_FLAGS_TO_PASS = \
 	"STAGEprofile_CFLAGS=$(STAGEprofile_CFLAGS)" \
 	"STAGEprofile_CXXFLAGS=$(STAGEprofile_CXXFLAGS)" \
 	"STAGEprofile_TFLAGS=$(STAGEprofile_TFLAGS)" \
+	"STAGEtrain_CFLAGS=$(STAGEtrain_CFLAGS)" \
+	"STAGEtrain_CXXFLAGS=$(STAGEtrain_CXXFLAGS)" \
+	"STAGEtrain_TFLAGS=$(STAGEtrain_TFLAGS)" \
 	"STAGEfeedback_CFLAGS=$(STAGEfeedback_CFLAGS)" \
 	"STAGEfeedback_CXXFLAGS=$(STAGEfeedback_CXXFLAGS)" \
 	"STAGEfeedback_TFLAGS=$(STAGEfeedback_TFLAGS)" \
@@ -3367,6 +3383,39 @@ configure-stageprofile-bfd:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif bfd-bootstrap
 
+.PHONY: configure-stagetrain-bfd maybe-configure-stagetrain-bfd
+maybe-configure-stagetrain-bfd:
+@if bfd-bootstrap
+maybe-configure-stagetrain-bfd: configure-stagetrain-bfd
+configure-stagetrain-bfd:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/bfd/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/bfd; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/bfd; \
+	cd $(HOST_SUBDIR)/bfd || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/bfd/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=bfd; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif bfd-bootstrap
+
 .PHONY: configure-stagefeedback-bfd maybe-configure-stagefeedback-bfd
 maybe-configure-stagefeedback-bfd:
 @if bfd-bootstrap
@@ -3700,6 +3749,48 @@ clean-stageprofile-bfd:
 @endif bfd-bootstrap
 
 
+.PHONY: all-stagetrain-bfd maybe-all-stagetrain-bfd
+.PHONY: clean-stagetrain-bfd maybe-clean-stagetrain-bfd
+maybe-all-stagetrain-bfd:
+maybe-clean-stagetrain-bfd:
+@if bfd-bootstrap
+maybe-all-stagetrain-bfd: all-stagetrain-bfd
+all-stagetrain: all-stagetrain-bfd
+TARGET-stagetrain-bfd = $(TARGET-bfd)
+all-stagetrain-bfd: configure-stagetrain-bfd
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/bfd && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-bfd)
+
+maybe-clean-stagetrain-bfd: clean-stagetrain-bfd
+clean-stagetrain: clean-stagetrain-bfd
+clean-stagetrain-bfd:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/bfd/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-bfd/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/bfd && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif bfd-bootstrap
+
+
 .PHONY: all-stagefeedback-bfd maybe-all-stagefeedback-bfd
 .PHONY: clean-stagefeedback-bfd maybe-clean-stagefeedback-bfd
 maybe-all-stagefeedback-bfd:
@@ -4397,6 +4488,39 @@ configure-stageprofile-opcodes:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif opcodes-bootstrap
 
+.PHONY: configure-stagetrain-opcodes maybe-configure-stagetrain-opcodes
+maybe-configure-stagetrain-opcodes:
+@if opcodes-bootstrap
+maybe-configure-stagetrain-opcodes: configure-stagetrain-opcodes
+configure-stagetrain-opcodes:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/opcodes/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/opcodes; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/opcodes; \
+	cd $(HOST_SUBDIR)/opcodes || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/opcodes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=opcodes; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif opcodes-bootstrap
+
 .PHONY: configure-stagefeedback-opcodes maybe-configure-stagefeedback-opcodes
 maybe-configure-stagefeedback-opcodes:
 @if opcodes-bootstrap
@@ -4730,6 +4854,48 @@ clean-stageprofile-opcodes:
 @endif opcodes-bootstrap
 
 
+.PHONY: all-stagetrain-opcodes maybe-all-stagetrain-opcodes
+.PHONY: clean-stagetrain-opcodes maybe-clean-stagetrain-opcodes
+maybe-all-stagetrain-opcodes:
+maybe-clean-stagetrain-opcodes:
+@if opcodes-bootstrap
+maybe-all-stagetrain-opcodes: all-stagetrain-opcodes
+all-stagetrain: all-stagetrain-opcodes
+TARGET-stagetrain-opcodes = $(TARGET-opcodes)
+all-stagetrain-opcodes: configure-stagetrain-opcodes
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/opcodes && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-opcodes)
+
+maybe-clean-stagetrain-opcodes: clean-stagetrain-opcodes
+clean-stagetrain: clean-stagetrain-opcodes
+clean-stagetrain-opcodes:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/opcodes/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-opcodes/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/opcodes && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif opcodes-bootstrap
+
+
 .PHONY: all-stagefeedback-opcodes maybe-all-stagefeedback-opcodes
 .PHONY: clean-stagefeedback-opcodes maybe-clean-stagefeedback-opcodes
 maybe-all-stagefeedback-opcodes:
@@ -5427,6 +5593,39 @@ configure-stageprofile-binutils:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif binutils-bootstrap
 
+.PHONY: configure-stagetrain-binutils maybe-configure-stagetrain-binutils
+maybe-configure-stagetrain-binutils:
+@if binutils-bootstrap
+maybe-configure-stagetrain-binutils: configure-stagetrain-binutils
+configure-stagetrain-binutils:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/binutils/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/binutils; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/binutils; \
+	cd $(HOST_SUBDIR)/binutils || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/binutils/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=binutils; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif binutils-bootstrap
+
 .PHONY: configure-stagefeedback-binutils maybe-configure-stagefeedback-binutils
 maybe-configure-stagefeedback-binutils:
 @if binutils-bootstrap
@@ -5760,6 +5959,48 @@ clean-stageprofile-binutils:
 @endif binutils-bootstrap
 
 
+.PHONY: all-stagetrain-binutils maybe-all-stagetrain-binutils
+.PHONY: clean-stagetrain-binutils maybe-clean-stagetrain-binutils
+maybe-all-stagetrain-binutils:
+maybe-clean-stagetrain-binutils:
+@if binutils-bootstrap
+maybe-all-stagetrain-binutils: all-stagetrain-binutils
+all-stagetrain: all-stagetrain-binutils
+TARGET-stagetrain-binutils = $(TARGET-binutils)
+all-stagetrain-binutils: configure-stagetrain-binutils
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/binutils && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-binutils)
+
+maybe-clean-stagetrain-binutils: clean-stagetrain-binutils
+clean-stagetrain: clean-stagetrain-binutils
+clean-stagetrain-binutils:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/binutils/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-binutils/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/binutils && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif binutils-bootstrap
+
+
 .PHONY: all-stagefeedback-binutils maybe-all-stagefeedback-binutils
 .PHONY: clean-stagefeedback-binutils maybe-clean-stagefeedback-binutils
 maybe-all-stagefeedback-binutils:
@@ -8668,6 +8909,39 @@ configure-stageprofile-fixincludes:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif fixincludes-bootstrap
 
+.PHONY: configure-stagetrain-fixincludes maybe-configure-stagetrain-fixincludes
+maybe-configure-stagetrain-fixincludes:
+@if fixincludes-bootstrap
+maybe-configure-stagetrain-fixincludes: configure-stagetrain-fixincludes
+configure-stagetrain-fixincludes:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fixincludes
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/fixincludes/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/fixincludes; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/fixincludes; \
+	cd $(HOST_SUBDIR)/fixincludes || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/fixincludes/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=fixincludes; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif fixincludes-bootstrap
+
 .PHONY: configure-stagefeedback-fixincludes maybe-configure-stagefeedback-fixincludes
 maybe-configure-stagefeedback-fixincludes:
 @if fixincludes-bootstrap
@@ -9001,6 +9275,48 @@ clean-stageprofile-fixincludes:
 @endif fixincludes-bootstrap
 
 
+.PHONY: all-stagetrain-fixincludes maybe-all-stagetrain-fixincludes
+.PHONY: clean-stagetrain-fixincludes maybe-clean-stagetrain-fixincludes
+maybe-all-stagetrain-fixincludes:
+maybe-clean-stagetrain-fixincludes:
+@if fixincludes-bootstrap
+maybe-all-stagetrain-fixincludes: all-stagetrain-fixincludes
+all-stagetrain: all-stagetrain-fixincludes
+TARGET-stagetrain-fixincludes = $(TARGET-fixincludes)
+all-stagetrain-fixincludes: configure-stagetrain-fixincludes
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/fixincludes && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-fixincludes)
+
+maybe-clean-stagetrain-fixincludes: clean-stagetrain-fixincludes
+clean-stagetrain: clean-stagetrain-fixincludes
+clean-stagetrain-fixincludes:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/fixincludes/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-fixincludes/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/fixincludes && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif fixincludes-bootstrap
+
+
 .PHONY: all-stagefeedback-fixincludes maybe-all-stagefeedback-fixincludes
 .PHONY: clean-stagefeedback-fixincludes maybe-clean-stagefeedback-fixincludes
 maybe-all-stagefeedback-fixincludes:
@@ -10127,6 +10443,39 @@ configure-stageprofile-gas:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif gas-bootstrap
 
+.PHONY: configure-stagetrain-gas maybe-configure-stagetrain-gas
+maybe-configure-stagetrain-gas:
+@if gas-bootstrap
+maybe-configure-stagetrain-gas: configure-stagetrain-gas
+configure-stagetrain-gas:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/gas/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/gas; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gas; \
+	cd $(HOST_SUBDIR)/gas || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gas/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=gas; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif gas-bootstrap
+
 .PHONY: configure-stagefeedback-gas maybe-configure-stagefeedback-gas
 maybe-configure-stagefeedback-gas:
 @if gas-bootstrap
@@ -10460,6 +10809,48 @@ clean-stageprofile-gas:
 @endif gas-bootstrap
 
 
+.PHONY: all-stagetrain-gas maybe-all-stagetrain-gas
+.PHONY: clean-stagetrain-gas maybe-clean-stagetrain-gas
+maybe-all-stagetrain-gas:
+maybe-clean-stagetrain-gas:
+@if gas-bootstrap
+maybe-all-stagetrain-gas: all-stagetrain-gas
+all-stagetrain: all-stagetrain-gas
+TARGET-stagetrain-gas = $(TARGET-gas)
+all-stagetrain-gas: configure-stagetrain-gas
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/gas && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-gas)
+
+maybe-clean-stagetrain-gas: clean-stagetrain-gas
+clean-stagetrain: clean-stagetrain-gas
+clean-stagetrain-gas:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/gas/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-gas/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/gas && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif gas-bootstrap
+
+
 .PHONY: all-stagefeedback-gas maybe-all-stagefeedback-gas
 .PHONY: clean-stagefeedback-gas maybe-clean-stagefeedback-gas
 maybe-all-stagefeedback-gas:
@@ -11157,6 +11548,39 @@ configure-stageprofile-gcc:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif gcc-bootstrap
 
+.PHONY: configure-stagetrain-gcc maybe-configure-stagetrain-gcc
+maybe-configure-stagetrain-gcc:
+@if gcc-bootstrap
+maybe-configure-stagetrain-gcc: configure-stagetrain-gcc
+configure-stagetrain-gcc:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/gcc/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/gcc; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gcc; \
+	cd $(HOST_SUBDIR)/gcc || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gcc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=gcc; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif gcc-bootstrap
+
 .PHONY: configure-stagefeedback-gcc maybe-configure-stagefeedback-gcc
 maybe-configure-stagefeedback-gcc:
 @if gcc-bootstrap
@@ -11490,6 +11914,48 @@ clean-stageprofile-gcc:
 @endif gcc-bootstrap
 
 
+.PHONY: all-stagetrain-gcc maybe-all-stagetrain-gcc
+.PHONY: clean-stagetrain-gcc maybe-clean-stagetrain-gcc
+maybe-all-stagetrain-gcc:
+maybe-clean-stagetrain-gcc:
+@if gcc-bootstrap
+maybe-all-stagetrain-gcc: all-stagetrain-gcc
+all-stagetrain: all-stagetrain-gcc
+TARGET-stagetrain-gcc = $(TARGET-gcc)
+all-stagetrain-gcc: configure-stagetrain-gcc
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/gcc && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-gcc)
+
+maybe-clean-stagetrain-gcc: clean-stagetrain-gcc
+clean-stagetrain: clean-stagetrain-gcc
+clean-stagetrain-gcc:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/gcc/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-gcc/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/gcc && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) $(EXTRA_GCC_FLAGS) clean
+@endif gcc-bootstrap
+
+
 .PHONY: all-stagefeedback-gcc maybe-all-stagefeedback-gcc
 .PHONY: clean-stagefeedback-gcc maybe-clean-stagefeedback-gcc
 maybe-all-stagefeedback-gcc:
@@ -12192,6 +12658,40 @@ configure-stageprofile-gmp:
 	  --disable-shared LEX="touch lex.yy.c"
 @endif gmp-bootstrap
 
+.PHONY: configure-stagetrain-gmp maybe-configure-stagetrain-gmp
+maybe-configure-stagetrain-gmp:
+@if gmp-bootstrap
+maybe-configure-stagetrain-gmp: configure-stagetrain-gmp
+configure-stagetrain-gmp:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/gmp/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/gmp; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gmp; \
+	cd $(HOST_SUBDIR)/gmp || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gmp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=gmp; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=none-${host_vendor}-${host_os} \
+	  --target=none-${host_vendor}-${host_os} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  --disable-shared LEX="touch lex.yy.c"
+@endif gmp-bootstrap
+
 .PHONY: configure-stagefeedback-gmp maybe-configure-stagefeedback-gmp
 maybe-configure-stagefeedback-gmp:
 @if gmp-bootstrap
@@ -12528,6 +13028,48 @@ clean-stageprofile-gmp:
 @endif gmp-bootstrap
 
 
+.PHONY: all-stagetrain-gmp maybe-all-stagetrain-gmp
+.PHONY: clean-stagetrain-gmp maybe-clean-stagetrain-gmp
+maybe-all-stagetrain-gmp:
+maybe-clean-stagetrain-gmp:
+@if gmp-bootstrap
+maybe-all-stagetrain-gmp: all-stagetrain-gmp
+all-stagetrain: all-stagetrain-gmp
+TARGET-stagetrain-gmp = $(TARGET-gmp)
+all-stagetrain-gmp: configure-stagetrain-gmp
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/gmp && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-gmp)
+
+maybe-clean-stagetrain-gmp: clean-stagetrain-gmp
+clean-stagetrain: clean-stagetrain-gmp
+clean-stagetrain-gmp:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/gmp/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-gmp/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/gmp && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
+@endif gmp-bootstrap
+
+
 .PHONY: all-stagefeedback-gmp maybe-all-stagefeedback-gmp
 .PHONY: clean-stagefeedback-gmp maybe-clean-stagefeedback-gmp
 maybe-all-stagefeedback-gmp:
@@ -13218,6 +13760,40 @@ configure-stageprofile-mpfr:
 	  --disable-shared @extra_mpfr_configure_flags@
 @endif mpfr-bootstrap
 
+.PHONY: configure-stagetrain-mpfr maybe-configure-stagetrain-mpfr
+maybe-configure-stagetrain-mpfr:
+@if mpfr-bootstrap
+maybe-configure-stagetrain-mpfr: configure-stagetrain-mpfr
+configure-stagetrain-mpfr:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/mpfr/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/mpfr; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpfr; \
+	cd $(HOST_SUBDIR)/mpfr || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/mpfr/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=mpfr; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  --disable-shared @extra_mpfr_configure_flags@
+@endif mpfr-bootstrap
+
 .PHONY: configure-stagefeedback-mpfr maybe-configure-stagefeedback-mpfr
 maybe-configure-stagefeedback-mpfr:
 @if mpfr-bootstrap
@@ -13554,6 +14130,48 @@ clean-stageprofile-mpfr:
 @endif mpfr-bootstrap
 
 
+.PHONY: all-stagetrain-mpfr maybe-all-stagetrain-mpfr
+.PHONY: clean-stagetrain-mpfr maybe-clean-stagetrain-mpfr
+maybe-all-stagetrain-mpfr:
+maybe-clean-stagetrain-mpfr:
+@if mpfr-bootstrap
+maybe-all-stagetrain-mpfr: all-stagetrain-mpfr
+all-stagetrain: all-stagetrain-mpfr
+TARGET-stagetrain-mpfr = $(TARGET-mpfr)
+all-stagetrain-mpfr: configure-stagetrain-mpfr
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/mpfr && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-mpfr)
+
+maybe-clean-stagetrain-mpfr: clean-stagetrain-mpfr
+clean-stagetrain: clean-stagetrain-mpfr
+clean-stagetrain-mpfr:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/mpfr/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-mpfr/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/mpfr && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) AM_CFLAGS="-DNO_ASM" clean
+@endif mpfr-bootstrap
+
+
 .PHONY: all-stagefeedback-mpfr maybe-all-stagefeedback-mpfr
 .PHONY: clean-stagefeedback-mpfr maybe-clean-stagefeedback-mpfr
 maybe-all-stagefeedback-mpfr:
@@ -14244,6 +14862,40 @@ configure-stageprofile-mpc:
 	  --disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@ --disable-maintainer-mode
 @endif mpc-bootstrap
 
+.PHONY: configure-stagetrain-mpc maybe-configure-stagetrain-mpc
+maybe-configure-stagetrain-mpc:
+@if mpc-bootstrap
+maybe-configure-stagetrain-mpc: configure-stagetrain-mpc
+configure-stagetrain-mpc:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/mpc/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/mpc; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/mpc; \
+	cd $(HOST_SUBDIR)/mpc || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/mpc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=mpc; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  --disable-shared @extra_mpc_gmp_configure_flags@ @extra_mpc_mpfr_configure_flags@ --disable-maintainer-mode
+@endif mpc-bootstrap
+
 .PHONY: configure-stagefeedback-mpc maybe-configure-stagefeedback-mpc
 maybe-configure-stagefeedback-mpc:
 @if mpc-bootstrap
@@ -14580,6 +15232,48 @@ clean-stageprofile-mpc:
 @endif mpc-bootstrap
 
 
+.PHONY: all-stagetrain-mpc maybe-all-stagetrain-mpc
+.PHONY: clean-stagetrain-mpc maybe-clean-stagetrain-mpc
+maybe-all-stagetrain-mpc:
+maybe-clean-stagetrain-mpc:
+@if mpc-bootstrap
+maybe-all-stagetrain-mpc: all-stagetrain-mpc
+all-stagetrain: all-stagetrain-mpc
+TARGET-stagetrain-mpc = $(TARGET-mpc)
+all-stagetrain-mpc: configure-stagetrain-mpc
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/mpc && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-mpc)
+
+maybe-clean-stagetrain-mpc: clean-stagetrain-mpc
+clean-stagetrain: clean-stagetrain-mpc
+clean-stagetrain-mpc:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/mpc/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-mpc/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/mpc && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif mpc-bootstrap
+
+
 .PHONY: all-stagefeedback-mpc maybe-all-stagefeedback-mpc
 .PHONY: clean-stagefeedback-mpc maybe-clean-stagefeedback-mpc
 maybe-all-stagefeedback-mpc:
@@ -15270,6 +15964,40 @@ configure-stageprofile-isl:
 	  --disable-shared @extra_isl_gmp_configure_flags@
 @endif isl-bootstrap
 
+.PHONY: configure-stagetrain-isl maybe-configure-stagetrain-isl
+maybe-configure-stagetrain-isl:
+@if isl-bootstrap
+maybe-configure-stagetrain-isl: configure-stagetrain-isl
+configure-stagetrain-isl:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/isl
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/isl/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/isl; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/isl; \
+	cd $(HOST_SUBDIR)/isl || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/isl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=isl; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  --disable-shared @extra_isl_gmp_configure_flags@
+@endif isl-bootstrap
+
 .PHONY: configure-stagefeedback-isl maybe-configure-stagefeedback-isl
 maybe-configure-stagefeedback-isl:
 @if isl-bootstrap
@@ -15606,6 +16334,48 @@ clean-stageprofile-isl:
 @endif isl-bootstrap
 
 
+.PHONY: all-stagetrain-isl maybe-all-stagetrain-isl
+.PHONY: clean-stagetrain-isl maybe-clean-stagetrain-isl
+maybe-all-stagetrain-isl:
+maybe-clean-stagetrain-isl:
+@if isl-bootstrap
+maybe-all-stagetrain-isl: all-stagetrain-isl
+all-stagetrain: all-stagetrain-isl
+TARGET-stagetrain-isl = $(TARGET-isl)
+all-stagetrain-isl: configure-stagetrain-isl
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/isl && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) V=1 \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-isl)
+
+maybe-clean-stagetrain-isl: clean-stagetrain-isl
+clean-stagetrain: clean-stagetrain-isl
+clean-stagetrain-isl:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/isl/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-isl/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/isl && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) V=1 clean
+@endif isl-bootstrap
+
+
 .PHONY: all-stagefeedback-isl maybe-all-stagefeedback-isl
 .PHONY: clean-stagefeedback-isl maybe-clean-stagefeedback-isl
 maybe-all-stagefeedback-isl:
@@ -16296,6 +17066,40 @@ configure-stageprofile-libelf:
 	  --disable-shared
 @endif libelf-bootstrap
 
+.PHONY: configure-stagetrain-libelf maybe-configure-stagetrain-libelf
+maybe-configure-stagetrain-libelf:
+@if libelf-bootstrap
+maybe-configure-stagetrain-libelf: configure-stagetrain-libelf
+configure-stagetrain-libelf:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/libelf/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/libelf; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libelf; \
+	cd $(HOST_SUBDIR)/libelf || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libelf/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libelf; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  --disable-shared
+@endif libelf-bootstrap
+
 .PHONY: configure-stagefeedback-libelf maybe-configure-stagefeedback-libelf
 maybe-configure-stagefeedback-libelf:
 @if libelf-bootstrap
@@ -16632,6 +17436,48 @@ clean-stageprofile-libelf:
 @endif libelf-bootstrap
 
 
+.PHONY: all-stagetrain-libelf maybe-all-stagetrain-libelf
+.PHONY: clean-stagetrain-libelf maybe-clean-stagetrain-libelf
+maybe-all-stagetrain-libelf:
+maybe-clean-stagetrain-libelf:
+@if libelf-bootstrap
+maybe-all-stagetrain-libelf: all-stagetrain-libelf
+all-stagetrain: all-stagetrain-libelf
+TARGET-stagetrain-libelf = $(TARGET-libelf)
+all-stagetrain-libelf: configure-stagetrain-libelf
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/libelf && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-libelf)
+
+maybe-clean-stagetrain-libelf: clean-stagetrain-libelf
+clean-stagetrain: clean-stagetrain-libelf
+clean-stagetrain-libelf:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/libelf/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-libelf/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/libelf && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif libelf-bootstrap
+
+
 .PHONY: all-stagefeedback-libelf maybe-all-stagefeedback-libelf
 .PHONY: clean-stagefeedback-libelf maybe-clean-stagefeedback-libelf
 maybe-all-stagefeedback-libelf:
@@ -17317,6 +18163,39 @@ configure-stageprofile-gold:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif gold-bootstrap
 
+.PHONY: configure-stagetrain-gold maybe-configure-stagetrain-gold
+maybe-configure-stagetrain-gold:
+@if gold-bootstrap
+maybe-configure-stagetrain-gold: configure-stagetrain-gold
+configure-stagetrain-gold:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/gold/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/gold; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/gold; \
+	cd $(HOST_SUBDIR)/gold || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/gold/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=gold; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif gold-bootstrap
+
 .PHONY: configure-stagefeedback-gold maybe-configure-stagefeedback-gold
 maybe-configure-stagefeedback-gold:
 @if gold-bootstrap
@@ -17650,6 +18529,48 @@ clean-stageprofile-gold:
 @endif gold-bootstrap
 
 
+.PHONY: all-stagetrain-gold maybe-all-stagetrain-gold
+.PHONY: clean-stagetrain-gold maybe-clean-stagetrain-gold
+maybe-all-stagetrain-gold:
+maybe-clean-stagetrain-gold:
+@if gold-bootstrap
+maybe-all-stagetrain-gold: all-stagetrain-gold
+all-stagetrain: all-stagetrain-gold
+TARGET-stagetrain-gold = $(TARGET-gold)
+all-stagetrain-gold: configure-stagetrain-gold
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/gold && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-gold)
+
+maybe-clean-stagetrain-gold: clean-stagetrain-gold
+clean-stagetrain: clean-stagetrain-gold
+clean-stagetrain-gold:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/gold/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-gold/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/gold && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif gold-bootstrap
+
+
 .PHONY: all-stagefeedback-gold maybe-all-stagefeedback-gold
 .PHONY: clean-stagefeedback-gold maybe-clean-stagefeedback-gold
 maybe-all-stagefeedback-gold:
@@ -18788,6 +19709,39 @@ configure-stageprofile-intl:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif intl-bootstrap
 
+.PHONY: configure-stagetrain-intl maybe-configure-stagetrain-intl
+maybe-configure-stagetrain-intl:
+@if intl-bootstrap
+maybe-configure-stagetrain-intl: configure-stagetrain-intl
+configure-stagetrain-intl:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/intl/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/intl; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/intl; \
+	cd $(HOST_SUBDIR)/intl || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/intl/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=intl; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif intl-bootstrap
+
 .PHONY: configure-stagefeedback-intl maybe-configure-stagefeedback-intl
 maybe-configure-stagefeedback-intl:
 @if intl-bootstrap
@@ -19121,6 +20075,48 @@ clean-stageprofile-intl:
 @endif intl-bootstrap
 
 
+.PHONY: all-stagetrain-intl maybe-all-stagetrain-intl
+.PHONY: clean-stagetrain-intl maybe-clean-stagetrain-intl
+maybe-all-stagetrain-intl:
+maybe-clean-stagetrain-intl:
+@if intl-bootstrap
+maybe-all-stagetrain-intl: all-stagetrain-intl
+all-stagetrain: all-stagetrain-intl
+TARGET-stagetrain-intl = $(TARGET-intl)
+all-stagetrain-intl: configure-stagetrain-intl
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/intl && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-intl)
+
+maybe-clean-stagetrain-intl: clean-stagetrain-intl
+clean-stagetrain: clean-stagetrain-intl
+clean-stagetrain-intl:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/intl/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-intl/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/intl && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif intl-bootstrap
+
+
 .PHONY: all-stagefeedback-intl maybe-all-stagefeedback-intl
 .PHONY: clean-stagefeedback-intl maybe-clean-stagefeedback-intl
 maybe-all-stagefeedback-intl:
@@ -20685,6 +21681,39 @@ configure-stageprofile-ld:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif ld-bootstrap
 
+.PHONY: configure-stagetrain-ld maybe-configure-stagetrain-ld
+maybe-configure-stagetrain-ld:
+@if ld-bootstrap
+maybe-configure-stagetrain-ld: configure-stagetrain-ld
+configure-stagetrain-ld:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/ld/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/ld; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/ld; \
+	cd $(HOST_SUBDIR)/ld || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/ld/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=ld; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif ld-bootstrap
+
 .PHONY: configure-stagefeedback-ld maybe-configure-stagefeedback-ld
 maybe-configure-stagefeedback-ld:
 @if ld-bootstrap
@@ -21018,6 +22047,48 @@ clean-stageprofile-ld:
 @endif ld-bootstrap
 
 
+.PHONY: all-stagetrain-ld maybe-all-stagetrain-ld
+.PHONY: clean-stagetrain-ld maybe-clean-stagetrain-ld
+maybe-all-stagetrain-ld:
+maybe-clean-stagetrain-ld:
+@if ld-bootstrap
+maybe-all-stagetrain-ld: all-stagetrain-ld
+all-stagetrain: all-stagetrain-ld
+TARGET-stagetrain-ld = $(TARGET-ld)
+all-stagetrain-ld: configure-stagetrain-ld
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/ld && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-ld)
+
+maybe-clean-stagetrain-ld: clean-stagetrain-ld
+clean-stagetrain: clean-stagetrain-ld
+clean-stagetrain-ld:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/ld/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-ld/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/ld && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif ld-bootstrap
+
+
 .PHONY: all-stagefeedback-ld maybe-all-stagefeedback-ld
 .PHONY: clean-stagefeedback-ld maybe-clean-stagefeedback-ld
 maybe-all-stagefeedback-ld:
@@ -21715,6 +22786,39 @@ configure-stageprofile-libbacktrace:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif libbacktrace-bootstrap
 
+.PHONY: configure-stagetrain-libbacktrace maybe-configure-stagetrain-libbacktrace
+maybe-configure-stagetrain-libbacktrace:
+@if libbacktrace-bootstrap
+maybe-configure-stagetrain-libbacktrace: configure-stagetrain-libbacktrace
+configure-stagetrain-libbacktrace:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libbacktrace
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/libbacktrace/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/libbacktrace; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libbacktrace; \
+	cd $(HOST_SUBDIR)/libbacktrace || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libbacktrace/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libbacktrace; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif libbacktrace-bootstrap
+
 .PHONY: configure-stagefeedback-libbacktrace maybe-configure-stagefeedback-libbacktrace
 maybe-configure-stagefeedback-libbacktrace:
 @if libbacktrace-bootstrap
@@ -22048,6 +23152,48 @@ clean-stageprofile-libbacktrace:
 @endif libbacktrace-bootstrap
 
 
+.PHONY: all-stagetrain-libbacktrace maybe-all-stagetrain-libbacktrace
+.PHONY: clean-stagetrain-libbacktrace maybe-clean-stagetrain-libbacktrace
+maybe-all-stagetrain-libbacktrace:
+maybe-clean-stagetrain-libbacktrace:
+@if libbacktrace-bootstrap
+maybe-all-stagetrain-libbacktrace: all-stagetrain-libbacktrace
+all-stagetrain: all-stagetrain-libbacktrace
+TARGET-stagetrain-libbacktrace = $(TARGET-libbacktrace)
+all-stagetrain-libbacktrace: configure-stagetrain-libbacktrace
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/libbacktrace && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-libbacktrace)
+
+maybe-clean-stagetrain-libbacktrace: clean-stagetrain-libbacktrace
+clean-stagetrain: clean-stagetrain-libbacktrace
+clean-stagetrain-libbacktrace:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/libbacktrace/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-libbacktrace/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/libbacktrace && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif libbacktrace-bootstrap
+
+
 .PHONY: all-stagefeedback-libbacktrace maybe-all-stagefeedback-libbacktrace
 .PHONY: clean-stagefeedback-libbacktrace maybe-clean-stagefeedback-libbacktrace
 maybe-all-stagefeedback-libbacktrace:
@@ -22745,6 +23891,39 @@ configure-stageprofile-libcpp:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif libcpp-bootstrap
 
+.PHONY: configure-stagetrain-libcpp maybe-configure-stagetrain-libcpp
+maybe-configure-stagetrain-libcpp:
+@if libcpp-bootstrap
+maybe-configure-stagetrain-libcpp: configure-stagetrain-libcpp
+configure-stagetrain-libcpp:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/libcpp/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/libcpp; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libcpp; \
+	cd $(HOST_SUBDIR)/libcpp || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libcpp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libcpp; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif libcpp-bootstrap
+
 .PHONY: configure-stagefeedback-libcpp maybe-configure-stagefeedback-libcpp
 maybe-configure-stagefeedback-libcpp:
 @if libcpp-bootstrap
@@ -23078,6 +24257,48 @@ clean-stageprofile-libcpp:
 @endif libcpp-bootstrap
 
 
+.PHONY: all-stagetrain-libcpp maybe-all-stagetrain-libcpp
+.PHONY: clean-stagetrain-libcpp maybe-clean-stagetrain-libcpp
+maybe-all-stagetrain-libcpp:
+maybe-clean-stagetrain-libcpp:
+@if libcpp-bootstrap
+maybe-all-stagetrain-libcpp: all-stagetrain-libcpp
+all-stagetrain: all-stagetrain-libcpp
+TARGET-stagetrain-libcpp = $(TARGET-libcpp)
+all-stagetrain-libcpp: configure-stagetrain-libcpp
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/libcpp && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-libcpp)
+
+maybe-clean-stagetrain-libcpp: clean-stagetrain-libcpp
+clean-stagetrain: clean-stagetrain-libcpp
+clean-stagetrain-libcpp:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/libcpp/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-libcpp/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/libcpp && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif libcpp-bootstrap
+
+
 .PHONY: all-stagefeedback-libcpp maybe-all-stagefeedback-libcpp
 .PHONY: clean-stagefeedback-libcpp maybe-clean-stagefeedback-libcpp
 maybe-all-stagefeedback-libcpp:
@@ -23775,6 +24996,39 @@ configure-stageprofile-libdecnumber:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif libdecnumber-bootstrap
 
+.PHONY: configure-stagetrain-libdecnumber maybe-configure-stagetrain-libdecnumber
+maybe-configure-stagetrain-libdecnumber:
+@if libdecnumber-bootstrap
+maybe-configure-stagetrain-libdecnumber: configure-stagetrain-libdecnumber
+configure-stagetrain-libdecnumber:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/libdecnumber/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/libdecnumber; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libdecnumber; \
+	cd $(HOST_SUBDIR)/libdecnumber || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libdecnumber/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libdecnumber; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif libdecnumber-bootstrap
+
 .PHONY: configure-stagefeedback-libdecnumber maybe-configure-stagefeedback-libdecnumber
 maybe-configure-stagefeedback-libdecnumber:
 @if libdecnumber-bootstrap
@@ -24108,6 +25362,48 @@ clean-stageprofile-libdecnumber:
 @endif libdecnumber-bootstrap
 
 
+.PHONY: all-stagetrain-libdecnumber maybe-all-stagetrain-libdecnumber
+.PHONY: clean-stagetrain-libdecnumber maybe-clean-stagetrain-libdecnumber
+maybe-all-stagetrain-libdecnumber:
+maybe-clean-stagetrain-libdecnumber:
+@if libdecnumber-bootstrap
+maybe-all-stagetrain-libdecnumber: all-stagetrain-libdecnumber
+all-stagetrain: all-stagetrain-libdecnumber
+TARGET-stagetrain-libdecnumber = $(TARGET-libdecnumber)
+all-stagetrain-libdecnumber: configure-stagetrain-libdecnumber
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/libdecnumber && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-libdecnumber)
+
+maybe-clean-stagetrain-libdecnumber: clean-stagetrain-libdecnumber
+clean-stagetrain: clean-stagetrain-libdecnumber
+clean-stagetrain-libdecnumber:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/libdecnumber/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-libdecnumber/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/libdecnumber && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif libdecnumber-bootstrap
+
+
 .PHONY: all-stagefeedback-libdecnumber maybe-all-stagefeedback-libdecnumber
 .PHONY: clean-stagefeedback-libdecnumber maybe-clean-stagefeedback-libdecnumber
 maybe-all-stagefeedback-libdecnumber:
@@ -25251,6 +26547,40 @@ configure-stageprofile-libiberty:
 	  @extra_host_libiberty_configure_flags@
 @endif libiberty-bootstrap
 
+.PHONY: configure-stagetrain-libiberty maybe-configure-stagetrain-libiberty
+maybe-configure-stagetrain-libiberty:
+@if libiberty-bootstrap
+maybe-configure-stagetrain-libiberty: configure-stagetrain-libiberty
+configure-stagetrain-libiberty:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/libiberty/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/libiberty; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty; \
+	cd $(HOST_SUBDIR)/libiberty || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiberty/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libiberty; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  @extra_host_libiberty_configure_flags@
+@endif libiberty-bootstrap
+
 .PHONY: configure-stagefeedback-libiberty maybe-configure-stagefeedback-libiberty
 maybe-configure-stagefeedback-libiberty:
 @if libiberty-bootstrap
@@ -25587,6 +26917,48 @@ clean-stageprofile-libiberty:
 @endif libiberty-bootstrap
 
 
+.PHONY: all-stagetrain-libiberty maybe-all-stagetrain-libiberty
+.PHONY: clean-stagetrain-libiberty maybe-clean-stagetrain-libiberty
+maybe-all-stagetrain-libiberty:
+maybe-clean-stagetrain-libiberty:
+@if libiberty-bootstrap
+maybe-all-stagetrain-libiberty: all-stagetrain-libiberty
+all-stagetrain: all-stagetrain-libiberty
+TARGET-stagetrain-libiberty = $(TARGET-libiberty)
+all-stagetrain-libiberty: configure-stagetrain-libiberty
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/libiberty && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-libiberty)
+
+maybe-clean-stagetrain-libiberty: clean-stagetrain-libiberty
+clean-stagetrain: clean-stagetrain-libiberty
+clean-stagetrain-libiberty:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/libiberty/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-libiberty/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/libiberty && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif libiberty-bootstrap
+
+
 .PHONY: all-stagefeedback-libiberty maybe-all-stagefeedback-libiberty
 .PHONY: clean-stagefeedback-libiberty maybe-clean-stagefeedback-libiberty
 maybe-all-stagefeedback-libiberty:
@@ -26289,6 +27661,40 @@ configure-stageprofile-libiberty-linker-plugin:
 	  @extra_host_libiberty_configure_flags@ --disable-install-libiberty @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@
 @endif libiberty-linker-plugin-bootstrap
 
+.PHONY: configure-stagetrain-libiberty-linker-plugin maybe-configure-stagetrain-libiberty-linker-plugin
+maybe-configure-stagetrain-libiberty-linker-plugin:
+@if libiberty-linker-plugin-bootstrap
+maybe-configure-stagetrain-libiberty-linker-plugin: configure-stagetrain-libiberty-linker-plugin
+configure-stagetrain-libiberty-linker-plugin:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty-linker-plugin
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/libiberty-linker-plugin/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/libiberty-linker-plugin; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiberty-linker-plugin; \
+	cd $(HOST_SUBDIR)/libiberty-linker-plugin || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiberty-linker-plugin/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libiberty; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  @extra_host_libiberty_configure_flags@ --disable-install-libiberty @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@
+@endif libiberty-linker-plugin-bootstrap
+
 .PHONY: configure-stagefeedback-libiberty-linker-plugin maybe-configure-stagefeedback-libiberty-linker-plugin
 maybe-configure-stagefeedback-libiberty-linker-plugin:
 @if libiberty-linker-plugin-bootstrap
@@ -26625,6 +28031,48 @@ clean-stageprofile-libiberty-linker-plugin:
 @endif libiberty-linker-plugin-bootstrap
 
 
+.PHONY: all-stagetrain-libiberty-linker-plugin maybe-all-stagetrain-libiberty-linker-plugin
+.PHONY: clean-stagetrain-libiberty-linker-plugin maybe-clean-stagetrain-libiberty-linker-plugin
+maybe-all-stagetrain-libiberty-linker-plugin:
+maybe-clean-stagetrain-libiberty-linker-plugin:
+@if libiberty-linker-plugin-bootstrap
+maybe-all-stagetrain-libiberty-linker-plugin: all-stagetrain-libiberty-linker-plugin
+all-stagetrain: all-stagetrain-libiberty-linker-plugin
+TARGET-stagetrain-libiberty-linker-plugin = $(TARGET-libiberty-linker-plugin)
+all-stagetrain-libiberty-linker-plugin: configure-stagetrain-libiberty-linker-plugin
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/libiberty-linker-plugin && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) @extra_linker_plugin_flags@ \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-libiberty-linker-plugin)
+
+maybe-clean-stagetrain-libiberty-linker-plugin: clean-stagetrain-libiberty-linker-plugin
+clean-stagetrain: clean-stagetrain-libiberty-linker-plugin
+clean-stagetrain-libiberty-linker-plugin:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/libiberty-linker-plugin/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-libiberty-linker-plugin/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/libiberty-linker-plugin && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) @extra_linker_plugin_flags@ clean
+@endif libiberty-linker-plugin-bootstrap
+
+
 .PHONY: all-stagefeedback-libiberty-linker-plugin maybe-all-stagefeedback-libiberty-linker-plugin
 .PHONY: clean-stagefeedback-libiberty-linker-plugin maybe-clean-stagefeedback-libiberty-linker-plugin
 maybe-all-stagefeedback-libiberty-linker-plugin:
@@ -27327,6 +28775,40 @@ configure-stageprofile-libiconv:
 	  --disable-shared
 @endif libiconv-bootstrap
 
+.PHONY: configure-stagetrain-libiconv maybe-configure-stagetrain-libiconv
+maybe-configure-stagetrain-libiconv:
+@if libiconv-bootstrap
+maybe-configure-stagetrain-libiconv: configure-stagetrain-libiconv
+configure-stagetrain-libiconv:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiconv
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/libiconv/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/libiconv; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/libiconv; \
+	cd $(HOST_SUBDIR)/libiconv || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/libiconv/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libiconv; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  --disable-shared
+@endif libiconv-bootstrap
+
 .PHONY: configure-stagefeedback-libiconv maybe-configure-stagefeedback-libiconv
 maybe-configure-stagefeedback-libiconv:
 @if libiconv-bootstrap
@@ -27663,6 +29145,48 @@ clean-stageprofile-libiconv:
 @endif libiconv-bootstrap
 
 
+.PHONY: all-stagetrain-libiconv maybe-all-stagetrain-libiconv
+.PHONY: clean-stagetrain-libiconv maybe-clean-stagetrain-libiconv
+maybe-all-stagetrain-libiconv:
+maybe-clean-stagetrain-libiconv:
+@if libiconv-bootstrap
+maybe-all-stagetrain-libiconv: all-stagetrain-libiconv
+all-stagetrain: all-stagetrain-libiconv
+TARGET-stagetrain-libiconv = $(TARGET-libiconv)
+all-stagetrain-libiconv: configure-stagetrain-libiconv
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/libiconv && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-libiconv)
+
+maybe-clean-stagetrain-libiconv: clean-stagetrain-libiconv
+clean-stagetrain: clean-stagetrain-libiconv
+clean-stagetrain-libiconv:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/libiconv/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-libiconv/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/libiconv && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif libiconv-bootstrap
+
+
 .PHONY: all-stagefeedback-libiconv maybe-all-stagefeedback-libiconv
 .PHONY: clean-stagefeedback-libiconv maybe-clean-stagefeedback-libiconv
 maybe-all-stagefeedback-libiconv:
@@ -30453,6 +31977,40 @@ configure-stageprofile-zlib:
 	  @extra_host_zlib_configure_flags@
 @endif zlib-bootstrap
 
+.PHONY: configure-stagetrain-zlib maybe-configure-stagetrain-zlib
+maybe-configure-stagetrain-zlib:
+@if zlib-bootstrap
+maybe-configure-stagetrain-zlib: configure-stagetrain-zlib
+configure-stagetrain-zlib:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/zlib/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/zlib; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/zlib; \
+	cd $(HOST_SUBDIR)/zlib || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/zlib/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=zlib; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  @extra_host_zlib_configure_flags@
+@endif zlib-bootstrap
+
 .PHONY: configure-stagefeedback-zlib maybe-configure-stagefeedback-zlib
 maybe-configure-stagefeedback-zlib:
 @if zlib-bootstrap
@@ -30789,6 +32347,48 @@ clean-stageprofile-zlib:
 @endif zlib-bootstrap
 
 
+.PHONY: all-stagetrain-zlib maybe-all-stagetrain-zlib
+.PHONY: clean-stagetrain-zlib maybe-clean-stagetrain-zlib
+maybe-all-stagetrain-zlib:
+maybe-clean-stagetrain-zlib:
+@if zlib-bootstrap
+maybe-all-stagetrain-zlib: all-stagetrain-zlib
+all-stagetrain: all-stagetrain-zlib
+TARGET-stagetrain-zlib = $(TARGET-zlib)
+all-stagetrain-zlib: configure-stagetrain-zlib
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/zlib && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-zlib)
+
+maybe-clean-stagetrain-zlib: clean-stagetrain-zlib
+clean-stagetrain: clean-stagetrain-zlib
+clean-stagetrain-zlib:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/zlib/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-zlib/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/zlib && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS)  clean
+@endif zlib-bootstrap
+
+
 .PHONY: all-stagefeedback-zlib maybe-all-stagefeedback-zlib
 .PHONY: clean-stagefeedback-zlib maybe-clean-stagefeedback-zlib
 maybe-all-stagefeedback-zlib:
@@ -34488,6 +36088,40 @@ configure-stageprofile-lto-plugin:
 	  --enable-shared @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@
 @endif lto-plugin-bootstrap
 
+.PHONY: configure-stagetrain-lto-plugin maybe-configure-stagetrain-lto-plugin
+maybe-configure-stagetrain-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-configure-stagetrain-lto-plugin: configure-stagetrain-lto-plugin
+configure-stagetrain-lto-plugin:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	test ! -f $(HOST_SUBDIR)/lto-plugin/Makefile || exit 0; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS) \
+	CFLAGS="$(STAGEtrain_CFLAGS)"; export CFLAGS; \
+	CXXFLAGS="$(STAGEtrain_CXXFLAGS)"; export CXXFLAGS; \
+	LIBCFLAGS="$(STAGEtrain_CFLAGS)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(HOST_SUBDIR)/lto-plugin; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)/lto-plugin; \
+	cd $(HOST_SUBDIR)/lto-plugin || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(HOST_SUBDIR)/lto-plugin/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=lto-plugin; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS) \
+	  --enable-shared @extra_linker_plugin_flags@ @extra_linker_plugin_configure_flags@
+@endif lto-plugin-bootstrap
+
 .PHONY: configure-stagefeedback-lto-plugin maybe-configure-stagefeedback-lto-plugin
 maybe-configure-stagefeedback-lto-plugin:
 @if lto-plugin-bootstrap
@@ -34824,6 +36458,48 @@ clean-stageprofile-lto-plugin:
 @endif lto-plugin-bootstrap
 
 
+.PHONY: all-stagetrain-lto-plugin maybe-all-stagetrain-lto-plugin
+.PHONY: clean-stagetrain-lto-plugin maybe-clean-stagetrain-lto-plugin
+maybe-all-stagetrain-lto-plugin:
+maybe-clean-stagetrain-lto-plugin:
+@if lto-plugin-bootstrap
+maybe-all-stagetrain-lto-plugin: all-stagetrain-lto-plugin
+all-stagetrain: all-stagetrain-lto-plugin
+TARGET-stagetrain-lto-plugin = $(TARGET-lto-plugin)
+all-stagetrain-lto-plugin: configure-stagetrain-lto-plugin
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(HOST_EXPORTS) \
+	$(POSTSTAGE1_HOST_EXPORTS)  \
+	cd $(HOST_SUBDIR)/lto-plugin && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(STAGEtrain_CFLAGS)" \
+		CXXFLAGS="$(STAGEtrain_CXXFLAGS)" \
+		LIBCFLAGS="$(STAGEtrain_CFLAGS)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) @extra_linker_plugin_flags@ \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-lto-plugin)
+
+maybe-clean-stagetrain-lto-plugin: clean-stagetrain-lto-plugin
+clean-stagetrain: clean-stagetrain-lto-plugin
+clean-stagetrain-lto-plugin:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(HOST_SUBDIR)/lto-plugin/Makefile ] || exit 0; \
+	else \
+	  [ -f $(HOST_SUBDIR)/stagetrain-lto-plugin/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(HOST_SUBDIR)/lto-plugin && \
+	$(MAKE) $(EXTRA_HOST_FLAGS) $(POSTSTAGE1_FLAGS_TO_PASS) @extra_linker_plugin_flags@ clean
+@endif lto-plugin-bootstrap
+
+
 .PHONY: all-stagefeedback-lto-plugin maybe-all-stagefeedback-lto-plugin
 .PHONY: clean-stagefeedback-lto-plugin maybe-clean-stagefeedback-lto-plugin
 maybe-all-stagefeedback-lto-plugin:
@@ -36484,6 +38160,51 @@ configure-stageprofile-target-libstdc++-v3:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif target-libstdc++-v3-bootstrap
 
+.PHONY: configure-stagetrain-target-libstdc++-v3 maybe-configure-stagetrain-target-libstdc++-v3
+maybe-configure-stagetrain-target-libstdc++-v3:
+@if target-libstdc++-v3-bootstrap
+maybe-configure-stagetrain-target-libstdc++-v3: configure-stagetrain-target-libstdc++-v3
+configure-stagetrain-target-libstdc++-v3:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	echo "Checking multilib configuration for libstdc++-v3..."; \
+	$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp 2> /dev/null; \
+	if test -r $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \
+	  if cmp -s $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; then \
+	    rm -f $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp; \
+	  else \
+	    rm -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile; \
+	    mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \
+	  fi; \
+	else \
+	  mv $(TARGET_SUBDIR)/libstdc++-v3/multilib.tmp $(TARGET_SUBDIR)/libstdc++-v3/multilib.out; \
+	fi; \
+	test ! -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile || exit 0; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	 \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(TARGET_SUBDIR)/libstdc++-v3; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libstdc++-v3; \
+	cd $(TARGET_SUBDIR)/libstdc++-v3 || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libstdc++-v3/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libstdc++-v3; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif target-libstdc++-v3-bootstrap
+
 .PHONY: configure-stagefeedback-target-libstdc++-v3 maybe-configure-stagefeedback-target-libstdc++-v3
 maybe-configure-stagefeedback-target-libstdc++-v3:
 @if target-libstdc++-v3-bootstrap
@@ -36853,6 +38574,48 @@ clean-stageprofile-target-libstdc++-v3:
 @endif target-libstdc++-v3-bootstrap
 
 
+.PHONY: all-stagetrain-target-libstdc++-v3 maybe-all-stagetrain-target-libstdc++-v3
+.PHONY: clean-stagetrain-target-libstdc++-v3 maybe-clean-stagetrain-target-libstdc++-v3
+maybe-all-stagetrain-target-libstdc++-v3:
+maybe-clean-stagetrain-target-libstdc++-v3:
+@if target-libstdc++-v3-bootstrap
+maybe-all-stagetrain-target-libstdc++-v3: all-stagetrain-target-libstdc++-v3
+all-stagetrain: all-stagetrain-target-libstdc++-v3
+TARGET-stagetrain-target-libstdc++-v3 = $(TARGET-target-libstdc++-v3)
+all-stagetrain-target-libstdc++-v3: configure-stagetrain-target-libstdc++-v3
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	  \
+	cd $(TARGET_SUBDIR)/libstdc++-v3 && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-target-libstdc++-v3)
+
+maybe-clean-stagetrain-target-libstdc++-v3: clean-stagetrain-target-libstdc++-v3
+clean-stagetrain: clean-stagetrain-target-libstdc++-v3
+clean-stagetrain-target-libstdc++-v3:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(TARGET_SUBDIR)/libstdc++-v3/Makefile ] || exit 0; \
+	else \
+	  [ -f $(TARGET_SUBDIR)/stagetrain-libstdc++-v3/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(TARGET_SUBDIR)/libstdc++-v3 && \
+	$(MAKE) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   clean
+@endif target-libstdc++-v3-bootstrap
+
+
 .PHONY: all-stagefeedback-target-libstdc++-v3 maybe-all-stagefeedback-target-libstdc++-v3
 .PHONY: clean-stagefeedback-target-libstdc++-v3 maybe-clean-stagefeedback-target-libstdc++-v3
 maybe-all-stagefeedback-target-libstdc++-v3:
@@ -37640,6 +39403,51 @@ configure-stageprofile-target-libsanitizer:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif target-libsanitizer-bootstrap
 
+.PHONY: configure-stagetrain-target-libsanitizer maybe-configure-stagetrain-target-libsanitizer
+maybe-configure-stagetrain-target-libsanitizer:
+@if target-libsanitizer-bootstrap
+maybe-configure-stagetrain-target-libsanitizer: configure-stagetrain-target-libsanitizer
+configure-stagetrain-target-libsanitizer:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libsanitizer
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	echo "Checking multilib configuration for libsanitizer..."; \
+	$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libsanitizer/multilib.tmp 2> /dev/null; \
+	if test -r $(TARGET_SUBDIR)/libsanitizer/multilib.out; then \
+	  if cmp -s $(TARGET_SUBDIR)/libsanitizer/multilib.tmp $(TARGET_SUBDIR)/libsanitizer/multilib.out; then \
+	    rm -f $(TARGET_SUBDIR)/libsanitizer/multilib.tmp; \
+	  else \
+	    rm -f $(TARGET_SUBDIR)/libsanitizer/Makefile; \
+	    mv $(TARGET_SUBDIR)/libsanitizer/multilib.tmp $(TARGET_SUBDIR)/libsanitizer/multilib.out; \
+	  fi; \
+	else \
+	  mv $(TARGET_SUBDIR)/libsanitizer/multilib.tmp $(TARGET_SUBDIR)/libsanitizer/multilib.out; \
+	fi; \
+	test ! -f $(TARGET_SUBDIR)/libsanitizer/Makefile || exit 0; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	 \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(TARGET_SUBDIR)/libsanitizer; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libsanitizer; \
+	cd $(TARGET_SUBDIR)/libsanitizer || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libsanitizer/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libsanitizer; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif target-libsanitizer-bootstrap
+
 .PHONY: configure-stagefeedback-target-libsanitizer maybe-configure-stagefeedback-target-libsanitizer
 maybe-configure-stagefeedback-target-libsanitizer:
 @if target-libsanitizer-bootstrap
@@ -38009,6 +39817,48 @@ clean-stageprofile-target-libsanitizer:
 @endif target-libsanitizer-bootstrap
 
 
+.PHONY: all-stagetrain-target-libsanitizer maybe-all-stagetrain-target-libsanitizer
+.PHONY: clean-stagetrain-target-libsanitizer maybe-clean-stagetrain-target-libsanitizer
+maybe-all-stagetrain-target-libsanitizer:
+maybe-clean-stagetrain-target-libsanitizer:
+@if target-libsanitizer-bootstrap
+maybe-all-stagetrain-target-libsanitizer: all-stagetrain-target-libsanitizer
+all-stagetrain: all-stagetrain-target-libsanitizer
+TARGET-stagetrain-target-libsanitizer = $(TARGET-target-libsanitizer)
+all-stagetrain-target-libsanitizer: configure-stagetrain-target-libsanitizer
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	  \
+	cd $(TARGET_SUBDIR)/libsanitizer && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-target-libsanitizer)
+
+maybe-clean-stagetrain-target-libsanitizer: clean-stagetrain-target-libsanitizer
+clean-stagetrain: clean-stagetrain-target-libsanitizer
+clean-stagetrain-target-libsanitizer:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(TARGET_SUBDIR)/libsanitizer/Makefile ] || exit 0; \
+	else \
+	  [ -f $(TARGET_SUBDIR)/stagetrain-libsanitizer/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(TARGET_SUBDIR)/libsanitizer && \
+	$(MAKE) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   clean
+@endif target-libsanitizer-bootstrap
+
+
 .PHONY: all-stagefeedback-target-libsanitizer maybe-all-stagefeedback-target-libsanitizer
 .PHONY: clean-stagefeedback-target-libsanitizer maybe-clean-stagefeedback-target-libsanitizer
 maybe-all-stagefeedback-target-libsanitizer:
@@ -38796,6 +40646,51 @@ configure-stageprofile-target-libmpx:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif target-libmpx-bootstrap
 
+.PHONY: configure-stagetrain-target-libmpx maybe-configure-stagetrain-target-libmpx
+maybe-configure-stagetrain-target-libmpx:
+@if target-libmpx-bootstrap
+maybe-configure-stagetrain-target-libmpx: configure-stagetrain-target-libmpx
+configure-stagetrain-target-libmpx:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmpx
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	echo "Checking multilib configuration for libmpx..."; \
+	$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libmpx/multilib.tmp 2> /dev/null; \
+	if test -r $(TARGET_SUBDIR)/libmpx/multilib.out; then \
+	  if cmp -s $(TARGET_SUBDIR)/libmpx/multilib.tmp $(TARGET_SUBDIR)/libmpx/multilib.out; then \
+	    rm -f $(TARGET_SUBDIR)/libmpx/multilib.tmp; \
+	  else \
+	    rm -f $(TARGET_SUBDIR)/libmpx/Makefile; \
+	    mv $(TARGET_SUBDIR)/libmpx/multilib.tmp $(TARGET_SUBDIR)/libmpx/multilib.out; \
+	  fi; \
+	else \
+	  mv $(TARGET_SUBDIR)/libmpx/multilib.tmp $(TARGET_SUBDIR)/libmpx/multilib.out; \
+	fi; \
+	test ! -f $(TARGET_SUBDIR)/libmpx/Makefile || exit 0; \
+	$(NORMAL_TARGET_EXPORTS) \
+	 \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(TARGET_SUBDIR)/libmpx; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libmpx; \
+	cd $(TARGET_SUBDIR)/libmpx || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libmpx/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libmpx; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif target-libmpx-bootstrap
+
 .PHONY: configure-stagefeedback-target-libmpx maybe-configure-stagefeedback-target-libmpx
 maybe-configure-stagefeedback-target-libmpx:
 @if target-libmpx-bootstrap
@@ -39165,6 +41060,48 @@ clean-stageprofile-target-libmpx:
 @endif target-libmpx-bootstrap
 
 
+.PHONY: all-stagetrain-target-libmpx maybe-all-stagetrain-target-libmpx
+.PHONY: clean-stagetrain-target-libmpx maybe-clean-stagetrain-target-libmpx
+maybe-all-stagetrain-target-libmpx:
+maybe-clean-stagetrain-target-libmpx:
+@if target-libmpx-bootstrap
+maybe-all-stagetrain-target-libmpx: all-stagetrain-target-libmpx
+all-stagetrain: all-stagetrain-target-libmpx
+TARGET-stagetrain-target-libmpx = $(TARGET-target-libmpx)
+all-stagetrain-target-libmpx: configure-stagetrain-target-libmpx
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(NORMAL_TARGET_EXPORTS) \
+	  \
+	cd $(TARGET_SUBDIR)/libmpx && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_TARGET_FLAGS)   \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-target-libmpx)
+
+maybe-clean-stagetrain-target-libmpx: clean-stagetrain-target-libmpx
+clean-stagetrain: clean-stagetrain-target-libmpx
+clean-stagetrain-target-libmpx:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(TARGET_SUBDIR)/libmpx/Makefile ] || exit 0; \
+	else \
+	  [ -f $(TARGET_SUBDIR)/stagetrain-libmpx/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(TARGET_SUBDIR)/libmpx && \
+	$(MAKE) $(EXTRA_TARGET_FLAGS)   clean
+@endif target-libmpx-bootstrap
+
+
 .PHONY: all-stagefeedback-target-libmpx maybe-all-stagefeedback-target-libmpx
 .PHONY: clean-stagefeedback-target-libmpx maybe-clean-stagefeedback-target-libmpx
 maybe-all-stagefeedback-target-libmpx:
@@ -39952,6 +41889,51 @@ configure-stageprofile-target-libvtv:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif target-libvtv-bootstrap
 
+.PHONY: configure-stagetrain-target-libvtv maybe-configure-stagetrain-target-libvtv
+maybe-configure-stagetrain-target-libvtv:
+@if target-libvtv-bootstrap
+maybe-configure-stagetrain-target-libvtv: configure-stagetrain-target-libvtv
+configure-stagetrain-target-libvtv:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libvtv
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	echo "Checking multilib configuration for libvtv..."; \
+	$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libvtv/multilib.tmp 2> /dev/null; \
+	if test -r $(TARGET_SUBDIR)/libvtv/multilib.out; then \
+	  if cmp -s $(TARGET_SUBDIR)/libvtv/multilib.tmp $(TARGET_SUBDIR)/libvtv/multilib.out; then \
+	    rm -f $(TARGET_SUBDIR)/libvtv/multilib.tmp; \
+	  else \
+	    rm -f $(TARGET_SUBDIR)/libvtv/Makefile; \
+	    mv $(TARGET_SUBDIR)/libvtv/multilib.tmp $(TARGET_SUBDIR)/libvtv/multilib.out; \
+	  fi; \
+	else \
+	  mv $(TARGET_SUBDIR)/libvtv/multilib.tmp $(TARGET_SUBDIR)/libvtv/multilib.out; \
+	fi; \
+	test ! -f $(TARGET_SUBDIR)/libvtv/Makefile || exit 0; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	 \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(TARGET_SUBDIR)/libvtv; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libvtv; \
+	cd $(TARGET_SUBDIR)/libvtv || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libvtv/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libvtv; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif target-libvtv-bootstrap
+
 .PHONY: configure-stagefeedback-target-libvtv maybe-configure-stagefeedback-target-libvtv
 maybe-configure-stagefeedback-target-libvtv:
 @if target-libvtv-bootstrap
@@ -40321,6 +42303,48 @@ clean-stageprofile-target-libvtv:
 @endif target-libvtv-bootstrap
 
 
+.PHONY: all-stagetrain-target-libvtv maybe-all-stagetrain-target-libvtv
+.PHONY: clean-stagetrain-target-libvtv maybe-clean-stagetrain-target-libvtv
+maybe-all-stagetrain-target-libvtv:
+maybe-clean-stagetrain-target-libvtv:
+@if target-libvtv-bootstrap
+maybe-all-stagetrain-target-libvtv: all-stagetrain-target-libvtv
+all-stagetrain: all-stagetrain-target-libvtv
+TARGET-stagetrain-target-libvtv = $(TARGET-target-libvtv)
+all-stagetrain-target-libvtv: configure-stagetrain-target-libvtv
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(RAW_CXX_TARGET_EXPORTS) \
+	  \
+	cd $(TARGET_SUBDIR)/libvtv && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-target-libvtv)
+
+maybe-clean-stagetrain-target-libvtv: clean-stagetrain-target-libvtv
+clean-stagetrain: clean-stagetrain-target-libvtv
+clean-stagetrain-target-libvtv:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(TARGET_SUBDIR)/libvtv/Makefile ] || exit 0; \
+	else \
+	  [ -f $(TARGET_SUBDIR)/stagetrain-libvtv/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(TARGET_SUBDIR)/libvtv && \
+	$(MAKE) $(EXTRA_TARGET_FLAGS) 'CXX=$$(RAW_CXX_FOR_TARGET)' 'CXX_FOR_TARGET=$$(RAW_CXX_FOR_TARGET)'   clean
+@endif target-libvtv-bootstrap
+
+
 .PHONY: all-stagefeedback-target-libvtv maybe-all-stagefeedback-target-libvtv
 .PHONY: clean-stagefeedback-target-libvtv maybe-clean-stagefeedback-target-libvtv
 maybe-all-stagefeedback-target-libvtv:
@@ -42940,6 +44964,51 @@ configure-stageprofile-target-libgcc:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif target-libgcc-bootstrap
 
+.PHONY: configure-stagetrain-target-libgcc maybe-configure-stagetrain-target-libgcc
+maybe-configure-stagetrain-target-libgcc:
+@if target-libgcc-bootstrap
+maybe-configure-stagetrain-target-libgcc: configure-stagetrain-target-libgcc
+configure-stagetrain-target-libgcc:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	echo "Checking multilib configuration for libgcc..."; \
+	$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgcc/multilib.tmp 2> /dev/null; \
+	if test -r $(TARGET_SUBDIR)/libgcc/multilib.out; then \
+	  if cmp -s $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; then \
+	    rm -f $(TARGET_SUBDIR)/libgcc/multilib.tmp; \
+	  else \
+	    rm -f $(TARGET_SUBDIR)/libgcc/Makefile; \
+	    mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \
+	  fi; \
+	else \
+	  mv $(TARGET_SUBDIR)/libgcc/multilib.tmp $(TARGET_SUBDIR)/libgcc/multilib.out; \
+	fi; \
+	test ! -f $(TARGET_SUBDIR)/libgcc/Makefile || exit 0; \
+	$(NORMAL_TARGET_EXPORTS) \
+	 \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(TARGET_SUBDIR)/libgcc; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgcc; \
+	cd $(TARGET_SUBDIR)/libgcc || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libgcc/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libgcc; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif target-libgcc-bootstrap
+
 .PHONY: configure-stagefeedback-target-libgcc maybe-configure-stagefeedback-target-libgcc
 maybe-configure-stagefeedback-target-libgcc:
 @if target-libgcc-bootstrap
@@ -43309,6 +45378,48 @@ clean-stageprofile-target-libgcc:
 @endif target-libgcc-bootstrap
 
 
+.PHONY: all-stagetrain-target-libgcc maybe-all-stagetrain-target-libgcc
+.PHONY: clean-stagetrain-target-libgcc maybe-clean-stagetrain-target-libgcc
+maybe-all-stagetrain-target-libgcc:
+maybe-clean-stagetrain-target-libgcc:
+@if target-libgcc-bootstrap
+maybe-all-stagetrain-target-libgcc: all-stagetrain-target-libgcc
+all-stagetrain: all-stagetrain-target-libgcc
+TARGET-stagetrain-target-libgcc = $(TARGET-target-libgcc)
+all-stagetrain-target-libgcc: configure-stagetrain-target-libgcc
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(NORMAL_TARGET_EXPORTS) \
+	  \
+	cd $(TARGET_SUBDIR)/libgcc && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_TARGET_FLAGS)   \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-target-libgcc)
+
+maybe-clean-stagetrain-target-libgcc: clean-stagetrain-target-libgcc
+clean-stagetrain: clean-stagetrain-target-libgcc
+clean-stagetrain-target-libgcc:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(TARGET_SUBDIR)/libgcc/Makefile ] || exit 0; \
+	else \
+	  [ -f $(TARGET_SUBDIR)/stagetrain-libgcc/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(TARGET_SUBDIR)/libgcc && \
+	$(MAKE) $(EXTRA_TARGET_FLAGS)   clean
+@endif target-libgcc-bootstrap
+
+
 .PHONY: all-stagefeedback-target-libgcc maybe-all-stagefeedback-target-libgcc
 .PHONY: clean-stagefeedback-target-libgcc maybe-clean-stagefeedback-target-libgcc
 maybe-all-stagefeedback-target-libgcc:
@@ -49965,6 +52076,51 @@ configure-stageprofile-target-libgomp:
 	  $(STAGEprofile_CONFIGURE_FLAGS)
 @endif target-libgomp-bootstrap
 
+.PHONY: configure-stagetrain-target-libgomp maybe-configure-stagetrain-target-libgomp
+maybe-configure-stagetrain-target-libgomp:
+@if target-libgomp-bootstrap
+maybe-configure-stagetrain-target-libgomp: configure-stagetrain-target-libgomp
+configure-stagetrain-target-libgomp:
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	echo "Checking multilib configuration for libgomp..."; \
+	$(CC_FOR_TARGET) --print-multi-lib > $(TARGET_SUBDIR)/libgomp/multilib.tmp 2> /dev/null; \
+	if test -r $(TARGET_SUBDIR)/libgomp/multilib.out; then \
+	  if cmp -s $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; then \
+	    rm -f $(TARGET_SUBDIR)/libgomp/multilib.tmp; \
+	  else \
+	    rm -f $(TARGET_SUBDIR)/libgomp/Makefile; \
+	    mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \
+	  fi; \
+	else \
+	  mv $(TARGET_SUBDIR)/libgomp/multilib.tmp $(TARGET_SUBDIR)/libgomp/multilib.out; \
+	fi; \
+	test ! -f $(TARGET_SUBDIR)/libgomp/Makefile || exit 0; \
+	$(NORMAL_TARGET_EXPORTS) \
+	 \
+	CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \
+	CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \
+	LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)"; export LIBCFLAGS;  \
+	echo Configuring stage train in $(TARGET_SUBDIR)/libgomp; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(TARGET_SUBDIR)/libgomp; \
+	cd $(TARGET_SUBDIR)/libgomp || exit 1; \
+	case $(srcdir) in \
+	  /* | [A-Za-z]:[\\/]*) topdir=$(srcdir) ;; \
+	  *) topdir=`echo $(TARGET_SUBDIR)/libgomp/ | \
+		sed -e 's,\./,,g' -e 's,[^/]*/,../,g' `$(srcdir) ;; \
+	esac; \
+	module_srcdir=libgomp; \
+	$(SHELL) $$s/$$module_srcdir/configure \
+	  --srcdir=$${topdir}/$$module_srcdir \
+	  $(TARGET_CONFIGARGS) --build=${build_alias} --host=${target_alias} \
+	  --target=${target_alias} \
+	  --with-build-libsubdir=$(HOST_SUBDIR) \
+	  $(STAGEtrain_CONFIGURE_FLAGS)
+@endif target-libgomp-bootstrap
+
 .PHONY: configure-stagefeedback-target-libgomp maybe-configure-stagefeedback-target-libgomp
 maybe-configure-stagefeedback-target-libgomp:
 @if target-libgomp-bootstrap
@@ -50334,6 +52490,48 @@ clean-stageprofile-target-libgomp:
 @endif target-libgomp-bootstrap
 
 
+.PHONY: all-stagetrain-target-libgomp maybe-all-stagetrain-target-libgomp
+.PHONY: clean-stagetrain-target-libgomp maybe-clean-stagetrain-target-libgomp
+maybe-all-stagetrain-target-libgomp:
+maybe-clean-stagetrain-target-libgomp:
+@if target-libgomp-bootstrap
+maybe-all-stagetrain-target-libgomp: all-stagetrain-target-libgomp
+all-stagetrain: all-stagetrain-target-libgomp
+TARGET-stagetrain-target-libgomp = $(TARGET-target-libgomp)
+all-stagetrain-target-libgomp: configure-stagetrain-target-libgomp
+	@[ $(current_stage) = stagetrain ] || $(MAKE) stagetrain-start
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(NORMAL_TARGET_EXPORTS) \
+	  \
+	cd $(TARGET_SUBDIR)/libgomp && \
+	 \
+	$(MAKE) $(BASE_FLAGS_TO_PASS) \
+		CFLAGS="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS="$(LIBCFLAGS_FOR_TARGET)" \
+		CFLAGS_FOR_TARGET="$(CFLAGS_FOR_TARGET)" \
+		CXXFLAGS_FOR_TARGET="$(CXXFLAGS_FOR_TARGET)" \
+		LIBCFLAGS_FOR_TARGET="$(LIBCFLAGS_FOR_TARGET)" \
+		$(EXTRA_TARGET_FLAGS)   \
+		TFLAGS="$(STAGEtrain_TFLAGS)"  \
+		$(TARGET-stagetrain-target-libgomp)
+
+maybe-clean-stagetrain-target-libgomp: clean-stagetrain-target-libgomp
+clean-stagetrain: clean-stagetrain-target-libgomp
+clean-stagetrain-target-libgomp:
+	@if [ $(current_stage) = stagetrain ]; then \
+	  [ -f $(TARGET_SUBDIR)/libgomp/Makefile ] || exit 0; \
+	else \
+	  [ -f $(TARGET_SUBDIR)/stagetrain-libgomp/Makefile ] || exit 0; \
+	  $(MAKE) stagetrain-start; \
+	fi; \
+	cd $(TARGET_SUBDIR)/libgomp && \
+	$(MAKE) $(EXTRA_TARGET_FLAGS)   clean
+@endif target-libgomp-bootstrap
+
+
 .PHONY: all-stagefeedback-target-libgomp maybe-all-stagefeedback-target-libgomp
 .PHONY: clean-stagefeedback-target-libgomp maybe-clean-stagefeedback-target-libgomp
 maybe-all-stagefeedback-target-libgomp:
@@ -53647,6 +55845,348 @@ distclean-stageprofile::
 @endif gcc-bootstrap
 
 
+.PHONY: stagetrain-start stagetrain-end
+
+stagetrain-start::
+	@: $(MAKE); $(stage); \
+	echo stagetrain > stage_current; \
+	echo stagetrain > stage_last; \
+	$(SHELL) $(srcdir)/mkinstalldirs $(HOST_SUBDIR)
+@if bfd
+	@cd $(HOST_SUBDIR); [ -d stagetrain-bfd ] || \
+	  mkdir stagetrain-bfd; \
+	mv stagetrain-bfd bfd; \
+	mv stageprofile-bfd prev-bfd || test -f stageprofile-lean 
+@endif bfd
+@if opcodes
+	@cd $(HOST_SUBDIR); [ -d stagetrain-opcodes ] || \
+	  mkdir stagetrain-opcodes; \
+	mv stagetrain-opcodes opcodes; \
+	mv stageprofile-opcodes prev-opcodes || test -f stageprofile-lean 
+@endif opcodes
+@if binutils
+	@cd $(HOST_SUBDIR); [ -d stagetrain-binutils ] || \
+	  mkdir stagetrain-binutils; \
+	mv stagetrain-binutils binutils; \
+	mv stageprofile-binutils prev-binutils || test -f stageprofile-lean 
+@endif binutils
+@if fixincludes
+	@cd $(HOST_SUBDIR); [ -d stagetrain-fixincludes ] || \
+	  mkdir stagetrain-fixincludes; \
+	mv stagetrain-fixincludes fixincludes; \
+	mv stageprofile-fixincludes prev-fixincludes || test -f stageprofile-lean 
+@endif fixincludes
+@if gas
+	@cd $(HOST_SUBDIR); [ -d stagetrain-gas ] || \
+	  mkdir stagetrain-gas; \
+	mv stagetrain-gas gas; \
+	mv stageprofile-gas prev-gas || test -f stageprofile-lean 
+@endif gas
+@if gcc
+	@cd $(HOST_SUBDIR); [ -d stagetrain-gcc ] || \
+	  mkdir stagetrain-gcc; \
+	mv stagetrain-gcc gcc; \
+	mv stageprofile-gcc prev-gcc || test -f stageprofile-lean 
+@endif gcc
+@if gmp
+	@cd $(HOST_SUBDIR); [ -d stagetrain-gmp ] || \
+	  mkdir stagetrain-gmp; \
+	mv stagetrain-gmp gmp; \
+	mv stageprofile-gmp prev-gmp || test -f stageprofile-lean 
+@endif gmp
+@if mpfr
+	@cd $(HOST_SUBDIR); [ -d stagetrain-mpfr ] || \
+	  mkdir stagetrain-mpfr; \
+	mv stagetrain-mpfr mpfr; \
+	mv stageprofile-mpfr prev-mpfr || test -f stageprofile-lean 
+@endif mpfr
+@if mpc
+	@cd $(HOST_SUBDIR); [ -d stagetrain-mpc ] || \
+	  mkdir stagetrain-mpc; \
+	mv stagetrain-mpc mpc; \
+	mv stageprofile-mpc prev-mpc || test -f stageprofile-lean 
+@endif mpc
+@if isl
+	@cd $(HOST_SUBDIR); [ -d stagetrain-isl ] || \
+	  mkdir stagetrain-isl; \
+	mv stagetrain-isl isl; \
+	mv stageprofile-isl prev-isl || test -f stageprofile-lean 
+@endif isl
+@if libelf
+	@cd $(HOST_SUBDIR); [ -d stagetrain-libelf ] || \
+	  mkdir stagetrain-libelf; \
+	mv stagetrain-libelf libelf; \
+	mv stageprofile-libelf prev-libelf || test -f stageprofile-lean 
+@endif libelf
+@if gold
+	@cd $(HOST_SUBDIR); [ -d stagetrain-gold ] || \
+	  mkdir stagetrain-gold; \
+	mv stagetrain-gold gold; \
+	mv stageprofile-gold prev-gold || test -f stageprofile-lean 
+@endif gold
+@if intl
+	@cd $(HOST_SUBDIR); [ -d stagetrain-intl ] || \
+	  mkdir stagetrain-intl; \
+	mv stagetrain-intl intl; \
+	mv stageprofile-intl prev-intl || test -f stageprofile-lean 
+@endif intl
+@if ld
+	@cd $(HOST_SUBDIR); [ -d stagetrain-ld ] || \
+	  mkdir stagetrain-ld; \
+	mv stagetrain-ld ld; \
+	mv stageprofile-ld prev-ld || test -f stageprofile-lean 
+@endif ld
+@if libbacktrace
+	@cd $(HOST_SUBDIR); [ -d stagetrain-libbacktrace ] || \
+	  mkdir stagetrain-libbacktrace; \
+	mv stagetrain-libbacktrace libbacktrace; \
+	mv stageprofile-libbacktrace prev-libbacktrace || test -f stageprofile-lean 
+@endif libbacktrace
+@if libcpp
+	@cd $(HOST_SUBDIR); [ -d stagetrain-libcpp ] || \
+	  mkdir stagetrain-libcpp; \
+	mv stagetrain-libcpp libcpp; \
+	mv stageprofile-libcpp prev-libcpp || test -f stageprofile-lean 
+@endif libcpp
+@if libdecnumber
+	@cd $(HOST_SUBDIR); [ -d stagetrain-libdecnumber ] || \
+	  mkdir stagetrain-libdecnumber; \
+	mv stagetrain-libdecnumber libdecnumber; \
+	mv stageprofile-libdecnumber prev-libdecnumber || test -f stageprofile-lean 
+@endif libdecnumber
+@if libiberty
+	@cd $(HOST_SUBDIR); [ -d stagetrain-libiberty ] || \
+	  mkdir stagetrain-libiberty; \
+	mv stagetrain-libiberty libiberty; \
+	mv stageprofile-libiberty prev-libiberty || test -f stageprofile-lean 
+@endif libiberty
+@if libiberty-linker-plugin
+	@cd $(HOST_SUBDIR); [ -d stagetrain-libiberty-linker-plugin ] || \
+	  mkdir stagetrain-libiberty-linker-plugin; \
+	mv stagetrain-libiberty-linker-plugin libiberty-linker-plugin; \
+	mv stageprofile-libiberty-linker-plugin prev-libiberty-linker-plugin || test -f stageprofile-lean 
+@endif libiberty-linker-plugin
+@if libiconv
+	@cd $(HOST_SUBDIR); [ -d stagetrain-libiconv ] || \
+	  mkdir stagetrain-libiconv; \
+	mv stagetrain-libiconv libiconv; \
+	mv stageprofile-libiconv prev-libiconv || test -f stageprofile-lean 
+@endif libiconv
+@if zlib
+	@cd $(HOST_SUBDIR); [ -d stagetrain-zlib ] || \
+	  mkdir stagetrain-zlib; \
+	mv stagetrain-zlib zlib; \
+	mv stageprofile-zlib prev-zlib || test -f stageprofile-lean 
+@endif zlib
+@if lto-plugin
+	@cd $(HOST_SUBDIR); [ -d stagetrain-lto-plugin ] || \
+	  mkdir stagetrain-lto-plugin; \
+	mv stagetrain-lto-plugin lto-plugin; \
+	mv stageprofile-lto-plugin prev-lto-plugin || test -f stageprofile-lean 
+@endif lto-plugin
+	@[ -d stagetrain-$(TARGET_SUBDIR) ] || \
+	  mkdir stagetrain-$(TARGET_SUBDIR); \
+	mv stagetrain-$(TARGET_SUBDIR) $(TARGET_SUBDIR); \
+	mv stageprofile-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stageprofile-lean 
+
+stagetrain-end:: 
+@if bfd
+	@if test -d $(HOST_SUBDIR)/bfd; then \
+	  cd $(HOST_SUBDIR); mv bfd stagetrain-bfd; \
+	  mv prev-bfd stageprofile-bfd; : ; \
+	fi
+@endif bfd
+@if opcodes
+	@if test -d $(HOST_SUBDIR)/opcodes; then \
+	  cd $(HOST_SUBDIR); mv opcodes stagetrain-opcodes; \
+	  mv prev-opcodes stageprofile-opcodes; : ; \
+	fi
+@endif opcodes
+@if binutils
+	@if test -d $(HOST_SUBDIR)/binutils; then \
+	  cd $(HOST_SUBDIR); mv binutils stagetrain-binutils; \
+	  mv prev-binutils stageprofile-binutils; : ; \
+	fi
+@endif binutils
+@if fixincludes
+	@if test -d $(HOST_SUBDIR)/fixincludes; then \
+	  cd $(HOST_SUBDIR); mv fixincludes stagetrain-fixincludes; \
+	  mv prev-fixincludes stageprofile-fixincludes; : ; \
+	fi
+@endif fixincludes
+@if gas
+	@if test -d $(HOST_SUBDIR)/gas; then \
+	  cd $(HOST_SUBDIR); mv gas stagetrain-gas; \
+	  mv prev-gas stageprofile-gas; : ; \
+	fi
+@endif gas
+@if gcc
+	@if test -d $(HOST_SUBDIR)/gcc; then \
+	  cd $(HOST_SUBDIR); mv gcc stagetrain-gcc; \
+	  mv prev-gcc stageprofile-gcc; : ; \
+	fi
+@endif gcc
+@if gmp
+	@if test -d $(HOST_SUBDIR)/gmp; then \
+	  cd $(HOST_SUBDIR); mv gmp stagetrain-gmp; \
+	  mv prev-gmp stageprofile-gmp; : ; \
+	fi
+@endif gmp
+@if mpfr
+	@if test -d $(HOST_SUBDIR)/mpfr; then \
+	  cd $(HOST_SUBDIR); mv mpfr stagetrain-mpfr; \
+	  mv prev-mpfr stageprofile-mpfr; : ; \
+	fi
+@endif mpfr
+@if mpc
+	@if test -d $(HOST_SUBDIR)/mpc; then \
+	  cd $(HOST_SUBDIR); mv mpc stagetrain-mpc; \
+	  mv prev-mpc stageprofile-mpc; : ; \
+	fi
+@endif mpc
+@if isl
+	@if test -d $(HOST_SUBDIR)/isl; then \
+	  cd $(HOST_SUBDIR); mv isl stagetrain-isl; \
+	  mv prev-isl stageprofile-isl; : ; \
+	fi
+@endif isl
+@if libelf
+	@if test -d $(HOST_SUBDIR)/libelf; then \
+	  cd $(HOST_SUBDIR); mv libelf stagetrain-libelf; \
+	  mv prev-libelf stageprofile-libelf; : ; \
+	fi
+@endif libelf
+@if gold
+	@if test -d $(HOST_SUBDIR)/gold; then \
+	  cd $(HOST_SUBDIR); mv gold stagetrain-gold; \
+	  mv prev-gold stageprofile-gold; : ; \
+	fi
+@endif gold
+@if intl
+	@if test -d $(HOST_SUBDIR)/intl; then \
+	  cd $(HOST_SUBDIR); mv intl stagetrain-intl; \
+	  mv prev-intl stageprofile-intl; : ; \
+	fi
+@endif intl
+@if ld
+	@if test -d $(HOST_SUBDIR)/ld; then \
+	  cd $(HOST_SUBDIR); mv ld stagetrain-ld; \
+	  mv prev-ld stageprofile-ld; : ; \
+	fi
+@endif ld
+@if libbacktrace
+	@if test -d $(HOST_SUBDIR)/libbacktrace; then \
+	  cd $(HOST_SUBDIR); mv libbacktrace stagetrain-libbacktrace; \
+	  mv prev-libbacktrace stageprofile-libbacktrace; : ; \
+	fi
+@endif libbacktrace
+@if libcpp
+	@if test -d $(HOST_SUBDIR)/libcpp; then \
+	  cd $(HOST_SUBDIR); mv libcpp stagetrain-libcpp; \
+	  mv prev-libcpp stageprofile-libcpp; : ; \
+	fi
+@endif libcpp
+@if libdecnumber
+	@if test -d $(HOST_SUBDIR)/libdecnumber; then \
+	  cd $(HOST_SUBDIR); mv libdecnumber stagetrain-libdecnumber; \
+	  mv prev-libdecnumber stageprofile-libdecnumber; : ; \
+	fi
+@endif libdecnumber
+@if libiberty
+	@if test -d $(HOST_SUBDIR)/libiberty; then \
+	  cd $(HOST_SUBDIR); mv libiberty stagetrain-libiberty; \
+	  mv prev-libiberty stageprofile-libiberty; : ; \
+	fi
+@endif libiberty
+@if libiberty-linker-plugin
+	@if test -d $(HOST_SUBDIR)/libiberty-linker-plugin; then \
+	  cd $(HOST_SUBDIR); mv libiberty-linker-plugin stagetrain-libiberty-linker-plugin; \
+	  mv prev-libiberty-linker-plugin stageprofile-libiberty-linker-plugin; : ; \
+	fi
+@endif libiberty-linker-plugin
+@if libiconv
+	@if test -d $(HOST_SUBDIR)/libiconv; then \
+	  cd $(HOST_SUBDIR); mv libiconv stagetrain-libiconv; \
+	  mv prev-libiconv stageprofile-libiconv; : ; \
+	fi
+@endif libiconv
+@if zlib
+	@if test -d $(HOST_SUBDIR)/zlib; then \
+	  cd $(HOST_SUBDIR); mv zlib stagetrain-zlib; \
+	  mv prev-zlib stageprofile-zlib; : ; \
+	fi
+@endif zlib
+@if lto-plugin
+	@if test -d $(HOST_SUBDIR)/lto-plugin; then \
+	  cd $(HOST_SUBDIR); mv lto-plugin stagetrain-lto-plugin; \
+	  mv prev-lto-plugin stageprofile-lto-plugin; : ; \
+	fi
+@endif lto-plugin
+	@if test -d $(TARGET_SUBDIR); then \
+	  mv $(TARGET_SUBDIR) stagetrain-$(TARGET_SUBDIR); \
+	  mv prev-$(TARGET_SUBDIR) stageprofile-$(TARGET_SUBDIR); : ; \
+	fi
+	rm -f stage_current
+
+# Bubble a bug fix through all the stages up to stage train.  They are
+# remade, but not reconfigured.  The next stage (if any) will not be
+# reconfigured either.
+.PHONY: stagetrain-bubble
+stagetrain-bubble:: stageprofile-bubble
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	if test -f stagetrain-lean || test -f stageprofile-lean ; then \
+	  echo Skipping rebuild of stagetrain; \
+	else \
+	  $(MAKE) stagetrain-start; \
+	  $(MAKE) $(RECURSE_FLAGS_TO_PASS) all-stagetrain; \
+	fi
+
+.PHONY: all-stagetrain clean-stagetrain
+do-clean: clean-stagetrain
+
+# FIXME: Will not need to be conditional when toplevel bootstrap is the
+# only possibility, but now it conflicts with no-bootstrap rules
+@if gcc-bootstrap
+
+
+
+.PHONY: profiledbootstrap profiledbootstrap-lean
+profiledbootstrap:
+	echo stagetrain > stage_final
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) stagetrain-bubble
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
+
+profiledbootstrap-lean:
+	echo stagetrain > stage_final
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	$(MAKE) $(RECURSE_FLAGS_TO_PASS) LEAN=: stagetrain-bubble
+	@: $(MAKE); $(unstage)
+	@r=`${PWD_COMMAND}`; export r; \
+	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
+	TFLAGS="$(STAGEtrain_TFLAGS)"; \
+	$(MAKE) $(TARGET_FLAGS_TO_PASS) all-host all-target
+
+
+# Rules to wipe a stage and all the following ones, also used for cleanstrap
+distclean-stageprofile:: distclean-stagetrain 
+.PHONY: distclean-stagetrain
+distclean-stagetrain::
+	@: $(MAKE); $(stage)
+	@test "`cat stage_last`" != stagetrain || rm -f stage_last
+	rm -rf stagetrain-* 
+
+
+@endif gcc-bootstrap
+
+
 .PHONY: stagefeedback-start stagefeedback-end
 
 stagefeedback-start::
@@ -53658,275 +56198,275 @@ stagefeedback-start::
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-bfd ] || \
 	  mkdir stagefeedback-bfd; \
 	mv stagefeedback-bfd bfd; \
-	mv stageprofile-bfd prev-bfd || test -f stageprofile-lean 
+	mv stagetrain-bfd prev-bfd || test -f stagetrain-lean 
 @endif bfd
 @if opcodes
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-opcodes ] || \
 	  mkdir stagefeedback-opcodes; \
 	mv stagefeedback-opcodes opcodes; \
-	mv stageprofile-opcodes prev-opcodes || test -f stageprofile-lean 
+	mv stagetrain-opcodes prev-opcodes || test -f stagetrain-lean 
 @endif opcodes
 @if binutils
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-binutils ] || \
 	  mkdir stagefeedback-binutils; \
 	mv stagefeedback-binutils binutils; \
-	mv stageprofile-binutils prev-binutils || test -f stageprofile-lean 
+	mv stagetrain-binutils prev-binutils || test -f stagetrain-lean 
 @endif binutils
 @if fixincludes
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-fixincludes ] || \
 	  mkdir stagefeedback-fixincludes; \
 	mv stagefeedback-fixincludes fixincludes; \
-	mv stageprofile-fixincludes prev-fixincludes || test -f stageprofile-lean 
+	mv stagetrain-fixincludes prev-fixincludes || test -f stagetrain-lean 
 @endif fixincludes
 @if gas
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-gas ] || \
 	  mkdir stagefeedback-gas; \
 	mv stagefeedback-gas gas; \
-	mv stageprofile-gas prev-gas || test -f stageprofile-lean 
+	mv stagetrain-gas prev-gas || test -f stagetrain-lean 
 @endif gas
 @if gcc
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-gcc ] || \
 	  mkdir stagefeedback-gcc; \
 	mv stagefeedback-gcc gcc; \
-	mv stageprofile-gcc prev-gcc || test -f stageprofile-lean 
+	mv stagetrain-gcc prev-gcc || test -f stagetrain-lean 
 @endif gcc
 @if gmp
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-gmp ] || \
 	  mkdir stagefeedback-gmp; \
 	mv stagefeedback-gmp gmp; \
-	mv stageprofile-gmp prev-gmp || test -f stageprofile-lean 
+	mv stagetrain-gmp prev-gmp || test -f stagetrain-lean 
 @endif gmp
 @if mpfr
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-mpfr ] || \
 	  mkdir stagefeedback-mpfr; \
 	mv stagefeedback-mpfr mpfr; \
-	mv stageprofile-mpfr prev-mpfr || test -f stageprofile-lean 
+	mv stagetrain-mpfr prev-mpfr || test -f stagetrain-lean 
 @endif mpfr
 @if mpc
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-mpc ] || \
 	  mkdir stagefeedback-mpc; \
 	mv stagefeedback-mpc mpc; \
-	mv stageprofile-mpc prev-mpc || test -f stageprofile-lean 
+	mv stagetrain-mpc prev-mpc || test -f stagetrain-lean 
 @endif mpc
 @if isl
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-isl ] || \
 	  mkdir stagefeedback-isl; \
 	mv stagefeedback-isl isl; \
-	mv stageprofile-isl prev-isl || test -f stageprofile-lean 
+	mv stagetrain-isl prev-isl || test -f stagetrain-lean 
 @endif isl
 @if libelf
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-libelf ] || \
 	  mkdir stagefeedback-libelf; \
 	mv stagefeedback-libelf libelf; \
-	mv stageprofile-libelf prev-libelf || test -f stageprofile-lean 
+	mv stagetrain-libelf prev-libelf || test -f stagetrain-lean 
 @endif libelf
 @if gold
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-gold ] || \
 	  mkdir stagefeedback-gold; \
 	mv stagefeedback-gold gold; \
-	mv stageprofile-gold prev-gold || test -f stageprofile-lean 
+	mv stagetrain-gold prev-gold || test -f stagetrain-lean 
 @endif gold
 @if intl
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-intl ] || \
 	  mkdir stagefeedback-intl; \
 	mv stagefeedback-intl intl; \
-	mv stageprofile-intl prev-intl || test -f stageprofile-lean 
+	mv stagetrain-intl prev-intl || test -f stagetrain-lean 
 @endif intl
 @if ld
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-ld ] || \
 	  mkdir stagefeedback-ld; \
 	mv stagefeedback-ld ld; \
-	mv stageprofile-ld prev-ld || test -f stageprofile-lean 
+	mv stagetrain-ld prev-ld || test -f stagetrain-lean 
 @endif ld
 @if libbacktrace
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-libbacktrace ] || \
 	  mkdir stagefeedback-libbacktrace; \
 	mv stagefeedback-libbacktrace libbacktrace; \
-	mv stageprofile-libbacktrace prev-libbacktrace || test -f stageprofile-lean 
+	mv stagetrain-libbacktrace prev-libbacktrace || test -f stagetrain-lean 
 @endif libbacktrace
 @if libcpp
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-libcpp ] || \
 	  mkdir stagefeedback-libcpp; \
 	mv stagefeedback-libcpp libcpp; \
-	mv stageprofile-libcpp prev-libcpp || test -f stageprofile-lean 
+	mv stagetrain-libcpp prev-libcpp || test -f stagetrain-lean 
 @endif libcpp
 @if libdecnumber
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-libdecnumber ] || \
 	  mkdir stagefeedback-libdecnumber; \
 	mv stagefeedback-libdecnumber libdecnumber; \
-	mv stageprofile-libdecnumber prev-libdecnumber || test -f stageprofile-lean 
+	mv stagetrain-libdecnumber prev-libdecnumber || test -f stagetrain-lean 
 @endif libdecnumber
 @if libiberty
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-libiberty ] || \
 	  mkdir stagefeedback-libiberty; \
 	mv stagefeedback-libiberty libiberty; \
-	mv stageprofile-libiberty prev-libiberty || test -f stageprofile-lean 
+	mv stagetrain-libiberty prev-libiberty || test -f stagetrain-lean 
 @endif libiberty
 @if libiberty-linker-plugin
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-libiberty-linker-plugin ] || \
 	  mkdir stagefeedback-libiberty-linker-plugin; \
 	mv stagefeedback-libiberty-linker-plugin libiberty-linker-plugin; \
-	mv stageprofile-libiberty-linker-plugin prev-libiberty-linker-plugin || test -f stageprofile-lean 
+	mv stagetrain-libiberty-linker-plugin prev-libiberty-linker-plugin || test -f stagetrain-lean 
 @endif libiberty-linker-plugin
 @if libiconv
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-libiconv ] || \
 	  mkdir stagefeedback-libiconv; \
 	mv stagefeedback-libiconv libiconv; \
-	mv stageprofile-libiconv prev-libiconv || test -f stageprofile-lean 
+	mv stagetrain-libiconv prev-libiconv || test -f stagetrain-lean 
 @endif libiconv
 @if zlib
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-zlib ] || \
 	  mkdir stagefeedback-zlib; \
 	mv stagefeedback-zlib zlib; \
-	mv stageprofile-zlib prev-zlib || test -f stageprofile-lean 
+	mv stagetrain-zlib prev-zlib || test -f stagetrain-lean 
 @endif zlib
 @if lto-plugin
 	@cd $(HOST_SUBDIR); [ -d stagefeedback-lto-plugin ] || \
 	  mkdir stagefeedback-lto-plugin; \
 	mv stagefeedback-lto-plugin lto-plugin; \
-	mv stageprofile-lto-plugin prev-lto-plugin || test -f stageprofile-lean 
+	mv stagetrain-lto-plugin prev-lto-plugin || test -f stagetrain-lean 
 @endif lto-plugin
 	@[ -d stagefeedback-$(TARGET_SUBDIR) ] || \
 	  mkdir stagefeedback-$(TARGET_SUBDIR); \
 	mv stagefeedback-$(TARGET_SUBDIR) $(TARGET_SUBDIR); \
-	mv stageprofile-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stageprofile-lean 
+	mv stagetrain-$(TARGET_SUBDIR) prev-$(TARGET_SUBDIR) || test -f stagetrain-lean 
 
 stagefeedback-end:: 
 @if bfd
 	@if test -d $(HOST_SUBDIR)/bfd; then \
 	  cd $(HOST_SUBDIR); mv bfd stagefeedback-bfd; \
-	  mv prev-bfd stageprofile-bfd; : ; \
+	  mv prev-bfd stagetrain-bfd; : ; \
 	fi
 @endif bfd
 @if opcodes
 	@if test -d $(HOST_SUBDIR)/opcodes; then \
 	  cd $(HOST_SUBDIR); mv opcodes stagefeedback-opcodes; \
-	  mv prev-opcodes stageprofile-opcodes; : ; \
+	  mv prev-opcodes stagetrain-opcodes; : ; \
 	fi
 @endif opcodes
 @if binutils
 	@if test -d $(HOST_SUBDIR)/binutils; then \
 	  cd $(HOST_SUBDIR); mv binutils stagefeedback-binutils; \
-	  mv prev-binutils stageprofile-binutils; : ; \
+	  mv prev-binutils stagetrain-binutils; : ; \
 	fi
 @endif binutils
 @if fixincludes
 	@if test -d $(HOST_SUBDIR)/fixincludes; then \
 	  cd $(HOST_SUBDIR); mv fixincludes stagefeedback-fixincludes; \
-	  mv prev-fixincludes stageprofile-fixincludes; : ; \
+	  mv prev-fixincludes stagetrain-fixincludes; : ; \
 	fi
 @endif fixincludes
 @if gas
 	@if test -d $(HOST_SUBDIR)/gas; then \
 	  cd $(HOST_SUBDIR); mv gas stagefeedback-gas; \
-	  mv prev-gas stageprofile-gas; : ; \
+	  mv prev-gas stagetrain-gas; : ; \
 	fi
 @endif gas
 @if gcc
 	@if test -d $(HOST_SUBDIR)/gcc; then \
 	  cd $(HOST_SUBDIR); mv gcc stagefeedback-gcc; \
-	  mv prev-gcc stageprofile-gcc; : ; \
+	  mv prev-gcc stagetrain-gcc; : ; \
 	fi
 @endif gcc
 @if gmp
 	@if test -d $(HOST_SUBDIR)/gmp; then \
 	  cd $(HOST_SUBDIR); mv gmp stagefeedback-gmp; \
-	  mv prev-gmp stageprofile-gmp; : ; \
+	  mv prev-gmp stagetrain-gmp; : ; \
 	fi
 @endif gmp
 @if mpfr
 	@if test -d $(HOST_SUBDIR)/mpfr; then \
 	  cd $(HOST_SUBDIR); mv mpfr stagefeedback-mpfr; \
-	  mv prev-mpfr stageprofile-mpfr; : ; \
+	  mv prev-mpfr stagetrain-mpfr; : ; \
 	fi
 @endif mpfr
 @if mpc
 	@if test -d $(HOST_SUBDIR)/mpc; then \
 	  cd $(HOST_SUBDIR); mv mpc stagefeedback-mpc; \
-	  mv prev-mpc stageprofile-mpc; : ; \
+	  mv prev-mpc stagetrain-mpc; : ; \
 	fi
 @endif mpc
 @if isl
 	@if test -d $(HOST_SUBDIR)/isl; then \
 	  cd $(HOST_SUBDIR); mv isl stagefeedback-isl; \
-	  mv prev-isl stageprofile-isl; : ; \
+	  mv prev-isl stagetrain-isl; : ; \
 	fi
 @endif isl
 @if libelf
 	@if test -d $(HOST_SUBDIR)/libelf; then \
 	  cd $(HOST_SUBDIR); mv libelf stagefeedback-libelf; \
-	  mv prev-libelf stageprofile-libelf; : ; \
+	  mv prev-libelf stagetrain-libelf; : ; \
 	fi
 @endif libelf
 @if gold
 	@if test -d $(HOST_SUBDIR)/gold; then \
 	  cd $(HOST_SUBDIR); mv gold stagefeedback-gold; \
-	  mv prev-gold stageprofile-gold; : ; \
+	  mv prev-gold stagetrain-gold; : ; \
 	fi
 @endif gold
 @if intl
 	@if test -d $(HOST_SUBDIR)/intl; then \
 	  cd $(HOST_SUBDIR); mv intl stagefeedback-intl; \
-	  mv prev-intl stageprofile-intl; : ; \
+	  mv prev-intl stagetrain-intl; : ; \
 	fi
 @endif intl
 @if ld
 	@if test -d $(HOST_SUBDIR)/ld; then \
 	  cd $(HOST_SUBDIR); mv ld stagefeedback-ld; \
-	  mv prev-ld stageprofile-ld; : ; \
+	  mv prev-ld stagetrain-ld; : ; \
 	fi
 @endif ld
 @if libbacktrace
 	@if test -d $(HOST_SUBDIR)/libbacktrace; then \
 	  cd $(HOST_SUBDIR); mv libbacktrace stagefeedback-libbacktrace; \
-	  mv prev-libbacktrace stageprofile-libbacktrace; : ; \
+	  mv prev-libbacktrace stagetrain-libbacktrace; : ; \
 	fi
 @endif libbacktrace
 @if libcpp
 	@if test -d $(HOST_SUBDIR)/libcpp; then \
 	  cd $(HOST_SUBDIR); mv libcpp stagefeedback-libcpp; \
-	  mv prev-libcpp stageprofile-libcpp; : ; \
+	  mv prev-libcpp stagetrain-libcpp; : ; \
 	fi
 @endif libcpp
 @if libdecnumber
 	@if test -d $(HOST_SUBDIR)/libdecnumber; then \
 	  cd $(HOST_SUBDIR); mv libdecnumber stagefeedback-libdecnumber; \
-	  mv prev-libdecnumber stageprofile-libdecnumber; : ; \
+	  mv prev-libdecnumber stagetrain-libdecnumber; : ; \
 	fi
 @endif libdecnumber
 @if libiberty
 	@if test -d $(HOST_SUBDIR)/libiberty; then \
 	  cd $(HOST_SUBDIR); mv libiberty stagefeedback-libiberty; \
-	  mv prev-libiberty stageprofile-libiberty; : ; \
+	  mv prev-libiberty stagetrain-libiberty; : ; \
 	fi
 @endif libiberty
 @if libiberty-linker-plugin
 	@if test -d $(HOST_SUBDIR)/libiberty-linker-plugin; then \
 	  cd $(HOST_SUBDIR); mv libiberty-linker-plugin stagefeedback-libiberty-linker-plugin; \
-	  mv prev-libiberty-linker-plugin stageprofile-libiberty-linker-plugin; : ; \
+	  mv prev-libiberty-linker-plugin stagetrain-libiberty-linker-plugin; : ; \
 	fi
 @endif libiberty-linker-plugin
 @if libiconv
 	@if test -d $(HOST_SUBDIR)/libiconv; then \
 	  cd $(HOST_SUBDIR); mv libiconv stagefeedback-libiconv; \
-	  mv prev-libiconv stageprofile-libiconv; : ; \
+	  mv prev-libiconv stagetrain-libiconv; : ; \
 	fi
 @endif libiconv
 @if zlib
 	@if test -d $(HOST_SUBDIR)/zlib; then \
 	  cd $(HOST_SUBDIR); mv zlib stagefeedback-zlib; \
-	  mv prev-zlib stageprofile-zlib; : ; \
+	  mv prev-zlib stagetrain-zlib; : ; \
 	fi
 @endif zlib
 @if lto-plugin
 	@if test -d $(HOST_SUBDIR)/lto-plugin; then \
 	  cd $(HOST_SUBDIR); mv lto-plugin stagefeedback-lto-plugin; \
-	  mv prev-lto-plugin stageprofile-lto-plugin; : ; \
+	  mv prev-lto-plugin stagetrain-lto-plugin; : ; \
 	fi
 @endif lto-plugin
 	@if test -d $(TARGET_SUBDIR); then \
 	  mv $(TARGET_SUBDIR) stagefeedback-$(TARGET_SUBDIR); \
-	  mv prev-$(TARGET_SUBDIR) stageprofile-$(TARGET_SUBDIR); : ; \
+	  mv prev-$(TARGET_SUBDIR) stagetrain-$(TARGET_SUBDIR); : ; \
 	fi
 	rm -f stage_current
 
@@ -53934,10 +56474,10 @@ stagefeedback-end::
 # remade, but not reconfigured.  The next stage (if any) will not be
 # reconfigured either.
 .PHONY: stagefeedback-bubble
-stagefeedback-bubble:: stageprofile-bubble
+stagefeedback-bubble:: stagetrain-bubble
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	if test -f stagefeedback-lean || test -f stageprofile-lean ; then \
+	if test -f stagefeedback-lean || test -f stagetrain-lean ; then \
 	  echo Skipping rebuild of stagefeedback; \
 	else \
 	  $(MAKE) stagefeedback-start; \
@@ -53978,7 +56518,7 @@ profiledbootstrap-lean:
 
 
 # Rules to wipe a stage and all the following ones, also used for cleanstrap
-distclean-stageprofile:: distclean-stagefeedback 
+distclean-stagetrain:: distclean-stagefeedback 
 .PHONY: distclean-stagefeedback
 distclean-stagefeedback::
 	@: $(MAKE); $(stage)
@@ -54682,7 +57222,7 @@ stage_current:
 .PHONY: restrap
 restrap::
 	@: $(MAKE); $(stage)
-	rm -rf stage1-$(TARGET_SUBDIR) stage2-* stage3-* stage4-* stageprofile-* stagefeedback-* stageautoprofile-* stageautofeedback-*
+	rm -rf stage1-$(TARGET_SUBDIR) stage2-* stage3-* stage4-* stageprofile-* stagetrain-* stagefeedback-* stageautoprofile-* stageautofeedback-*
 restrap:: all
 @endif gcc-bootstrap
 
@@ -54697,6 +57237,7 @@ configure-stage2-target-libstdc++-v3: maybe-all-stage2-gcc
 configure-stage3-target-libstdc++-v3: maybe-all-stage3-gcc
 configure-stage4-target-libstdc++-v3: maybe-all-stage4-gcc
 configure-stageprofile-target-libstdc++-v3: maybe-all-stageprofile-gcc
+configure-stagetrain-target-libstdc++-v3: maybe-all-stagetrain-gcc
 configure-stagefeedback-target-libstdc++-v3: maybe-all-stagefeedback-gcc
 configure-stageautoprofile-target-libstdc++-v3: maybe-all-stageautoprofile-gcc
 configure-stageautofeedback-target-libstdc++-v3: maybe-all-stageautofeedback-gcc
@@ -54705,6 +57246,7 @@ configure-stage2-target-libsanitizer: maybe-all-stage2-gcc
 configure-stage3-target-libsanitizer: maybe-all-stage3-gcc
 configure-stage4-target-libsanitizer: maybe-all-stage4-gcc
 configure-stageprofile-target-libsanitizer: maybe-all-stageprofile-gcc
+configure-stagetrain-target-libsanitizer: maybe-all-stagetrain-gcc
 configure-stagefeedback-target-libsanitizer: maybe-all-stagefeedback-gcc
 configure-stageautoprofile-target-libsanitizer: maybe-all-stageautoprofile-gcc
 configure-stageautofeedback-target-libsanitizer: maybe-all-stageautofeedback-gcc
@@ -54713,6 +57255,7 @@ configure-stage2-target-libmpx: maybe-all-stage2-gcc
 configure-stage3-target-libmpx: maybe-all-stage3-gcc
 configure-stage4-target-libmpx: maybe-all-stage4-gcc
 configure-stageprofile-target-libmpx: maybe-all-stageprofile-gcc
+configure-stagetrain-target-libmpx: maybe-all-stagetrain-gcc
 configure-stagefeedback-target-libmpx: maybe-all-stagefeedback-gcc
 configure-stageautoprofile-target-libmpx: maybe-all-stageautoprofile-gcc
 configure-stageautofeedback-target-libmpx: maybe-all-stageautofeedback-gcc
@@ -54721,6 +57264,7 @@ configure-stage2-target-libvtv: maybe-all-stage2-gcc
 configure-stage3-target-libvtv: maybe-all-stage3-gcc
 configure-stage4-target-libvtv: maybe-all-stage4-gcc
 configure-stageprofile-target-libvtv: maybe-all-stageprofile-gcc
+configure-stagetrain-target-libvtv: maybe-all-stagetrain-gcc
 configure-stagefeedback-target-libvtv: maybe-all-stagefeedback-gcc
 configure-stageautoprofile-target-libvtv: maybe-all-stageautoprofile-gcc
 configure-stageautofeedback-target-libvtv: maybe-all-stageautofeedback-gcc
@@ -54733,6 +57277,7 @@ configure-stage2-target-libgcc: maybe-all-stage2-gcc
 configure-stage3-target-libgcc: maybe-all-stage3-gcc
 configure-stage4-target-libgcc: maybe-all-stage4-gcc
 configure-stageprofile-target-libgcc: maybe-all-stageprofile-gcc
+configure-stagetrain-target-libgcc: maybe-all-stagetrain-gcc
 configure-stagefeedback-target-libgcc: maybe-all-stagefeedback-gcc
 configure-stageautoprofile-target-libgcc: maybe-all-stageautoprofile-gcc
 configure-stageautofeedback-target-libgcc: maybe-all-stageautofeedback-gcc
@@ -54754,6 +57299,7 @@ configure-stage2-target-libgomp: maybe-all-stage2-gcc
 configure-stage3-target-libgomp: maybe-all-stage3-gcc
 configure-stage4-target-libgomp: maybe-all-stage4-gcc
 configure-stageprofile-target-libgomp: maybe-all-stageprofile-gcc
+configure-stagetrain-target-libgomp: maybe-all-stagetrain-gcc
 configure-stagefeedback-target-libgomp: maybe-all-stagefeedback-gcc
 configure-stageautoprofile-target-libgomp: maybe-all-stageautoprofile-gcc
 configure-stageautofeedback-target-libgomp: maybe-all-stageautofeedback-gcc
@@ -54822,6 +57368,7 @@ configure-stage2-gcc: maybe-configure-stage2-intl
 configure-stage3-gcc: maybe-configure-stage3-intl
 configure-stage4-gcc: maybe-configure-stage4-intl
 configure-stageprofile-gcc: maybe-configure-stageprofile-intl
+configure-stagetrain-gcc: maybe-configure-stagetrain-intl
 configure-stagefeedback-gcc: maybe-configure-stagefeedback-intl
 configure-stageautoprofile-gcc: maybe-configure-stageautoprofile-intl
 configure-stageautofeedback-gcc: maybe-configure-stageautofeedback-intl
@@ -54832,6 +57379,7 @@ configure-stage2-gcc: maybe-all-stage2-gmp
 configure-stage3-gcc: maybe-all-stage3-gmp
 configure-stage4-gcc: maybe-all-stage4-gmp
 configure-stageprofile-gcc: maybe-all-stageprofile-gmp
+configure-stagetrain-gcc: maybe-all-stagetrain-gmp
 configure-stagefeedback-gcc: maybe-all-stagefeedback-gmp
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-gmp
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-gmp
@@ -54842,6 +57390,7 @@ configure-stage2-gcc: maybe-all-stage2-mpfr
 configure-stage3-gcc: maybe-all-stage3-mpfr
 configure-stage4-gcc: maybe-all-stage4-mpfr
 configure-stageprofile-gcc: maybe-all-stageprofile-mpfr
+configure-stagetrain-gcc: maybe-all-stagetrain-mpfr
 configure-stagefeedback-gcc: maybe-all-stagefeedback-mpfr
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-mpfr
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-mpfr
@@ -54852,6 +57401,7 @@ configure-stage2-gcc: maybe-all-stage2-mpc
 configure-stage3-gcc: maybe-all-stage3-mpc
 configure-stage4-gcc: maybe-all-stage4-mpc
 configure-stageprofile-gcc: maybe-all-stageprofile-mpc
+configure-stagetrain-gcc: maybe-all-stagetrain-mpc
 configure-stagefeedback-gcc: maybe-all-stagefeedback-mpc
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-mpc
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-mpc
@@ -54862,6 +57412,7 @@ configure-stage2-gcc: maybe-all-stage2-isl
 configure-stage3-gcc: maybe-all-stage3-isl
 configure-stage4-gcc: maybe-all-stage4-isl
 configure-stageprofile-gcc: maybe-all-stageprofile-isl
+configure-stagetrain-gcc: maybe-all-stagetrain-isl
 configure-stagefeedback-gcc: maybe-all-stagefeedback-isl
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-isl
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-isl
@@ -54872,6 +57423,7 @@ configure-stage2-gcc: maybe-all-stage2-lto-plugin
 configure-stage3-gcc: maybe-all-stage3-lto-plugin
 configure-stage4-gcc: maybe-all-stage4-lto-plugin
 configure-stageprofile-gcc: maybe-all-stageprofile-lto-plugin
+configure-stagetrain-gcc: maybe-all-stagetrain-lto-plugin
 configure-stagefeedback-gcc: maybe-all-stagefeedback-lto-plugin
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-lto-plugin
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-lto-plugin
@@ -54882,6 +57434,7 @@ configure-stage2-gcc: maybe-all-stage2-binutils
 configure-stage3-gcc: maybe-all-stage3-binutils
 configure-stage4-gcc: maybe-all-stage4-binutils
 configure-stageprofile-gcc: maybe-all-stageprofile-binutils
+configure-stagetrain-gcc: maybe-all-stagetrain-binutils
 configure-stagefeedback-gcc: maybe-all-stagefeedback-binutils
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-binutils
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-binutils
@@ -54892,6 +57445,7 @@ configure-stage2-gcc: maybe-all-stage2-gas
 configure-stage3-gcc: maybe-all-stage3-gas
 configure-stage4-gcc: maybe-all-stage4-gas
 configure-stageprofile-gcc: maybe-all-stageprofile-gas
+configure-stagetrain-gcc: maybe-all-stagetrain-gas
 configure-stagefeedback-gcc: maybe-all-stagefeedback-gas
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-gas
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-gas
@@ -54902,6 +57456,7 @@ configure-stage2-gcc: maybe-all-stage2-ld
 configure-stage3-gcc: maybe-all-stage3-ld
 configure-stage4-gcc: maybe-all-stage4-ld
 configure-stageprofile-gcc: maybe-all-stageprofile-ld
+configure-stagetrain-gcc: maybe-all-stagetrain-ld
 configure-stagefeedback-gcc: maybe-all-stagefeedback-ld
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-ld
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-ld
@@ -54912,6 +57467,7 @@ configure-stage2-gcc: maybe-all-stage2-gold
 configure-stage3-gcc: maybe-all-stage3-gold
 configure-stage4-gcc: maybe-all-stage4-gold
 configure-stageprofile-gcc: maybe-all-stageprofile-gold
+configure-stagetrain-gcc: maybe-all-stagetrain-gold
 configure-stagefeedback-gcc: maybe-all-stagefeedback-gold
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-gold
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-gold
@@ -54922,6 +57478,7 @@ configure-stage2-gcc: maybe-all-stage2-libelf
 configure-stage3-gcc: maybe-all-stage3-libelf
 configure-stage4-gcc: maybe-all-stage4-libelf
 configure-stageprofile-gcc: maybe-all-stageprofile-libelf
+configure-stagetrain-gcc: maybe-all-stagetrain-libelf
 configure-stagefeedback-gcc: maybe-all-stagefeedback-libelf
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-libelf
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-libelf
@@ -54932,6 +57489,7 @@ configure-stage2-gcc: maybe-all-stage2-libiconv
 configure-stage3-gcc: maybe-all-stage3-libiconv
 configure-stage4-gcc: maybe-all-stage4-libiconv
 configure-stageprofile-gcc: maybe-all-stageprofile-libiconv
+configure-stagetrain-gcc: maybe-all-stagetrain-libiconv
 configure-stagefeedback-gcc: maybe-all-stagefeedback-libiconv
 configure-stageautoprofile-gcc: maybe-all-stageautoprofile-libiconv
 configure-stageautofeedback-gcc: maybe-all-stageautofeedback-libiconv
@@ -54942,6 +57500,7 @@ all-stage2-gcc: all-stage2-libiberty
 all-stage3-gcc: all-stage3-libiberty
 all-stage4-gcc: all-stage4-libiberty
 all-stageprofile-gcc: all-stageprofile-libiberty
+all-stagetrain-gcc: all-stagetrain-libiberty
 all-stagefeedback-gcc: all-stagefeedback-libiberty
 all-stageautoprofile-gcc: all-stageautoprofile-libiberty
 all-stageautofeedback-gcc: all-stageautofeedback-libiberty
@@ -54952,6 +57511,7 @@ all-stage2-gcc: maybe-all-stage2-intl
 all-stage3-gcc: maybe-all-stage3-intl
 all-stage4-gcc: maybe-all-stage4-intl
 all-stageprofile-gcc: maybe-all-stageprofile-intl
+all-stagetrain-gcc: maybe-all-stagetrain-intl
 all-stagefeedback-gcc: maybe-all-stagefeedback-intl
 all-stageautoprofile-gcc: maybe-all-stageautoprofile-intl
 all-stageautofeedback-gcc: maybe-all-stageautofeedback-intl
@@ -54962,6 +57522,7 @@ all-stage2-gcc: maybe-all-stage2-mpfr
 all-stage3-gcc: maybe-all-stage3-mpfr
 all-stage4-gcc: maybe-all-stage4-mpfr
 all-stageprofile-gcc: maybe-all-stageprofile-mpfr
+all-stagetrain-gcc: maybe-all-stagetrain-mpfr
 all-stagefeedback-gcc: maybe-all-stagefeedback-mpfr
 all-stageautoprofile-gcc: maybe-all-stageautoprofile-mpfr
 all-stageautofeedback-gcc: maybe-all-stageautofeedback-mpfr
@@ -54972,6 +57533,7 @@ all-stage2-gcc: maybe-all-stage2-mpc
 all-stage3-gcc: maybe-all-stage3-mpc
 all-stage4-gcc: maybe-all-stage4-mpc
 all-stageprofile-gcc: maybe-all-stageprofile-mpc
+all-stagetrain-gcc: maybe-all-stagetrain-mpc
 all-stagefeedback-gcc: maybe-all-stagefeedback-mpc
 all-stageautoprofile-gcc: maybe-all-stageautoprofile-mpc
 all-stageautofeedback-gcc: maybe-all-stageautofeedback-mpc
@@ -54982,6 +57544,7 @@ all-stage2-gcc: maybe-all-stage2-isl
 all-stage3-gcc: maybe-all-stage3-isl
 all-stage4-gcc: maybe-all-stage4-isl
 all-stageprofile-gcc: maybe-all-stageprofile-isl
+all-stagetrain-gcc: maybe-all-stagetrain-isl
 all-stagefeedback-gcc: maybe-all-stagefeedback-isl
 all-stageautoprofile-gcc: maybe-all-stageautoprofile-isl
 all-stageautofeedback-gcc: maybe-all-stageautofeedback-isl
@@ -54992,6 +57555,7 @@ all-stage2-gcc: maybe-all-build-texinfo
 all-stage3-gcc: maybe-all-build-texinfo
 all-stage4-gcc: maybe-all-build-texinfo
 all-stageprofile-gcc: maybe-all-build-texinfo
+all-stagetrain-gcc: maybe-all-build-texinfo
 all-stagefeedback-gcc: maybe-all-build-texinfo
 all-stageautoprofile-gcc: maybe-all-build-texinfo
 all-stageautofeedback-gcc: maybe-all-build-texinfo
@@ -55002,6 +57566,7 @@ all-stage2-gcc: maybe-all-build-bison
 all-stage3-gcc: maybe-all-build-bison
 all-stage4-gcc: maybe-all-build-bison
 all-stageprofile-gcc: maybe-all-build-bison
+all-stagetrain-gcc: maybe-all-build-bison
 all-stagefeedback-gcc: maybe-all-build-bison
 all-stageautoprofile-gcc: maybe-all-build-bison
 all-stageautofeedback-gcc: maybe-all-build-bison
@@ -55012,6 +57577,7 @@ all-stage2-gcc: maybe-all-build-flex
 all-stage3-gcc: maybe-all-build-flex
 all-stage4-gcc: maybe-all-build-flex
 all-stageprofile-gcc: maybe-all-build-flex
+all-stagetrain-gcc: maybe-all-build-flex
 all-stagefeedback-gcc: maybe-all-build-flex
 all-stageautoprofile-gcc: maybe-all-build-flex
 all-stageautofeedback-gcc: maybe-all-build-flex
@@ -55022,6 +57588,7 @@ all-stage2-gcc: maybe-all-build-libiberty
 all-stage3-gcc: maybe-all-build-libiberty
 all-stage4-gcc: maybe-all-build-libiberty
 all-stageprofile-gcc: maybe-all-build-libiberty
+all-stagetrain-gcc: maybe-all-build-libiberty
 all-stagefeedback-gcc: maybe-all-build-libiberty
 all-stageautoprofile-gcc: maybe-all-build-libiberty
 all-stageautofeedback-gcc: maybe-all-build-libiberty
@@ -55032,6 +57599,7 @@ all-stage2-gcc: maybe-all-build-fixincludes
 all-stage3-gcc: maybe-all-build-fixincludes
 all-stage4-gcc: maybe-all-build-fixincludes
 all-stageprofile-gcc: maybe-all-build-fixincludes
+all-stagetrain-gcc: maybe-all-build-fixincludes
 all-stagefeedback-gcc: maybe-all-build-fixincludes
 all-stageautoprofile-gcc: maybe-all-build-fixincludes
 all-stageautofeedback-gcc: maybe-all-build-fixincludes
@@ -55042,6 +57610,7 @@ all-stage2-gcc: maybe-all-build-libcpp
 all-stage3-gcc: maybe-all-build-libcpp
 all-stage4-gcc: maybe-all-build-libcpp
 all-stageprofile-gcc: maybe-all-build-libcpp
+all-stagetrain-gcc: maybe-all-build-libcpp
 all-stagefeedback-gcc: maybe-all-build-libcpp
 all-stageautoprofile-gcc: maybe-all-build-libcpp
 all-stageautofeedback-gcc: maybe-all-build-libcpp
@@ -55052,6 +57621,7 @@ all-stage2-gcc: maybe-all-stage2-zlib
 all-stage3-gcc: maybe-all-stage3-zlib
 all-stage4-gcc: maybe-all-stage4-zlib
 all-stageprofile-gcc: maybe-all-stageprofile-zlib
+all-stagetrain-gcc: maybe-all-stagetrain-zlib
 all-stagefeedback-gcc: maybe-all-stagefeedback-zlib
 all-stageautoprofile-gcc: maybe-all-stageautoprofile-zlib
 all-stageautofeedback-gcc: maybe-all-stageautofeedback-zlib
@@ -55062,6 +57632,7 @@ all-stage2-gcc: all-stage2-libbacktrace
 all-stage3-gcc: all-stage3-libbacktrace
 all-stage4-gcc: all-stage4-libbacktrace
 all-stageprofile-gcc: all-stageprofile-libbacktrace
+all-stagetrain-gcc: all-stagetrain-libbacktrace
 all-stagefeedback-gcc: all-stagefeedback-libbacktrace
 all-stageautoprofile-gcc: all-stageautoprofile-libbacktrace
 all-stageautofeedback-gcc: all-stageautofeedback-libbacktrace
@@ -55072,6 +57643,7 @@ all-stage2-gcc: all-stage2-libcpp
 all-stage3-gcc: all-stage3-libcpp
 all-stage4-gcc: all-stage4-libcpp
 all-stageprofile-gcc: all-stageprofile-libcpp
+all-stagetrain-gcc: all-stagetrain-libcpp
 all-stagefeedback-gcc: all-stagefeedback-libcpp
 all-stageautoprofile-gcc: all-stageautoprofile-libcpp
 all-stageautofeedback-gcc: all-stageautofeedback-libcpp
@@ -55082,6 +57654,7 @@ all-stage2-gcc: all-stage2-libdecnumber
 all-stage3-gcc: all-stage3-libdecnumber
 all-stage4-gcc: all-stage4-libdecnumber
 all-stageprofile-gcc: all-stageprofile-libdecnumber
+all-stagetrain-gcc: all-stagetrain-libdecnumber
 all-stagefeedback-gcc: all-stagefeedback-libdecnumber
 all-stageautoprofile-gcc: all-stageautoprofile-libdecnumber
 all-stageautofeedback-gcc: all-stageautofeedback-libdecnumber
@@ -55092,6 +57665,7 @@ all-stage2-gcc: maybe-all-stage2-libiberty
 all-stage3-gcc: maybe-all-stage3-libiberty
 all-stage4-gcc: maybe-all-stage4-libiberty
 all-stageprofile-gcc: maybe-all-stageprofile-libiberty
+all-stagetrain-gcc: maybe-all-stagetrain-libiberty
 all-stagefeedback-gcc: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-gcc: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-gcc: maybe-all-stageautofeedback-libiberty
@@ -55102,6 +57676,7 @@ all-stage2-gcc: maybe-all-stage2-fixincludes
 all-stage3-gcc: maybe-all-stage3-fixincludes
 all-stage4-gcc: maybe-all-stage4-fixincludes
 all-stageprofile-gcc: maybe-all-stageprofile-fixincludes
+all-stagetrain-gcc: maybe-all-stagetrain-fixincludes
 all-stagefeedback-gcc: maybe-all-stagefeedback-fixincludes
 all-stageautoprofile-gcc: maybe-all-stageautoprofile-fixincludes
 all-stageautofeedback-gcc: maybe-all-stageautofeedback-fixincludes
@@ -55112,6 +57687,7 @@ all-stage2-gcc: maybe-all-stage2-lto-plugin
 all-stage3-gcc: maybe-all-stage3-lto-plugin
 all-stage4-gcc: maybe-all-stage4-lto-plugin
 all-stageprofile-gcc: maybe-all-stageprofile-lto-plugin
+all-stagetrain-gcc: maybe-all-stagetrain-lto-plugin
 all-stagefeedback-gcc: maybe-all-stagefeedback-lto-plugin
 all-stageautoprofile-gcc: maybe-all-stageautoprofile-lto-plugin
 all-stageautofeedback-gcc: maybe-all-stageautofeedback-lto-plugin
@@ -55122,6 +57698,7 @@ all-stage2-gcc: maybe-all-stage2-libiconv
 all-stage3-gcc: maybe-all-stage3-libiconv
 all-stage4-gcc: maybe-all-stage4-libiconv
 all-stageprofile-gcc: maybe-all-stageprofile-libiconv
+all-stagetrain-gcc: maybe-all-stagetrain-libiconv
 all-stagefeedback-gcc: maybe-all-stagefeedback-libiconv
 all-stageautoprofile-gcc: maybe-all-stageautoprofile-libiconv
 all-stageautofeedback-gcc: maybe-all-stageautofeedback-libiconv
@@ -55132,6 +57709,7 @@ info-stage2-gcc: maybe-all-build-libiberty
 info-stage3-gcc: maybe-all-build-libiberty
 info-stage4-gcc: maybe-all-build-libiberty
 info-stageprofile-gcc: maybe-all-build-libiberty
+info-stagetrain-gcc: maybe-all-build-libiberty
 info-stagefeedback-gcc: maybe-all-build-libiberty
 info-stageautoprofile-gcc: maybe-all-build-libiberty
 info-stageautofeedback-gcc: maybe-all-build-libiberty
@@ -55142,6 +57720,7 @@ dvi-stage2-gcc: maybe-all-build-libiberty
 dvi-stage3-gcc: maybe-all-build-libiberty
 dvi-stage4-gcc: maybe-all-build-libiberty
 dvi-stageprofile-gcc: maybe-all-build-libiberty
+dvi-stagetrain-gcc: maybe-all-build-libiberty
 dvi-stagefeedback-gcc: maybe-all-build-libiberty
 dvi-stageautoprofile-gcc: maybe-all-build-libiberty
 dvi-stageautofeedback-gcc: maybe-all-build-libiberty
@@ -55152,6 +57731,7 @@ pdf-stage2-gcc: maybe-all-build-libiberty
 pdf-stage3-gcc: maybe-all-build-libiberty
 pdf-stage4-gcc: maybe-all-build-libiberty
 pdf-stageprofile-gcc: maybe-all-build-libiberty
+pdf-stagetrain-gcc: maybe-all-build-libiberty
 pdf-stagefeedback-gcc: maybe-all-build-libiberty
 pdf-stageautoprofile-gcc: maybe-all-build-libiberty
 pdf-stageautofeedback-gcc: maybe-all-build-libiberty
@@ -55162,6 +57742,7 @@ html-stage2-gcc: maybe-all-build-libiberty
 html-stage3-gcc: maybe-all-build-libiberty
 html-stage4-gcc: maybe-all-build-libiberty
 html-stageprofile-gcc: maybe-all-build-libiberty
+html-stagetrain-gcc: maybe-all-build-libiberty
 html-stagefeedback-gcc: maybe-all-build-libiberty
 html-stageautoprofile-gcc: maybe-all-build-libiberty
 html-stageautofeedback-gcc: maybe-all-build-libiberty
@@ -55176,6 +57757,7 @@ configure-stage2-libcpp: configure-stage2-libiberty
 configure-stage3-libcpp: configure-stage3-libiberty
 configure-stage4-libcpp: configure-stage4-libiberty
 configure-stageprofile-libcpp: configure-stageprofile-libiberty
+configure-stagetrain-libcpp: configure-stagetrain-libiberty
 configure-stagefeedback-libcpp: configure-stagefeedback-libiberty
 configure-stageautoprofile-libcpp: configure-stageautoprofile-libiberty
 configure-stageautofeedback-libcpp: configure-stageautofeedback-libiberty
@@ -55186,6 +57768,7 @@ configure-stage2-libcpp: maybe-configure-stage2-intl
 configure-stage3-libcpp: maybe-configure-stage3-intl
 configure-stage4-libcpp: maybe-configure-stage4-intl
 configure-stageprofile-libcpp: maybe-configure-stageprofile-intl
+configure-stagetrain-libcpp: maybe-configure-stagetrain-intl
 configure-stagefeedback-libcpp: maybe-configure-stagefeedback-intl
 configure-stageautoprofile-libcpp: maybe-configure-stageautoprofile-intl
 configure-stageautofeedback-libcpp: maybe-configure-stageautofeedback-intl
@@ -55196,6 +57779,7 @@ configure-stage2-libcpp: maybe-all-stage2-libiconv
 configure-stage3-libcpp: maybe-all-stage3-libiconv
 configure-stage4-libcpp: maybe-all-stage4-libiconv
 configure-stageprofile-libcpp: maybe-all-stageprofile-libiconv
+configure-stagetrain-libcpp: maybe-all-stagetrain-libiconv
 configure-stagefeedback-libcpp: maybe-all-stagefeedback-libiconv
 configure-stageautoprofile-libcpp: maybe-all-stageautoprofile-libiconv
 configure-stageautofeedback-libcpp: maybe-all-stageautofeedback-libiconv
@@ -55206,6 +57790,7 @@ all-stage2-libcpp: all-stage2-libiberty
 all-stage3-libcpp: all-stage3-libiberty
 all-stage4-libcpp: all-stage4-libiberty
 all-stageprofile-libcpp: all-stageprofile-libiberty
+all-stagetrain-libcpp: all-stagetrain-libiberty
 all-stagefeedback-libcpp: all-stagefeedback-libiberty
 all-stageautoprofile-libcpp: all-stageautoprofile-libiberty
 all-stageautofeedback-libcpp: all-stageautofeedback-libiberty
@@ -55216,6 +57801,7 @@ all-stage2-libcpp: maybe-all-stage2-intl
 all-stage3-libcpp: maybe-all-stage3-intl
 all-stage4-libcpp: maybe-all-stage4-intl
 all-stageprofile-libcpp: maybe-all-stageprofile-intl
+all-stagetrain-libcpp: maybe-all-stagetrain-intl
 all-stagefeedback-libcpp: maybe-all-stagefeedback-intl
 all-stageautoprofile-libcpp: maybe-all-stageautoprofile-intl
 all-stageautofeedback-libcpp: maybe-all-stageautofeedback-intl
@@ -55226,6 +57812,7 @@ all-stage2-libcpp: maybe-all-stage2-libiconv
 all-stage3-libcpp: maybe-all-stage3-libiconv
 all-stage4-libcpp: maybe-all-stage4-libiconv
 all-stageprofile-libcpp: maybe-all-stageprofile-libiconv
+all-stagetrain-libcpp: maybe-all-stagetrain-libiconv
 all-stagefeedback-libcpp: maybe-all-stagefeedback-libiconv
 all-stageautoprofile-libcpp: maybe-all-stageautoprofile-libiconv
 all-stageautofeedback-libcpp: maybe-all-stageautofeedback-libiconv
@@ -55236,6 +57823,7 @@ all-stage2-fixincludes: maybe-all-stage2-libiberty
 all-stage3-fixincludes: maybe-all-stage3-libiberty
 all-stage4-fixincludes: maybe-all-stage4-libiberty
 all-stageprofile-fixincludes: maybe-all-stageprofile-libiberty
+all-stagetrain-fixincludes: maybe-all-stagetrain-libiberty
 all-stagefeedback-fixincludes: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-fixincludes: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-fixincludes: maybe-all-stageautofeedback-libiberty
@@ -55248,6 +57836,7 @@ all-stage2-lto-plugin: maybe-all-stage2-libiberty
 all-stage3-lto-plugin: maybe-all-stage3-libiberty
 all-stage4-lto-plugin: maybe-all-stage4-libiberty
 all-stageprofile-lto-plugin: maybe-all-stageprofile-libiberty
+all-stagetrain-lto-plugin: maybe-all-stagetrain-libiberty
 all-stagefeedback-lto-plugin: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-lto-plugin: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-lto-plugin: maybe-all-stageautofeedback-libiberty
@@ -55258,6 +57847,7 @@ all-stage2-lto-plugin: maybe-all-stage2-libiberty-linker-plugin
 all-stage3-lto-plugin: maybe-all-stage3-libiberty-linker-plugin
 all-stage4-lto-plugin: maybe-all-stage4-libiberty-linker-plugin
 all-stageprofile-lto-plugin: maybe-all-stageprofile-libiberty-linker-plugin
+all-stagetrain-lto-plugin: maybe-all-stagetrain-libiberty-linker-plugin
 all-stagefeedback-lto-plugin: maybe-all-stagefeedback-libiberty-linker-plugin
 all-stageautoprofile-lto-plugin: maybe-all-stageautoprofile-libiberty-linker-plugin
 all-stageautofeedback-lto-plugin: maybe-all-stageautofeedback-libiberty-linker-plugin
@@ -55272,6 +57862,7 @@ configure-stage2-intl: maybe-all-stage2-libiconv
 configure-stage3-intl: maybe-all-stage3-libiconv
 configure-stage4-intl: maybe-all-stage4-libiconv
 configure-stageprofile-intl: maybe-all-stageprofile-libiconv
+configure-stagetrain-intl: maybe-all-stagetrain-libiconv
 configure-stagefeedback-intl: maybe-all-stagefeedback-libiconv
 configure-stageautoprofile-intl: maybe-all-stageautoprofile-libiconv
 configure-stageautofeedback-intl: maybe-all-stageautofeedback-libiconv
@@ -55282,6 +57873,7 @@ configure-stage2-mpfr: maybe-all-stage2-gmp
 configure-stage3-mpfr: maybe-all-stage3-gmp
 configure-stage4-mpfr: maybe-all-stage4-gmp
 configure-stageprofile-mpfr: maybe-all-stageprofile-gmp
+configure-stagetrain-mpfr: maybe-all-stagetrain-gmp
 configure-stagefeedback-mpfr: maybe-all-stagefeedback-gmp
 configure-stageautoprofile-mpfr: maybe-all-stageautoprofile-gmp
 configure-stageautofeedback-mpfr: maybe-all-stageautofeedback-gmp
@@ -55292,6 +57884,7 @@ configure-stage2-mpc: maybe-all-stage2-mpfr
 configure-stage3-mpc: maybe-all-stage3-mpfr
 configure-stage4-mpc: maybe-all-stage4-mpfr
 configure-stageprofile-mpc: maybe-all-stageprofile-mpfr
+configure-stagetrain-mpc: maybe-all-stagetrain-mpfr
 configure-stagefeedback-mpc: maybe-all-stagefeedback-mpfr
 configure-stageautoprofile-mpc: maybe-all-stageautoprofile-mpfr
 configure-stageautofeedback-mpc: maybe-all-stageautofeedback-mpfr
@@ -55302,6 +57895,7 @@ configure-stage2-isl: maybe-all-stage2-gmp
 configure-stage3-isl: maybe-all-stage3-gmp
 configure-stage4-isl: maybe-all-stage4-gmp
 configure-stageprofile-isl: maybe-all-stageprofile-gmp
+configure-stagetrain-isl: maybe-all-stagetrain-gmp
 configure-stagefeedback-isl: maybe-all-stagefeedback-gmp
 configure-stageautoprofile-isl: maybe-all-stageautoprofile-gmp
 configure-stageautofeedback-isl: maybe-all-stageautofeedback-gmp
@@ -55312,6 +57906,7 @@ all-stage2-intl: maybe-all-stage2-libiconv
 all-stage3-intl: maybe-all-stage3-libiconv
 all-stage4-intl: maybe-all-stage4-libiconv
 all-stageprofile-intl: maybe-all-stageprofile-libiconv
+all-stagetrain-intl: maybe-all-stagetrain-libiconv
 all-stagefeedback-intl: maybe-all-stagefeedback-libiconv
 all-stageautoprofile-intl: maybe-all-stageautoprofile-libiconv
 all-stageautofeedback-intl: maybe-all-stageautofeedback-libiconv
@@ -55339,6 +57934,7 @@ configure-stage2-bfd: configure-stage2-libiberty
 configure-stage3-bfd: configure-stage3-libiberty
 configure-stage4-bfd: configure-stage4-libiberty
 configure-stageprofile-bfd: configure-stageprofile-libiberty
+configure-stagetrain-bfd: configure-stagetrain-libiberty
 configure-stagefeedback-bfd: configure-stagefeedback-libiberty
 configure-stageautoprofile-bfd: configure-stageautoprofile-libiberty
 configure-stageautofeedback-bfd: configure-stageautofeedback-libiberty
@@ -55349,6 +57945,7 @@ configure-stage2-bfd: maybe-configure-stage2-intl
 configure-stage3-bfd: maybe-configure-stage3-intl
 configure-stage4-bfd: maybe-configure-stage4-intl
 configure-stageprofile-bfd: maybe-configure-stageprofile-intl
+configure-stagetrain-bfd: maybe-configure-stagetrain-intl
 configure-stagefeedback-bfd: maybe-configure-stagefeedback-intl
 configure-stageautoprofile-bfd: maybe-configure-stageautoprofile-intl
 configure-stageautofeedback-bfd: maybe-configure-stageautofeedback-intl
@@ -55359,6 +57956,7 @@ all-stage2-bfd: maybe-all-stage2-libiberty
 all-stage3-bfd: maybe-all-stage3-libiberty
 all-stage4-bfd: maybe-all-stage4-libiberty
 all-stageprofile-bfd: maybe-all-stageprofile-libiberty
+all-stagetrain-bfd: maybe-all-stagetrain-libiberty
 all-stagefeedback-bfd: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-bfd: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-bfd: maybe-all-stageautofeedback-libiberty
@@ -55369,6 +57967,7 @@ all-stage2-bfd: maybe-all-stage2-intl
 all-stage3-bfd: maybe-all-stage3-intl
 all-stage4-bfd: maybe-all-stage4-intl
 all-stageprofile-bfd: maybe-all-stageprofile-intl
+all-stagetrain-bfd: maybe-all-stagetrain-intl
 all-stagefeedback-bfd: maybe-all-stagefeedback-intl
 all-stageautoprofile-bfd: maybe-all-stageautoprofile-intl
 all-stageautofeedback-bfd: maybe-all-stageautofeedback-intl
@@ -55379,6 +57978,7 @@ all-stage2-bfd: maybe-all-stage2-zlib
 all-stage3-bfd: maybe-all-stage3-zlib
 all-stage4-bfd: maybe-all-stage4-zlib
 all-stageprofile-bfd: maybe-all-stageprofile-zlib
+all-stagetrain-bfd: maybe-all-stagetrain-zlib
 all-stagefeedback-bfd: maybe-all-stagefeedback-zlib
 all-stageautoprofile-bfd: maybe-all-stageautoprofile-zlib
 all-stageautofeedback-bfd: maybe-all-stageautofeedback-zlib
@@ -55389,6 +57989,7 @@ configure-stage2-opcodes: configure-stage2-libiberty
 configure-stage3-opcodes: configure-stage3-libiberty
 configure-stage4-opcodes: configure-stage4-libiberty
 configure-stageprofile-opcodes: configure-stageprofile-libiberty
+configure-stagetrain-opcodes: configure-stagetrain-libiberty
 configure-stagefeedback-opcodes: configure-stagefeedback-libiberty
 configure-stageautoprofile-opcodes: configure-stageautoprofile-libiberty
 configure-stageautofeedback-opcodes: configure-stageautofeedback-libiberty
@@ -55399,6 +58000,7 @@ all-stage2-opcodes: maybe-all-stage2-libiberty
 all-stage3-opcodes: maybe-all-stage3-libiberty
 all-stage4-opcodes: maybe-all-stage4-libiberty
 all-stageprofile-opcodes: maybe-all-stageprofile-libiberty
+all-stagetrain-opcodes: maybe-all-stagetrain-libiberty
 all-stagefeedback-opcodes: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-opcodes: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-opcodes: maybe-all-stageautofeedback-libiberty
@@ -55409,6 +58011,7 @@ configure-stage2-binutils: maybe-configure-stage2-intl
 configure-stage3-binutils: maybe-configure-stage3-intl
 configure-stage4-binutils: maybe-configure-stage4-intl
 configure-stageprofile-binutils: maybe-configure-stageprofile-intl
+configure-stagetrain-binutils: maybe-configure-stagetrain-intl
 configure-stagefeedback-binutils: maybe-configure-stagefeedback-intl
 configure-stageautoprofile-binutils: maybe-configure-stageautoprofile-intl
 configure-stageautofeedback-binutils: maybe-configure-stageautofeedback-intl
@@ -55419,6 +58022,7 @@ all-stage2-binutils: maybe-all-stage2-libiberty
 all-stage3-binutils: maybe-all-stage3-libiberty
 all-stage4-binutils: maybe-all-stage4-libiberty
 all-stageprofile-binutils: maybe-all-stageprofile-libiberty
+all-stagetrain-binutils: maybe-all-stagetrain-libiberty
 all-stagefeedback-binutils: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-binutils: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-binutils: maybe-all-stageautofeedback-libiberty
@@ -55429,6 +58033,7 @@ all-stage2-binutils: maybe-all-stage2-opcodes
 all-stage3-binutils: maybe-all-stage3-opcodes
 all-stage4-binutils: maybe-all-stage4-opcodes
 all-stageprofile-binutils: maybe-all-stageprofile-opcodes
+all-stagetrain-binutils: maybe-all-stagetrain-opcodes
 all-stagefeedback-binutils: maybe-all-stagefeedback-opcodes
 all-stageautoprofile-binutils: maybe-all-stageautoprofile-opcodes
 all-stageautofeedback-binutils: maybe-all-stageautofeedback-opcodes
@@ -55439,6 +58044,7 @@ all-stage2-binutils: maybe-all-stage2-bfd
 all-stage3-binutils: maybe-all-stage3-bfd
 all-stage4-binutils: maybe-all-stage4-bfd
 all-stageprofile-binutils: maybe-all-stageprofile-bfd
+all-stagetrain-binutils: maybe-all-stagetrain-bfd
 all-stagefeedback-binutils: maybe-all-stagefeedback-bfd
 all-stageautoprofile-binutils: maybe-all-stageautoprofile-bfd
 all-stageautofeedback-binutils: maybe-all-stageautofeedback-bfd
@@ -55449,6 +58055,7 @@ all-stage2-binutils: maybe-all-build-flex
 all-stage3-binutils: maybe-all-build-flex
 all-stage4-binutils: maybe-all-build-flex
 all-stageprofile-binutils: maybe-all-build-flex
+all-stagetrain-binutils: maybe-all-build-flex
 all-stagefeedback-binutils: maybe-all-build-flex
 all-stageautoprofile-binutils: maybe-all-build-flex
 all-stageautofeedback-binutils: maybe-all-build-flex
@@ -55459,6 +58066,7 @@ all-stage2-binutils: maybe-all-build-bison
 all-stage3-binutils: maybe-all-build-bison
 all-stage4-binutils: maybe-all-build-bison
 all-stageprofile-binutils: maybe-all-build-bison
+all-stagetrain-binutils: maybe-all-build-bison
 all-stagefeedback-binutils: maybe-all-build-bison
 all-stageautoprofile-binutils: maybe-all-build-bison
 all-stageautofeedback-binutils: maybe-all-build-bison
@@ -55469,6 +58077,7 @@ all-stage2-binutils: maybe-all-stage2-intl
 all-stage3-binutils: maybe-all-stage3-intl
 all-stage4-binutils: maybe-all-stage4-intl
 all-stageprofile-binutils: maybe-all-stageprofile-intl
+all-stagetrain-binutils: maybe-all-stagetrain-intl
 all-stagefeedback-binutils: maybe-all-stagefeedback-intl
 all-stageautoprofile-binutils: maybe-all-stageautoprofile-intl
 all-stageautofeedback-binutils: maybe-all-stageautofeedback-intl
@@ -55479,6 +58088,7 @@ all-stage2-binutils: maybe-all-stage2-gas
 all-stage3-binutils: maybe-all-stage3-gas
 all-stage4-binutils: maybe-all-stage4-gas
 all-stageprofile-binutils: maybe-all-stageprofile-gas
+all-stagetrain-binutils: maybe-all-stagetrain-gas
 all-stagefeedback-binutils: maybe-all-stagefeedback-gas
 all-stageautoprofile-binutils: maybe-all-stageautoprofile-gas
 all-stageautofeedback-binutils: maybe-all-stageautofeedback-gas
@@ -55493,6 +58103,7 @@ configure-stage2-gas: maybe-configure-stage2-intl
 configure-stage3-gas: maybe-configure-stage3-intl
 configure-stage4-gas: maybe-configure-stage4-intl
 configure-stageprofile-gas: maybe-configure-stageprofile-intl
+configure-stagetrain-gas: maybe-configure-stagetrain-intl
 configure-stagefeedback-gas: maybe-configure-stagefeedback-intl
 configure-stageautoprofile-gas: maybe-configure-stageautoprofile-intl
 configure-stageautofeedback-gas: maybe-configure-stageautofeedback-intl
@@ -55503,6 +58114,7 @@ all-stage2-gas: maybe-all-stage2-libiberty
 all-stage3-gas: maybe-all-stage3-libiberty
 all-stage4-gas: maybe-all-stage4-libiberty
 all-stageprofile-gas: maybe-all-stageprofile-libiberty
+all-stagetrain-gas: maybe-all-stagetrain-libiberty
 all-stagefeedback-gas: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-gas: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-gas: maybe-all-stageautofeedback-libiberty
@@ -55513,6 +58125,7 @@ all-stage2-gas: maybe-all-stage2-opcodes
 all-stage3-gas: maybe-all-stage3-opcodes
 all-stage4-gas: maybe-all-stage4-opcodes
 all-stageprofile-gas: maybe-all-stageprofile-opcodes
+all-stagetrain-gas: maybe-all-stagetrain-opcodes
 all-stagefeedback-gas: maybe-all-stagefeedback-opcodes
 all-stageautoprofile-gas: maybe-all-stageautoprofile-opcodes
 all-stageautofeedback-gas: maybe-all-stageautofeedback-opcodes
@@ -55523,6 +58136,7 @@ all-stage2-gas: maybe-all-stage2-bfd
 all-stage3-gas: maybe-all-stage3-bfd
 all-stage4-gas: maybe-all-stage4-bfd
 all-stageprofile-gas: maybe-all-stageprofile-bfd
+all-stagetrain-gas: maybe-all-stagetrain-bfd
 all-stagefeedback-gas: maybe-all-stagefeedback-bfd
 all-stageautoprofile-gas: maybe-all-stageautoprofile-bfd
 all-stageautofeedback-gas: maybe-all-stageautofeedback-bfd
@@ -55533,6 +58147,7 @@ all-stage2-gas: maybe-all-stage2-intl
 all-stage3-gas: maybe-all-stage3-intl
 all-stage4-gas: maybe-all-stage4-intl
 all-stageprofile-gas: maybe-all-stageprofile-intl
+all-stagetrain-gas: maybe-all-stagetrain-intl
 all-stagefeedback-gas: maybe-all-stagefeedback-intl
 all-stageautoprofile-gas: maybe-all-stageautoprofile-intl
 all-stageautofeedback-gas: maybe-all-stageautofeedback-intl
@@ -55549,6 +58164,7 @@ configure-stage2-ld: maybe-configure-stage2-intl
 configure-stage3-ld: maybe-configure-stage3-intl
 configure-stage4-ld: maybe-configure-stage4-intl
 configure-stageprofile-ld: maybe-configure-stageprofile-intl
+configure-stagetrain-ld: maybe-configure-stagetrain-intl
 configure-stagefeedback-ld: maybe-configure-stagefeedback-intl
 configure-stageautoprofile-ld: maybe-configure-stageautoprofile-intl
 configure-stageautofeedback-ld: maybe-configure-stageautofeedback-intl
@@ -55559,6 +58175,7 @@ all-stage2-ld: maybe-all-stage2-libiberty
 all-stage3-ld: maybe-all-stage3-libiberty
 all-stage4-ld: maybe-all-stage4-libiberty
 all-stageprofile-ld: maybe-all-stageprofile-libiberty
+all-stagetrain-ld: maybe-all-stagetrain-libiberty
 all-stagefeedback-ld: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-ld: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-ld: maybe-all-stageautofeedback-libiberty
@@ -55569,6 +58186,7 @@ all-stage2-ld: maybe-all-stage2-bfd
 all-stage3-ld: maybe-all-stage3-bfd
 all-stage4-ld: maybe-all-stage4-bfd
 all-stageprofile-ld: maybe-all-stageprofile-bfd
+all-stagetrain-ld: maybe-all-stagetrain-bfd
 all-stagefeedback-ld: maybe-all-stagefeedback-bfd
 all-stageautoprofile-ld: maybe-all-stageautoprofile-bfd
 all-stageautofeedback-ld: maybe-all-stageautofeedback-bfd
@@ -55579,6 +58197,7 @@ all-stage2-ld: maybe-all-stage2-opcodes
 all-stage3-ld: maybe-all-stage3-opcodes
 all-stage4-ld: maybe-all-stage4-opcodes
 all-stageprofile-ld: maybe-all-stageprofile-opcodes
+all-stagetrain-ld: maybe-all-stagetrain-opcodes
 all-stagefeedback-ld: maybe-all-stagefeedback-opcodes
 all-stageautoprofile-ld: maybe-all-stageautoprofile-opcodes
 all-stageautofeedback-ld: maybe-all-stageautofeedback-opcodes
@@ -55589,6 +58208,7 @@ all-stage2-ld: maybe-all-build-bison
 all-stage3-ld: maybe-all-build-bison
 all-stage4-ld: maybe-all-build-bison
 all-stageprofile-ld: maybe-all-build-bison
+all-stagetrain-ld: maybe-all-build-bison
 all-stagefeedback-ld: maybe-all-build-bison
 all-stageautoprofile-ld: maybe-all-build-bison
 all-stageautofeedback-ld: maybe-all-build-bison
@@ -55599,6 +58219,7 @@ all-stage2-ld: maybe-all-build-flex
 all-stage3-ld: maybe-all-build-flex
 all-stage4-ld: maybe-all-build-flex
 all-stageprofile-ld: maybe-all-build-flex
+all-stagetrain-ld: maybe-all-build-flex
 all-stagefeedback-ld: maybe-all-build-flex
 all-stageautoprofile-ld: maybe-all-build-flex
 all-stageautofeedback-ld: maybe-all-build-flex
@@ -55609,6 +58230,7 @@ all-stage2-ld: maybe-all-stage2-intl
 all-stage3-ld: maybe-all-stage3-intl
 all-stage4-ld: maybe-all-stage4-intl
 all-stageprofile-ld: maybe-all-stageprofile-intl
+all-stagetrain-ld: maybe-all-stagetrain-intl
 all-stagefeedback-ld: maybe-all-stagefeedback-intl
 all-stageautoprofile-ld: maybe-all-stageautoprofile-intl
 all-stageautofeedback-ld: maybe-all-stageautofeedback-intl
@@ -55619,6 +58241,7 @@ all-stage2-ld: maybe-all-stage2-gas
 all-stage3-ld: maybe-all-stage3-gas
 all-stage4-ld: maybe-all-stage4-gas
 all-stageprofile-ld: maybe-all-stageprofile-gas
+all-stagetrain-ld: maybe-all-stagetrain-gas
 all-stagefeedback-ld: maybe-all-stagefeedback-gas
 all-stageautoprofile-ld: maybe-all-stageautoprofile-gas
 all-stageautofeedback-ld: maybe-all-stageautofeedback-gas
@@ -55629,6 +58252,7 @@ all-stage2-ld: maybe-all-stage2-binutils
 all-stage3-ld: maybe-all-stage3-binutils
 all-stage4-ld: maybe-all-stage4-binutils
 all-stageprofile-ld: maybe-all-stageprofile-binutils
+all-stagetrain-ld: maybe-all-stagetrain-binutils
 all-stagefeedback-ld: maybe-all-stagefeedback-binutils
 all-stageautoprofile-ld: maybe-all-stageautoprofile-binutils
 all-stageautofeedback-ld: maybe-all-stageautofeedback-binutils
@@ -55641,6 +58265,7 @@ configure-stage2-gold: maybe-configure-stage2-intl
 configure-stage3-gold: maybe-configure-stage3-intl
 configure-stage4-gold: maybe-configure-stage4-intl
 configure-stageprofile-gold: maybe-configure-stageprofile-intl
+configure-stagetrain-gold: maybe-configure-stagetrain-intl
 configure-stagefeedback-gold: maybe-configure-stagefeedback-intl
 configure-stageautoprofile-gold: maybe-configure-stageautoprofile-intl
 configure-stageautofeedback-gold: maybe-configure-stageautofeedback-intl
@@ -55651,6 +58276,7 @@ all-stage2-gold: maybe-all-stage2-libiberty
 all-stage3-gold: maybe-all-stage3-libiberty
 all-stage4-gold: maybe-all-stage4-libiberty
 all-stageprofile-gold: maybe-all-stageprofile-libiberty
+all-stagetrain-gold: maybe-all-stagetrain-libiberty
 all-stagefeedback-gold: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-gold: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-gold: maybe-all-stageautofeedback-libiberty
@@ -55661,6 +58287,7 @@ all-stage2-gold: maybe-all-stage2-intl
 all-stage3-gold: maybe-all-stage3-intl
 all-stage4-gold: maybe-all-stage4-intl
 all-stageprofile-gold: maybe-all-stageprofile-intl
+all-stagetrain-gold: maybe-all-stagetrain-intl
 all-stagefeedback-gold: maybe-all-stagefeedback-intl
 all-stageautoprofile-gold: maybe-all-stageautoprofile-intl
 all-stageautofeedback-gold: maybe-all-stageautofeedback-intl
@@ -55671,6 +58298,7 @@ all-stage2-gold: maybe-all-stage2-bfd
 all-stage3-gold: maybe-all-stage3-bfd
 all-stage4-gold: maybe-all-stage4-bfd
 all-stageprofile-gold: maybe-all-stageprofile-bfd
+all-stagetrain-gold: maybe-all-stagetrain-bfd
 all-stagefeedback-gold: maybe-all-stagefeedback-bfd
 all-stageautoprofile-gold: maybe-all-stageautoprofile-bfd
 all-stageautofeedback-gold: maybe-all-stageautofeedback-bfd
@@ -55681,6 +58309,7 @@ all-stage2-gold: maybe-all-build-bison
 all-stage3-gold: maybe-all-build-bison
 all-stage4-gold: maybe-all-build-bison
 all-stageprofile-gold: maybe-all-build-bison
+all-stagetrain-gold: maybe-all-build-bison
 all-stagefeedback-gold: maybe-all-build-bison
 all-stageautoprofile-gold: maybe-all-build-bison
 all-stageautofeedback-gold: maybe-all-build-bison
@@ -55691,6 +58320,7 @@ all-stage2-gold: maybe-all-stage2-gas
 all-stage3-gold: maybe-all-stage3-gas
 all-stage4-gold: maybe-all-stage4-gas
 all-stageprofile-gold: maybe-all-stageprofile-gas
+all-stagetrain-gold: maybe-all-stagetrain-gas
 all-stagefeedback-gold: maybe-all-stagefeedback-gas
 all-stageautoprofile-gold: maybe-all-stageautoprofile-gas
 all-stageautofeedback-gold: maybe-all-stageautofeedback-gas
@@ -55701,6 +58331,7 @@ check-stage2-gold: maybe-all-stage2-binutils
 check-stage3-gold: maybe-all-stage3-binutils
 check-stage4-gold: maybe-all-stage4-binutils
 check-stageprofile-gold: maybe-all-stageprofile-binutils
+check-stagetrain-gold: maybe-all-stagetrain-binutils
 check-stagefeedback-gold: maybe-all-stagefeedback-binutils
 check-stageautoprofile-gold: maybe-all-stageautoprofile-binutils
 check-stageautofeedback-gold: maybe-all-stageautofeedback-binutils
@@ -55711,6 +58342,7 @@ check-stage2-gold: maybe-all-stage2-gas
 check-stage3-gold: maybe-all-stage3-gas
 check-stage4-gold: maybe-all-stage4-gas
 check-stageprofile-gold: maybe-all-stageprofile-gas
+check-stagetrain-gold: maybe-all-stagetrain-gas
 check-stagefeedback-gold: maybe-all-stagefeedback-gas
 check-stageautoprofile-gold: maybe-all-stageautoprofile-gas
 check-stageautofeedback-gold: maybe-all-stageautofeedback-gas
@@ -55721,6 +58353,7 @@ configure-stage2-opcodes: maybe-configure-stage2-intl
 configure-stage3-opcodes: maybe-configure-stage3-intl
 configure-stage4-opcodes: maybe-configure-stage4-intl
 configure-stageprofile-opcodes: maybe-configure-stageprofile-intl
+configure-stagetrain-opcodes: maybe-configure-stagetrain-intl
 configure-stagefeedback-opcodes: maybe-configure-stagefeedback-intl
 configure-stageautoprofile-opcodes: maybe-configure-stageautoprofile-intl
 configure-stageautofeedback-opcodes: maybe-configure-stageautofeedback-intl
@@ -55731,6 +58364,7 @@ all-stage2-opcodes: maybe-all-stage2-bfd
 all-stage3-opcodes: maybe-all-stage3-bfd
 all-stage4-opcodes: maybe-all-stage4-bfd
 all-stageprofile-opcodes: maybe-all-stageprofile-bfd
+all-stagetrain-opcodes: maybe-all-stagetrain-bfd
 all-stagefeedback-opcodes: maybe-all-stagefeedback-bfd
 all-stageautoprofile-opcodes: maybe-all-stageautoprofile-bfd
 all-stageautofeedback-opcodes: maybe-all-stageautofeedback-bfd
@@ -55741,6 +58375,7 @@ all-stage2-opcodes: maybe-all-stage2-libiberty
 all-stage3-opcodes: maybe-all-stage3-libiberty
 all-stage4-opcodes: maybe-all-stage4-libiberty
 all-stageprofile-opcodes: maybe-all-stageprofile-libiberty
+all-stagetrain-opcodes: maybe-all-stagetrain-libiberty
 all-stagefeedback-opcodes: maybe-all-stagefeedback-libiberty
 all-stageautoprofile-opcodes: maybe-all-stageautoprofile-libiberty
 all-stageautofeedback-opcodes: maybe-all-stageautofeedback-libiberty
@@ -55751,6 +58386,7 @@ all-stage2-opcodes: maybe-all-stage2-intl
 all-stage3-opcodes: maybe-all-stage3-intl
 all-stage4-opcodes: maybe-all-stage4-intl
 all-stageprofile-opcodes: maybe-all-stageprofile-intl
+all-stagetrain-opcodes: maybe-all-stagetrain-intl
 all-stagefeedback-opcodes: maybe-all-stagefeedback-intl
 all-stageautoprofile-opcodes: maybe-all-stageautoprofile-intl
 all-stageautofeedback-opcodes: maybe-all-stageautofeedback-intl
@@ -55810,6 +58446,7 @@ configure-stage2-target-libstdc++-v3: maybe-configure-stage2-target-libgomp
 configure-stage3-target-libstdc++-v3: maybe-configure-stage3-target-libgomp
 configure-stage4-target-libstdc++-v3: maybe-configure-stage4-target-libgomp
 configure-stageprofile-target-libstdc++-v3: maybe-configure-stageprofile-target-libgomp
+configure-stagetrain-target-libstdc++-v3: maybe-configure-stagetrain-target-libgomp
 configure-stagefeedback-target-libstdc++-v3: maybe-configure-stagefeedback-target-libgomp
 configure-stageautoprofile-target-libstdc++-v3: maybe-configure-stageautoprofile-target-libgomp
 configure-stageautofeedback-target-libstdc++-v3: maybe-configure-stageautofeedback-target-libgomp
@@ -55821,6 +58458,7 @@ configure-stage2-target-libsanitizer: maybe-all-stage2-target-libstdc++-v3
 configure-stage3-target-libsanitizer: maybe-all-stage3-target-libstdc++-v3
 configure-stage4-target-libsanitizer: maybe-all-stage4-target-libstdc++-v3
 configure-stageprofile-target-libsanitizer: maybe-all-stageprofile-target-libstdc++-v3
+configure-stagetrain-target-libsanitizer: maybe-all-stagetrain-target-libstdc++-v3
 configure-stagefeedback-target-libsanitizer: maybe-all-stagefeedback-target-libstdc++-v3
 configure-stageautoprofile-target-libsanitizer: maybe-all-stageautoprofile-target-libstdc++-v3
 configure-stageautofeedback-target-libsanitizer: maybe-all-stageautofeedback-target-libstdc++-v3
@@ -55831,6 +58469,7 @@ configure-stage2-target-libvtv: maybe-all-stage2-target-libstdc++-v3
 configure-stage3-target-libvtv: maybe-all-stage3-target-libstdc++-v3
 configure-stage4-target-libvtv: maybe-all-stage4-target-libstdc++-v3
 configure-stageprofile-target-libvtv: maybe-all-stageprofile-target-libstdc++-v3
+configure-stagetrain-target-libvtv: maybe-all-stagetrain-target-libstdc++-v3
 configure-stagefeedback-target-libvtv: maybe-all-stagefeedback-target-libstdc++-v3
 configure-stageautoprofile-target-libvtv: maybe-all-stageautoprofile-target-libstdc++-v3
 configure-stageautofeedback-target-libvtv: maybe-all-stageautofeedback-target-libstdc++-v3
@@ -55841,6 +58480,7 @@ all-stage2-target-libstdc++-v3: maybe-configure-stage2-target-libgomp
 all-stage3-target-libstdc++-v3: maybe-configure-stage3-target-libgomp
 all-stage4-target-libstdc++-v3: maybe-configure-stage4-target-libgomp
 all-stageprofile-target-libstdc++-v3: maybe-configure-stageprofile-target-libgomp
+all-stagetrain-target-libstdc++-v3: maybe-configure-stagetrain-target-libgomp
 all-stagefeedback-target-libstdc++-v3: maybe-configure-stagefeedback-target-libgomp
 all-stageautoprofile-target-libstdc++-v3: maybe-configure-stageautoprofile-target-libgomp
 all-stageautofeedback-target-libstdc++-v3: maybe-configure-stageautofeedback-target-libgomp
@@ -55878,6 +58518,7 @@ configure-stage2-target-libstdc++-v3: maybe-all-stage2-target-libgcc
 configure-stage3-target-libstdc++-v3: maybe-all-stage3-target-libgcc
 configure-stage4-target-libstdc++-v3: maybe-all-stage4-target-libgcc
 configure-stageprofile-target-libstdc++-v3: maybe-all-stageprofile-target-libgcc
+configure-stagetrain-target-libstdc++-v3: maybe-all-stagetrain-target-libgcc
 configure-stagefeedback-target-libstdc++-v3: maybe-all-stagefeedback-target-libgcc
 configure-stageautoprofile-target-libstdc++-v3: maybe-all-stageautoprofile-target-libgcc
 configure-stageautofeedback-target-libstdc++-v3: maybe-all-stageautofeedback-target-libgcc
@@ -55886,6 +58527,7 @@ configure-stage2-target-libsanitizer: maybe-all-stage2-target-libgcc
 configure-stage3-target-libsanitizer: maybe-all-stage3-target-libgcc
 configure-stage4-target-libsanitizer: maybe-all-stage4-target-libgcc
 configure-stageprofile-target-libsanitizer: maybe-all-stageprofile-target-libgcc
+configure-stagetrain-target-libsanitizer: maybe-all-stagetrain-target-libgcc
 configure-stagefeedback-target-libsanitizer: maybe-all-stagefeedback-target-libgcc
 configure-stageautoprofile-target-libsanitizer: maybe-all-stageautoprofile-target-libgcc
 configure-stageautofeedback-target-libsanitizer: maybe-all-stageautofeedback-target-libgcc
@@ -55894,6 +58536,7 @@ configure-stage2-target-libmpx: maybe-all-stage2-target-libgcc
 configure-stage3-target-libmpx: maybe-all-stage3-target-libgcc
 configure-stage4-target-libmpx: maybe-all-stage4-target-libgcc
 configure-stageprofile-target-libmpx: maybe-all-stageprofile-target-libgcc
+configure-stagetrain-target-libmpx: maybe-all-stagetrain-target-libgcc
 configure-stagefeedback-target-libmpx: maybe-all-stagefeedback-target-libgcc
 configure-stageautoprofile-target-libmpx: maybe-all-stageautoprofile-target-libgcc
 configure-stageautofeedback-target-libmpx: maybe-all-stageautofeedback-target-libgcc
@@ -55902,6 +58545,7 @@ configure-stage2-target-libvtv: maybe-all-stage2-target-libgcc
 configure-stage3-target-libvtv: maybe-all-stage3-target-libgcc
 configure-stage4-target-libvtv: maybe-all-stage4-target-libgcc
 configure-stageprofile-target-libvtv: maybe-all-stageprofile-target-libgcc
+configure-stagetrain-target-libvtv: maybe-all-stagetrain-target-libgcc
 configure-stagefeedback-target-libvtv: maybe-all-stagefeedback-target-libgcc
 configure-stageautoprofile-target-libvtv: maybe-all-stageautoprofile-target-libgcc
 configure-stageautofeedback-target-libvtv: maybe-all-stageautofeedback-target-libgcc
@@ -55910,6 +58554,7 @@ configure-stage2-target-libgomp: maybe-all-stage2-target-libgcc
 configure-stage3-target-libgomp: maybe-all-stage3-target-libgcc
 configure-stage4-target-libgomp: maybe-all-stage4-target-libgcc
 configure-stageprofile-target-libgomp: maybe-all-stageprofile-target-libgcc
+configure-stagetrain-target-libgomp: maybe-all-stagetrain-target-libgcc
 configure-stagefeedback-target-libgomp: maybe-all-stagefeedback-target-libgcc
 configure-stageautoprofile-target-libgomp: maybe-all-stageautoprofile-target-libgcc
 configure-stageautofeedback-target-libgomp: maybe-all-stageautofeedback-target-libgcc
diff --git a/Makefile.tpl b/Makefile.tpl
index d0fa07005be..5fcd7e358d9 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -455,8 +455,11 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
 STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
-STAGEfeedback_CFLAGS = $(STAGE3_CFLAGS) -fprofile-use
-STAGEfeedback_TFLAGS = $(STAGE3_TFLAGS)
+STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
+STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
+
+STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
+STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
 
 STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
 STAGEautoprofile_TFLAGS = $(STAGE2_TFLAGS)
diff --git a/gcc/doc/install.texi b/gcc/doc/install.texi
index b13fc1f6f42..386771872ba 100644
--- a/gcc/doc/install.texi
+++ b/gcc/doc/install.texi
@@ -2611,8 +2611,9 @@ bootstrap the compiler with profile feedback, use @code{make profiledbootstrap}.
 When @samp{make profiledbootstrap} is run, it will first build a @code{stage1}
 compiler.  This compiler is used to build a @code{stageprofile} compiler
 instrumented to collect execution counts of instruction and branch
-probabilities.  Then runtime libraries are compiled with profile collected.
-Finally a @code{stagefeedback} compiler is built using the information collected.
+probabilities.  Training run is done by building @code{stagetrain}
+compiler.  Finally a @code{stagefeedback} compiler is built
+using the information collected.
 
 Unlike standard bootstrap, several additional restrictions apply.  The
 compiler used to build @code{stage1} needs to support a 64-bit integral type.
-- 
2.12.2


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

* Re: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.
  2017-05-25 10:00 [PATCH] Introduce 4-stages profiledbootstrap to get a better profile Martin Liška
  2017-05-25 10:00 ` Martin Liška
@ 2017-05-25 11:38 ` Markus Trippelsdorf
  2017-05-25 16:28   ` Martin Liška
  2017-05-29  5:14 ` Markus Trippelsdorf
  2017-10-27 13:19 ` [PATCH] Append PWD to path when using -fprofile-generate=/some/path Martin Liška
  3 siblings, 1 reply; 32+ messages in thread
From: Markus Trippelsdorf @ 2017-05-25 11:38 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches, Richard Biener, Jan Hubicka

On 2017.05.25 at 11:55 +0200, Martin Liška wrote:
> Hi.
>
> As I spoke about the PGO with Honza and Richi, current 3-stage is not ideal for following
> 2 reasons:
>
> 1) stageprofile compiler is train just on libraries that are built during stage2
> 2) apart from that, as the compiler is also used to build the final compiler, profile
> is being updated during the build. So the stage2 compiler is making different decisions.
>
> Both problems can be resolved by adding another step in between current stage2 and stage3
> where we train stage2 compiler by building compiler with default options.
>
> I'm going to do some measurements.

I did some measurements on gcc67 (trunk with --enable-checking=release).
The apparent speedup is in the noise.

Without your patch:

 Performance counter stats for 'g++ -w -Ofast tramp3d-v4.cpp' (10 runs):

      15749.058451      task-clock (msec)         #    0.997 CPUs utilized            ( +-  0.13% )
             1,352      context-switches          #    0.086 K/sec                    ( +-  0.16% )
                 7      cpu-migrations            #    0.000 K/sec                    ( +-  5.73% )
           269,142      page-faults               #    0.017 M/sec                    ( +-  0.01% )
    60,676,581,181      cycles                    #    3.853 GHz                      ( +-  0.09% )  (83.35%)
    13,401,784,189      stalled-cycles-frontend   #   22.09% frontend cycles idle     ( +-  0.20% )  (83.33%)
    12,926,843,370      stalled-cycles-backend    #   21.30% backend cycles idle      ( +-  0.04% )  (83.31%)
    73,074,099,356      instructions              #    1.20  insn per cycle
                                                  #    0.18  stalled cycles per insn  ( +-  0.02% )  (83.34%)
    16,607,220,814      branches                  # 1054.490 M/sec                    ( +-  0.03% )  (83.36%)
       616,673,310      branch-misses             #    3.71% of all branches          ( +-  0.08% )  (83.36%)

      15.803602619 seconds time elapsed                                          ( +-  0.14% )

With your patch:

 Performance counter stats for 'g++ -w -Ofast tramp3d-v4.cpp' (10 runs):

      15735.220610      task-clock (msec)         #    0.997 CPUs utilized            ( +-  0.11% )
             1,354      context-switches          #    0.086 K/sec                    ( +-  0.22% )
                 6      cpu-migrations            #    0.000 K/sec                    ( +-  6.67% )
           269,164      page-faults               #    0.017 M/sec                    ( +-  0.01% )
    60,723,862,242      cycles                    #    3.859 GHz                      ( +-  0.08% )  (83.35%)
    13,382,554,421      stalled-cycles-frontend   #   22.04% frontend cycles idle     ( +-  0.14% )  (83.31%)
    12,912,171,664      stalled-cycles-backend    #   21.26% backend cycles idle      ( +-  0.03% )  (83.34%)
    73,109,081,227      instructions              #    1.20  insn per cycle
                                                  #    0.18  stalled cycles per insn  ( +-  0.03% )  (83.34%)
    16,590,421,798      branches                  # 1054.349 M/sec                    ( +-  0.02% )  (83.35%)
       616,669,135      branch-misses             #    3.72% of all branches          ( +-  0.08% )  (83.36%)

      15.788772466 seconds time elapsed                                          ( +-  0.12% )



--
Markus

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

* Re: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.
  2017-05-25 11:38 ` Markus Trippelsdorf
@ 2017-05-25 16:28   ` Martin Liška
  2017-05-29 15:11     ` Jan Hubicka
  0 siblings, 1 reply; 32+ messages in thread
From: Martin Liška @ 2017-05-25 16:28 UTC (permalink / raw)
  To: Markus Trippelsdorf; +Cc: GCC Patches, Richard Biener, Jan Hubicka

On 05/25/2017 01:22 PM, Markus Trippelsdorf wrote:
> On 2017.05.25 at 11:55 +0200, Martin Liška wrote:
>> Hi.
>>
>> As I spoke about the PGO with Honza and Richi, current 3-stage is not ideal for following
>> 2 reasons:
>>
>> 1) stageprofile compiler is train just on libraries that are built during stage2
>> 2) apart from that, as the compiler is also used to build the final compiler, profile
>> is being updated during the build. So the stage2 compiler is making different decisions.
>>
>> Both problems can be resolved by adding another step in between current stage2 and stage3
>> where we train stage2 compiler by building compiler with default options.
>>
>> I'm going to do some measurements.
> 
> I did some measurements on gcc67 (trunk with --enable-checking=release).
> The apparent speedup is in the noise.

Hello.

Thanks for measurements:

I can see difference for GCC 7.1:

g++-7 tramp3d-v4.ii -O2 && time for i in `seq 1 10` ; do g++-7 tramp3d-v4.ii -O2 ; done

before: 2m25.133s
after: real	2m25.133s

which is 99.09124426480228%. It's probably within a noise level.

And apparently file size of binary is bugger:

before (using bloaty):

     VM SIZE                         FILE SIZE
 --------------                   --------------
  59.0%  15.1Mi .text              15.1Mi  62.3%
  21.3%  5.45Mi .rodata            5.45Mi  22.5%
   6.6%  1.69Mi .eh_frame          1.69Mi   6.9%
   5.4%  1.38Mi .bss                    0   0.0%
   3.3%   874Ki .dynstr             874Ki   3.5%
   1.8%   480Ki .dynsym             480Ki   1.9%
   1.1%   285Ki .eh_frame_hdr       285Ki   1.1%
   0.6%   158Ki .gnu.hash           158Ki   0.6%
   0.5%   144Ki .hash               144Ki   0.6%
   0.2%  44.4Ki .data              44.4Ki   0.2%
   0.2%  40.0Ki .gnu.version       40.0Ki   0.2%
   0.0%  11.1Ki .rela.plt          11.1Ki   0.0%
   0.0%  7.44Ki .plt               7.44Ki   0.0%
   0.0%  4.56Ki .data.rel.ro       4.56Ki   0.0%
   0.0%  3.73Ki .got.plt           3.73Ki   0.0%
   0.0%      38 [Unmapped]         2.75Ki   0.0%
   0.0%     624 [ELF Headers]      2.55Ki   0.0%
   0.0%     848 [Other]            1.13Ki   0.0%
   0.0%     917 .gcc_except_table     917   0.0%
   0.0%     608 .dynamic              608   0.0%
   0.0%      16 [None]                  0   0.0%
 100.0%  25.7Mi TOTAL              24.3Mi 100.0%

after:

     VM SIZE                     FILE SIZE
 --------------               --------------
  58.3%  14.6Mi .text          14.6Mi  54.2%
  21.6%  5.41Mi .rodata        5.41Mi  20.1%
   0.0%       0 .strtab        2.13Mi   7.9%
   6.7%  1.67Mi .eh_frame      1.67Mi   6.2%
   5.5%  1.38Mi .bss                0   0.0%
   0.0%       0 .symtab        1.11Mi   4.1%
   3.4%   876Ki .dynstr         876Ki   3.2%
   1.9%   480Ki .dynsym         480Ki   1.7%
   1.1%   280Ki .eh_frame_hdr   280Ki   1.0%
   0.6%   158Ki .gnu.hash       158Ki   0.6%
   0.6%   144Ki .hash           144Ki   0.5%
   0.2%  44.4Ki .data          44.4Ki   0.2%
   0.2%  40.1Ki .gnu.version   40.1Ki   0.1%
   0.0%  11.1Ki .rela.plt      11.1Ki   0.0%
   0.0%  7.44Ki .plt           7.44Ki   0.0%
   0.0%  4.56Ki .data.rel.ro   4.56Ki   0.0%
   0.0%  3.73Ki .got.plt       3.73Ki   0.0%
   0.0%      58 [Unmapped]     3.11Ki   0.0%
   0.0%     624 [ELF Headers]  2.61Ki   0.0%
   0.0%  2.32Ki [Other]        2.60Ki   0.0%
   0.0%      16 [None]              0   0.0%
 100.0%  25.1Mi TOTAL          26.9Mi 100.0%

As I had chat with Honza, we still have problem in GCC that using current working sets,
get_hot_bb_threshold () is very close to number of runs, which is effectively 1 for a single
run. That's mistake and that should be fixed.

Martin



> 
> Without your patch:
> 
>  Performance counter stats for 'g++ -w -Ofast tramp3d-v4.cpp' (10 runs):
> 
>       15749.058451      task-clock (msec)         #    0.997 CPUs utilized            ( +-  0.13% )
>              1,352      context-switches          #    0.086 K/sec                    ( +-  0.16% )
>                  7      cpu-migrations            #    0.000 K/sec                    ( +-  5.73% )
>            269,142      page-faults               #    0.017 M/sec                    ( +-  0.01% )
>     60,676,581,181      cycles                    #    3.853 GHz                      ( +-  0.09% )  (83.35%)
>     13,401,784,189      stalled-cycles-frontend   #   22.09% frontend cycles idle     ( +-  0.20% )  (83.33%)
>     12,926,843,370      stalled-cycles-backend    #   21.30% backend cycles idle      ( +-  0.04% )  (83.31%)
>     73,074,099,356      instructions              #    1.20  insn per cycle
>                                                   #    0.18  stalled cycles per insn  ( +-  0.02% )  (83.34%)
>     16,607,220,814      branches                  # 1054.490 M/sec                    ( +-  0.03% )  (83.36%)
>        616,673,310      branch-misses             #    3.71% of all branches          ( +-  0.08% )  (83.36%)
> 
>       15.803602619 seconds time elapsed                                          ( +-  0.14% )
> 
> With your patch:
> 
>  Performance counter stats for 'g++ -w -Ofast tramp3d-v4.cpp' (10 runs):
> 
>       15735.220610      task-clock (msec)         #    0.997 CPUs utilized            ( +-  0.11% )
>              1,354      context-switches          #    0.086 K/sec                    ( +-  0.22% )
>                  6      cpu-migrations            #    0.000 K/sec                    ( +-  6.67% )
>            269,164      page-faults               #    0.017 M/sec                    ( +-  0.01% )
>     60,723,862,242      cycles                    #    3.859 GHz                      ( +-  0.08% )  (83.35%)
>     13,382,554,421      stalled-cycles-frontend   #   22.04% frontend cycles idle     ( +-  0.14% )  (83.31%)
>     12,912,171,664      stalled-cycles-backend    #   21.26% backend cycles idle      ( +-  0.03% )  (83.34%)
>     73,109,081,227      instructions              #    1.20  insn per cycle
>                                                   #    0.18  stalled cycles per insn  ( +-  0.03% )  (83.34%)
>     16,590,421,798      branches                  # 1054.349 M/sec                    ( +-  0.02% )  (83.35%)
>        616,669,135      branch-misses             #    3.72% of all branches          ( +-  0.08% )  (83.36%)
> 
>       15.788772466 seconds time elapsed                                          ( +-  0.12% )
> 
> 
> 
> --
> Markus
> 

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

* Re: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.
  2017-05-25 10:00 [PATCH] Introduce 4-stages profiledbootstrap to get a better profile Martin Liška
  2017-05-25 10:00 ` Martin Liška
  2017-05-25 11:38 ` Markus Trippelsdorf
@ 2017-05-29  5:14 ` Markus Trippelsdorf
  2017-06-06 13:30   ` Martin Liška
  2017-10-27 13:19 ` [PATCH] Append PWD to path when using -fprofile-generate=/some/path Martin Liška
  3 siblings, 1 reply; 32+ messages in thread
From: Markus Trippelsdorf @ 2017-05-29  5:14 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches, Richard Biener, Jan Hubicka

On 2017.05.25 at 11:55 +0200, Martin Liška wrote:
> Hi.
> 
> As I spoke about the PGO with Honza and Richi, current 3-stage is not ideal for following
> 2 reasons:
> 
> 1) stageprofile compiler is train just on libraries that are built during stage2
> 2) apart from that, as the compiler is also used to build the final compiler, profile
> is being updated during the build. So the stage2 compiler is making different decisions.
> 
> Both problems can be resolved by adding another step in between current stage2 and stage3
> where we train stage2 compiler by building compiler with default options.

Another issue that I've noticed is that LTO doesn't get used in the
final stage (stagefeedback) with "bootstrap-O3 bootstrap-lto".
It only is used during training. So either move -flto to stagefeedback,
or use -flto both during training and during the final stage.

-- 
Markus

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

* Re: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.
  2017-05-25 16:28   ` Martin Liška
@ 2017-05-29 15:11     ` Jan Hubicka
  0 siblings, 0 replies; 32+ messages in thread
From: Jan Hubicka @ 2017-05-29 15:11 UTC (permalink / raw)
  To: Martin Liška; +Cc: Markus Trippelsdorf, GCC Patches, Richard Biener

> On 05/25/2017 01:22 PM, Markus Trippelsdorf wrote:
> > On 2017.05.25 at 11:55 +0200, Martin Liška wrote:
> >> Hi.
> >>
> >> As I spoke about the PGO with Honza and Richi, current 3-stage is not ideal for following
> >> 2 reasons:
> >>
> >> 1) stageprofile compiler is train just on libraries that are built during stage2
> >> 2) apart from that, as the compiler is also used to build the final compiler, profile
> >> is being updated during the build. So the stage2 compiler is making different decisions.
> >>
> >> Both problems can be resolved by adding another step in between current stage2 and stage3
> >> where we train stage2 compiler by building compiler with default options.
> >>
> >> I'm going to do some measurements.
> > 
> > I did some measurements on gcc67 (trunk with --enable-checking=release).
> > The apparent speedup is in the noise.
> 
> Hello.
> 
> Thanks for measurements:
> 
> I can see difference for GCC 7.1:
> 
> g++-7 tramp3d-v4.ii -O2 && time for i in `seq 1 10` ; do g++-7 tramp3d-v4.ii -O2 ; done
> 
> before: 2m25.133s
> after: real	2m25.133s
> 
> which is 99.09124426480228%. It's probably within a noise level.
> 
> And apparently file size of binary is bugger:
> 
> before (using bloaty):
> 
>      VM SIZE                         FILE SIZE
>  --------------                   --------------
>   59.0%  15.1Mi .text              15.1Mi  62.3%
>   21.3%  5.45Mi .rodata            5.45Mi  22.5%
>    6.6%  1.69Mi .eh_frame          1.69Mi   6.9%
>    5.4%  1.38Mi .bss                    0   0.0%
>    3.3%   874Ki .dynstr             874Ki   3.5%
>    1.8%   480Ki .dynsym             480Ki   1.9%
>    1.1%   285Ki .eh_frame_hdr       285Ki   1.1%
>    0.6%   158Ki .gnu.hash           158Ki   0.6%
>    0.5%   144Ki .hash               144Ki   0.6%
>    0.2%  44.4Ki .data              44.4Ki   0.2%
>    0.2%  40.0Ki .gnu.version       40.0Ki   0.2%
>    0.0%  11.1Ki .rela.plt          11.1Ki   0.0%
>    0.0%  7.44Ki .plt               7.44Ki   0.0%
>    0.0%  4.56Ki .data.rel.ro       4.56Ki   0.0%
>    0.0%  3.73Ki .got.plt           3.73Ki   0.0%
>    0.0%      38 [Unmapped]         2.75Ki   0.0%
>    0.0%     624 [ELF Headers]      2.55Ki   0.0%
>    0.0%     848 [Other]            1.13Ki   0.0%
>    0.0%     917 .gcc_except_table     917   0.0%
>    0.0%     608 .dynamic              608   0.0%
>    0.0%      16 [None]                  0   0.0%
>  100.0%  25.7Mi TOTAL              24.3Mi 100.0%
> 
> after:
> 
>      VM SIZE                     FILE SIZE
>  --------------               --------------
>   58.3%  14.6Mi .text          14.6Mi  54.2%
>   21.6%  5.41Mi .rodata        5.41Mi  20.1%
>    0.0%       0 .strtab        2.13Mi   7.9%
>    6.7%  1.67Mi .eh_frame      1.67Mi   6.2%
>    5.5%  1.38Mi .bss                0   0.0%
>    0.0%       0 .symtab        1.11Mi   4.1%
>    3.4%   876Ki .dynstr         876Ki   3.2%
>    1.9%   480Ki .dynsym         480Ki   1.7%
>    1.1%   280Ki .eh_frame_hdr   280Ki   1.0%
>    0.6%   158Ki .gnu.hash       158Ki   0.6%
>    0.6%   144Ki .hash           144Ki   0.5%
>    0.2%  44.4Ki .data          44.4Ki   0.2%
>    0.2%  40.1Ki .gnu.version   40.1Ki   0.1%
>    0.0%  11.1Ki .rela.plt      11.1Ki   0.0%
>    0.0%  7.44Ki .plt           7.44Ki   0.0%
>    0.0%  4.56Ki .data.rel.ro   4.56Ki   0.0%
>    0.0%  3.73Ki .got.plt       3.73Ki   0.0%
>    0.0%      58 [Unmapped]     3.11Ki   0.0%
>    0.0%     624 [ELF Headers]  2.61Ki   0.0%
>    0.0%  2.32Ki [Other]        2.60Ki   0.0%
>    0.0%      16 [None]              0   0.0%
>  100.0%  25.1Mi TOTAL          26.9Mi 100.0%
> 
> As I had chat with Honza, we still have problem in GCC that using current working sets,
> get_hot_bb_threshold () is very close to number of runs, which is effectively 1 for a single
> run. That's mistake and that should be fixed.

Yep, with LTO+PGO bootstrap I think we also hit the problem that PGO inliner was never
seriously tuned (we basically use the very first badness metric I introduced and we never
experimented with parameters). The reason is that hot/cold partitioning even when it
is very coarsce does work reasonably well for per-file compilation model.  With LTO we
are facing very many inline decisions and probably there is a lot of low hanging fruit.

GCC is currently on transition to new profile counter code.  I will push out the initial
patch retiring gcov_type soon (once I finish updating it to current tree - it is very
anoying) and that will let us to track hotness more conservatively and fix the old
problem that count becomes unrealistically low by broken profile updates and thus
becomes cold.  This should make it possible to increase the threshold and start with
re-tunning (hopefully this or next week)

Honza
> 
> Martin

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

* Re: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.
  2017-05-29  5:14 ` Markus Trippelsdorf
@ 2017-06-06 13:30   ` Martin Liška
  2017-06-19 10:37     ` Jan Hubicka
  0 siblings, 1 reply; 32+ messages in thread
From: Martin Liška @ 2017-06-06 13:30 UTC (permalink / raw)
  To: Markus Trippelsdorf; +Cc: GCC Patches, Richard Biener, Jan Hubicka

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

On 05/29/2017 07:04 AM, Markus Trippelsdorf wrote:
> On 2017.05.25 at 11:55 +0200, Martin Liška wrote:
>> Hi.
>>
>> As I spoke about the PGO with Honza and Richi, current 3-stage is not ideal for following
>> 2 reasons:
>>
>> 1) stageprofile compiler is train just on libraries that are built during stage2
>> 2) apart from that, as the compiler is also used to build the final compiler, profile
>> is being updated during the build. So the stage2 compiler is making different decisions.
>>
>> Both problems can be resolved by adding another step in between current stage2 and stage3
>> where we train stage2 compiler by building compiler with default options.
> 
> Another issue that I've noticed is that LTO doesn't get used in the
> final stage (stagefeedback) with "bootstrap-O3 bootstrap-lto".
> It only is used during training. So either move -flto to stagefeedback,
> or use -flto both during training and during the final stage.
> 

You're right, thus I'm suggesting to use -flto in all stages of PGO if 'make profiledbootstrap'
is invoked.

Martin

[-- Attachment #2: 0001-Enable-flto-in-all-PGO-stages-for-bootstrap-lto-nopl.patch --]
[-- Type: text/x-patch, Size: 1749 bytes --]

From 77fb3302ef98548d37bf0f891ff09bca297f77fa Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 6 Jun 2017 11:23:38 +0200
Subject: [PATCH] Enable -flto in all PGO stages for
 bootstrap-lto-{,noplugin}.mk.

config/ChangeLog:

2017-06-06  Martin Liska  <mliska@suse.cz>

	* bootstrap-lto-noplugin.mk: Enable -flto in all PGO stages.
	* bootstrap-lto.mk: Likewise.
---
 config/bootstrap-lto-noplugin.mk | 4 +++-
 config/bootstrap-lto.mk          | 4 +++-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/config/bootstrap-lto-noplugin.mk b/config/bootstrap-lto-noplugin.mk
index a5073365b5a..fc980d2bc17 100644
--- a/config/bootstrap-lto-noplugin.mk
+++ b/config/bootstrap-lto-noplugin.mk
@@ -3,4 +3,6 @@
 
 STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
 STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
-STAGEprofile_CFLAGS += -fno-lto
+STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
+STAGEtrain_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
+STAGEfeedback_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
diff --git a/config/bootstrap-lto.mk b/config/bootstrap-lto.mk
index 9e065e1d85a..50b86ef1c81 100644
--- a/config/bootstrap-lto.mk
+++ b/config/bootstrap-lto.mk
@@ -2,7 +2,9 @@
 
 STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1
 STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
-STAGEprofile_CFLAGS += -fno-lto
+STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1
+STAGEtrain_CFLAGS += -flto=jobserver -frandom-seed=1
+STAGEfeedback_CFLAGS += -flto=jobserver -frandom-seed=1
 
 # assumes the host supports the linker plugin
 LTO_AR = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ar$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
-- 
2.13.0


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

* Re: [PATCH] Introduce 4-stages profiledbootstrap to get a better profile.
  2017-06-06 13:30   ` Martin Liška
@ 2017-06-19 10:37     ` Jan Hubicka
  2017-08-30 10:44       ` [RFC] Make 4-stage PGO bootstrap really working Martin Liška
  0 siblings, 1 reply; 32+ messages in thread
From: Jan Hubicka @ 2017-06-19 10:37 UTC (permalink / raw)
  To: Martin Liška; +Cc: Markus Trippelsdorf, GCC Patches, Richard Biener

> On 05/29/2017 07:04 AM, Markus Trippelsdorf wrote:
> > On 2017.05.25 at 11:55 +0200, Martin Liška wrote:
> >> Hi.
> >>
> >> As I spoke about the PGO with Honza and Richi, current 3-stage is not ideal for following
> >> 2 reasons:
> >>
> >> 1) stageprofile compiler is train just on libraries that are built during stage2
> >> 2) apart from that, as the compiler is also used to build the final compiler, profile
> >> is being updated during the build. So the stage2 compiler is making different decisions.
> >>
> >> Both problems can be resolved by adding another step in between current stage2 and stage3
> >> where we train stage2 compiler by building compiler with default options.
> > 
> > Another issue that I've noticed is that LTO doesn't get used in the
> > final stage (stagefeedback) with "bootstrap-O3 bootstrap-lto".
> > It only is used during training. So either move -flto to stagefeedback,
> > or use -flto both during training and during the final stage.
> > 
> 
> You're right, thus I'm suggesting to use -flto in all stages of PGO if 'make profiledbootstrap'
> is invoked.

Thanks, this makes sense to me.  I wonder about quality of training.  One perofmrance
critical bit that does not get trained at all is LTO stremaing when you build non-LTO
compiler.  I guess we should add someting for that as that seems to be rather common
case. Similarly -O0 path may need bit of care.  But your changes seems improvement
over current state for sure.

What are the bootstrap times now?
Honza
> 
> Martin

> >From 77fb3302ef98548d37bf0f891ff09bca297f77fa Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Tue, 6 Jun 2017 11:23:38 +0200
> Subject: [PATCH] Enable -flto in all PGO stages for
>  bootstrap-lto-{,noplugin}.mk.
> 
> config/ChangeLog:
> 
> 2017-06-06  Martin Liska  <mliska@suse.cz>
> 
> 	* bootstrap-lto-noplugin.mk: Enable -flto in all PGO stages.
> 	* bootstrap-lto.mk: Likewise.
> ---
>  config/bootstrap-lto-noplugin.mk | 4 +++-
>  config/bootstrap-lto.mk          | 4 +++-
>  2 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/config/bootstrap-lto-noplugin.mk b/config/bootstrap-lto-noplugin.mk
> index a5073365b5a..fc980d2bc17 100644
> --- a/config/bootstrap-lto-noplugin.mk
> +++ b/config/bootstrap-lto-noplugin.mk
> @@ -3,4 +3,6 @@
>  
>  STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
>  STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
> -STAGEprofile_CFLAGS += -fno-lto
> +STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
> +STAGEtrain_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
> +STAGEfeedback_CFLAGS += -flto=jobserver -frandom-seed=1 -ffat-lto-objects
> diff --git a/config/bootstrap-lto.mk b/config/bootstrap-lto.mk
> index 9e065e1d85a..50b86ef1c81 100644
> --- a/config/bootstrap-lto.mk
> +++ b/config/bootstrap-lto.mk
> @@ -2,7 +2,9 @@
>  
>  STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1
>  STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
> -STAGEprofile_CFLAGS += -fno-lto
> +STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1
> +STAGEtrain_CFLAGS += -flto=jobserver -frandom-seed=1
> +STAGEfeedback_CFLAGS += -flto=jobserver -frandom-seed=1
>  
>  # assumes the host supports the linker plugin
>  LTO_AR = $$r/$(HOST_SUBDIR)/prev-gcc/gcc-ar$(exeext) -B$$r/$(HOST_SUBDIR)/prev-gcc/
> -- 
> 2.13.0
> 

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

* [RFC] Make 4-stage PGO bootstrap really working
  2017-06-19 10:37     ` Jan Hubicka
@ 2017-08-30 10:44       ` Martin Liška
  2017-09-14 12:21         ` Martin Liška
  2017-10-25 12:43         ` Markus Trippelsdorf
  0 siblings, 2 replies; 32+ messages in thread
From: Martin Liška @ 2017-08-30 10:44 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: Markus Trippelsdorf, GCC Patches, Richard Biener

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

Hi.

This is follow up which I've just noticed. Main problem we have is that
an instrumented compiler w/ -fprofile-generate (built in $OBJDIR/gcc subfolder)
will generate all *.gcda files in a same dir as *.o files. That's problematic
because we then have *.gcda files spread in 'profile' subfolder (because profile'
compiler builds libgcc) and 'train' subfolder. Eventually in 'feedback' stage
we don't load any *.gcda files :/

Well I really hope we need to set -fprofile-generate=$folder to a $folder. There comes
second problem: all *.gcda files are created as $folder/$aux_base_name.gcda which makes
it useless as we multiple same file names:

$ find . -name expr.c
./libcpp/expr.c
./gcc/expr.c

Thus I suggest patch #0001 that appends full path of current work dir. Patch #0002 sets
a folder for PGO bootstrap. So far so good with a small exception: conftest.gcda files
that trigger -Wcoverage-mismatch. Can we remove these before a stage? Do we do a similar
thing somewhere?

Thoughts?
Thanks,
Martin

[-- Attachment #2: 0002-Hack-Makefile.tpl.patch --]
[-- Type: text/x-patch, Size: 1994 bytes --]

From f00c6bd99b98df7c650bb3fcbbb983671c99caef Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Mon, 28 Aug 2017 11:58:47 +0200
Subject: [PATCH 2/2] Hack Makefile.tpl

---
 Makefile.in  | 5 +++--
 Makefile.tpl | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 78db0982ba2..16b76906ad0 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -529,13 +529,14 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
 	  --disable-build-format-warnings
 
-STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
+profile_folder=`${PWD_COMMAND}`/gcov-profiles/
+STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate=$(profile_folder)
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
 STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
 STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
 
-STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
+STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use=$(profile_folder) -fdump-ipa-profile
 STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
 
 STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
diff --git a/Makefile.tpl b/Makefile.tpl
index 5fcd7e358d9..129175a579c 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -452,13 +452,14 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
 	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
 	  --disable-build-format-warnings
 
-STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
+profile_folder=`${PWD_COMMAND}`/gcov-profiles/
+STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate=$(profile_folder)
 STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
 
 STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
 STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
 
-STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
+STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use=$(profile_folder) -fdump-ipa-profile
 STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
 
 STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
-- 
2.14.1


[-- Attachment #3: 0001-Append-PWD-to-path-when-using-fprofile-generate-some.patch --]
[-- Type: text/x-patch, Size: 1261 bytes --]

From 654ca05a0e1e0261a4477283ca2dd8678f62f1e7 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 16 Aug 2017 10:22:57 +0200
Subject: [PATCH 1/2] Append PWD to path when using
 -fprofile-generate=/some/path.

---
 gcc/coverage.c | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/gcc/coverage.c b/gcc/coverage.c
index ed469107e3e..5780e19bbc8 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -1220,8 +1220,24 @@ coverage_init (const char *filename)
     g->get_passes ()->get_pass_profile ()->static_pass_number;
   g->get_dumps ()->dump_start (profile_pass_num, NULL);
 
-  if (!profile_data_prefix && !IS_ABSOLUTE_PATH (filename))
-    profile_data_prefix = getpwd ();
+  if (!IS_ABSOLUTE_PATH (filename))
+    {
+      if (profile_data_prefix)
+	{
+	  const char *pwd = getpwd ();
+	  unsigned l1 = strlen (profile_data_prefix);
+	  unsigned l2 = strlen (pwd);
+
+	  char *b = XNEWVEC (char, l1 + l2 + 2);
+	  memcpy (b, profile_data_prefix, l1);
+	  b[l1] = '/';
+	  memcpy (b + l1 + 1, pwd, l2);
+	  b[l1 + l2 + 1] = '\0';
+	  profile_data_prefix = b;
+	}
+      else
+	profile_data_prefix = getpwd ();
+    }
 
   if (profile_data_prefix)
     prefix_len = strlen (profile_data_prefix);
-- 
2.14.1


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

* Re: [RFC] Make 4-stage PGO bootstrap really working
  2017-08-30 10:44       ` [RFC] Make 4-stage PGO bootstrap really working Martin Liška
@ 2017-09-14 12:21         ` Martin Liška
  2017-10-19 12:59           ` Martin Liška
  2017-10-25 12:43         ` Markus Trippelsdorf
  1 sibling, 1 reply; 32+ messages in thread
From: Martin Liška @ 2017-09-14 12:21 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: Markus Trippelsdorf, GCC Patches, Richard Biener

PING^1

On 08/30/2017 11:45 AM, Martin Liška wrote:
> Hi.
> 
> This is follow up which I've just noticed. Main problem we have is that
> an instrumented compiler w/ -fprofile-generate (built in $OBJDIR/gcc subfolder)
> will generate all *.gcda files in a same dir as *.o files. That's problematic
> because we then have *.gcda files spread in 'profile' subfolder (because profile'
> compiler builds libgcc) and 'train' subfolder. Eventually in 'feedback' stage
> we don't load any *.gcda files :/
> 
> Well I really hope we need to set -fprofile-generate=$folder to a $folder. There comes
> second problem: all *.gcda files are created as $folder/$aux_base_name.gcda which makes
> it useless as we multiple same file names:
> 
> $ find . -name expr.c
> ./libcpp/expr.c
> ./gcc/expr.c
> 
> Thus I suggest patch #0001 that appends full path of current work dir. Patch #0002 sets
> a folder for PGO bootstrap. So far so good with a small exception: conftest.gcda files
> that trigger -Wcoverage-mismatch. Can we remove these before a stage? Do we do a similar
> thing somewhere?
> 
> Thoughts?
> Thanks,
> Martin
> 

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

* Re: [RFC] Make 4-stage PGO bootstrap really working
  2017-09-14 12:21         ` Martin Liška
@ 2017-10-19 12:59           ` Martin Liška
  2017-10-19 14:53             ` Markus Trippelsdorf
  0 siblings, 1 reply; 32+ messages in thread
From: Martin Liška @ 2017-10-19 12:59 UTC (permalink / raw)
  To: Jan Hubicka; +Cc: Markus Trippelsdorf, GCC Patches, Richard Biener

PING^2

On 09/14/2017 02:20 PM, Martin Liška wrote:
> PING^1
> 
> On 08/30/2017 11:45 AM, Martin Liška wrote:
>> Hi.
>>
>> This is follow up which I've just noticed. Main problem we have is that
>> an instrumented compiler w/ -fprofile-generate (built in $OBJDIR/gcc subfolder)
>> will generate all *.gcda files in a same dir as *.o files. That's problematic
>> because we then have *.gcda files spread in 'profile' subfolder (because profile'
>> compiler builds libgcc) and 'train' subfolder. Eventually in 'feedback' stage
>> we don't load any *.gcda files :/
>>
>> Well I really hope we need to set -fprofile-generate=$folder to a $folder. There comes
>> second problem: all *.gcda files are created as $folder/$aux_base_name.gcda which makes
>> it useless as we multiple same file names:
>>
>> $ find . -name expr.c
>> ./libcpp/expr.c
>> ./gcc/expr.c
>>
>> Thus I suggest patch #0001 that appends full path of current work dir. Patch #0002 sets
>> a folder for PGO bootstrap. So far so good with a small exception: conftest.gcda files
>> that trigger -Wcoverage-mismatch. Can we remove these before a stage? Do we do a similar
>> thing somewhere?
>>
>> Thoughts?
>> Thanks,
>> Martin
>>
> 

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

* Re: [RFC] Make 4-stage PGO bootstrap really working
  2017-10-19 12:59           ` Martin Liška
@ 2017-10-19 14:53             ` Markus Trippelsdorf
  0 siblings, 0 replies; 32+ messages in thread
From: Markus Trippelsdorf @ 2017-10-19 14:53 UTC (permalink / raw)
  To: Martin Liška; +Cc: Jan Hubicka, GCC Patches, Richard Biener

On 2017.10.19 at 14:56 +0200, Martin Liška wrote:
> PING^2

> So far so good with a small exception: conftest.gcda files that
> trigger -Wcoverage-mismatch. Can we remove these before a stage? Do we
> do a similar thing somewhere?

I think you should simply remove all these conftest.gcda files before
STAGEfeedback.

-- 
Markus

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

* Re: [RFC] Make 4-stage PGO bootstrap really working
  2017-08-30 10:44       ` [RFC] Make 4-stage PGO bootstrap really working Martin Liška
  2017-09-14 12:21         ` Martin Liška
@ 2017-10-25 12:43         ` Markus Trippelsdorf
  2017-10-27 13:07           ` Martin Liška
  2017-10-27 13:17           ` [PATCH][OBVIOUS] Fix profiledbootstrap Martin Liška
  1 sibling, 2 replies; 32+ messages in thread
From: Markus Trippelsdorf @ 2017-10-25 12:43 UTC (permalink / raw)
  To: Martin Liška; +Cc: Jan Hubicka, GCC Patches, Richard Biener

On 2017.08.30 at 11:45 +0200, Martin Liška wrote:
> diff --git a/Makefile.in b/Makefile.in
> index 78db0982ba2..16b76906ad0 100644
> --- a/Makefile.in
> +++ b/Makefile.in
> @@ -529,13 +529,14 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
>  	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
>  	  --disable-build-format-warnings
>  
> -STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
> +profile_folder=`${PWD_COMMAND}`/gcov-profiles/
> +STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate=$(profile_folder)
>  STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
>  
>  STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
>  STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
>  
> -STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
> +STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use=$(profile_folder) -fdump-ipa-profile

-fdump-ipa-profile looks like a debugging leftover and should be
dropped.

>  STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
>  
>  STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
> diff --git a/Makefile.tpl b/Makefile.tpl
> index 5fcd7e358d9..129175a579c 100644
> --- a/Makefile.tpl
> +++ b/Makefile.tpl
> @@ -452,13 +452,14 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
>  	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
>  	  --disable-build-format-warnings
>  
> -STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
> +profile_folder=`${PWD_COMMAND}`/gcov-profiles/
> +STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate=$(profile_folder)
>  STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
>  
>  STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
>  STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
>  
> -STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
> +STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use=$(profile_folder) -fdump-ipa-profile

ditto.


And BTW would it make sense to add -gtoggle to stage2 in bootstrap-lto?

diff --git a/config/bootstrap-lto.mk b/config/bootstrap-lto.mk
index 50b86ef1c81..c0cdee69288 100644
--- a/config/bootstrap-lto.mk
+++ b/config/bootstrap-lto.mk
@@ -1,8 +1,8 @@
 # This option enables LTO for stage2 and stage3 in slim mode
 
-STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1
+STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -gtoggle
 STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
-STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1
+STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1 -gtoggle
 STAGEtrain_CFLAGS += -flto=jobserver -frandom-seed=1
 STAGEfeedback_CFLAGS += -flto=jobserver -frandom-seed=1
 
-- 
Markus

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

* Re: [RFC] Make 4-stage PGO bootstrap really working
  2017-10-25 12:43         ` Markus Trippelsdorf
@ 2017-10-27 13:07           ` Martin Liška
  2017-10-27 15:00             ` Markus Trippelsdorf
  2017-10-27 13:17           ` [PATCH][OBVIOUS] Fix profiledbootstrap Martin Liška
  1 sibling, 1 reply; 32+ messages in thread
From: Martin Liška @ 2017-10-27 13:07 UTC (permalink / raw)
  To: Markus Trippelsdorf; +Cc: Jan Hubicka, GCC Patches, Richard Biener

On 10/25/2017 02:19 PM, Markus Trippelsdorf wrote:
> On 2017.08.30 at 11:45 +0200, Martin Liška wrote:
>> diff --git a/Makefile.in b/Makefile.in
>> index 78db0982ba2..16b76906ad0 100644
>> --- a/Makefile.in
>> +++ b/Makefile.in
>> @@ -529,13 +529,14 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
>>   	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
>>   	  --disable-build-format-warnings
>>   
>> -STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
>> +profile_folder=`${PWD_COMMAND}`/gcov-profiles/
>> +STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate=$(profile_folder)
>>   STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
>>   
>>   STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
>>   STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
>>   
>> -STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
>> +STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use=$(profile_folder) -fdump-ipa-profile
> 
> -fdump-ipa-profile looks like a debugging leftover and should be
> dropped.

Sure. Let me prepare a new version of patch.

> 
>>   STAGEfeedback_TFLAGS = $(STAGE4_TFLAGS)
>>   
>>   STAGEautoprofile_CFLAGS = $(STAGE2_CFLAGS) -g
>> diff --git a/Makefile.tpl b/Makefile.tpl
>> index 5fcd7e358d9..129175a579c 100644
>> --- a/Makefile.tpl
>> +++ b/Makefile.tpl
>> @@ -452,13 +452,14 @@ STAGE1_CONFIGURE_FLAGS = --disable-intermodule $(STAGE1_CHECKING) \
>>   	  --disable-coverage --enable-languages="$(STAGE1_LANGUAGES)" \
>>   	  --disable-build-format-warnings
>>   
>> -STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate
>> +profile_folder=`${PWD_COMMAND}`/gcov-profiles/
>> +STAGEprofile_CFLAGS = $(STAGE2_CFLAGS) -fprofile-generate=$(profile_folder)
>>   STAGEprofile_TFLAGS = $(STAGE2_TFLAGS)
>>   
>>   STAGEtrain_CFLAGS = $(STAGE3_CFLAGS)
>>   STAGEtrain_TFLAGS = $(STAGE3_TFLAGS)
>>   
>> -STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use
>> +STAGEfeedback_CFLAGS = $(STAGE4_CFLAGS) -fprofile-use=$(profile_folder) -fdump-ipa-profile
> 
> ditto.
> 
> 
> And BTW would it make sense to add -gtoggle to stage2 in bootstrap-lto?

Why do you want to have it there? Am I right that we do not do a stage comparison
with LTO bootstrap?

Martin

> 
> diff --git a/config/bootstrap-lto.mk b/config/bootstrap-lto.mk
> index 50b86ef1c81..c0cdee69288 100644
> --- a/config/bootstrap-lto.mk
> +++ b/config/bootstrap-lto.mk
> @@ -1,8 +1,8 @@
>   # This option enables LTO for stage2 and stage3 in slim mode
>   
> -STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1
> +STAGE2_CFLAGS += -flto=jobserver -frandom-seed=1 -gtoggle
>   STAGE3_CFLAGS += -flto=jobserver -frandom-seed=1
> -STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1
> +STAGEprofile_CFLAGS += -flto=jobserver -frandom-seed=1 -gtoggle
>   STAGEtrain_CFLAGS += -flto=jobserver -frandom-seed=1
>   STAGEfeedback_CFLAGS += -flto=jobserver -frandom-seed=1
>   
> 

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

* [PATCH][OBVIOUS] Fix profiledbootstrap.
  2017-10-25 12:43         ` Markus Trippelsdorf
  2017-10-27 13:07           ` Martin Liška
@ 2017-10-27 13:17           ` Martin Liška
  1 sibling, 0 replies; 32+ messages in thread
From: Martin Liška @ 2017-10-27 13:17 UTC (permalink / raw)
  To: Markus Trippelsdorf; +Cc: Jan Hubicka, GCC Patches, Richard Biener

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

Hello.

So eventually it looks needed fix is much simpler, one just need to rename a folder.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
I'm going to install it.

Martin

[-- Attachment #2: 0001-Fix-profiledbootstrap.patch --]
[-- Type: text/x-patch, Size: 1690 bytes --]

From 028b5cc3865bdc77c185172de84627e140030303 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 27 Oct 2017 12:21:02 +0200
Subject: [PATCH] Fix profiledbootstrap.

ChangeLog:

2017-10-27  Martin Liska  <mliska@suse.cz>

	* Makefile.tpl: Use proper name of folder as it was renamed
	during transition to 4 stages.
	* Makefile.in: Regenerate.
---
 Makefile.in  | 4 ++--
 Makefile.tpl | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 78db0982ba2..13d23915349 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -57174,8 +57174,8 @@ stageprofile-end::
 stagefeedback-start::
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	for i in prev-*; do \
-	  j=`echo $$i | sed s/^prev-//`; \
+	for i in stageprofile-*; do \
+	  j=`echo $$i | sed s/^stageprofile-//`; \
 	  cd $$r/$$i && \
 	  { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL); } && \
 	  { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL); }; \
diff --git a/Makefile.tpl b/Makefile.tpl
index 5fcd7e358d9..1f23b79b4b2 100644
--- a/Makefile.tpl
+++ b/Makefile.tpl
@@ -1718,8 +1718,8 @@ stageprofile-end::
 stagefeedback-start::
 	@r=`${PWD_COMMAND}`; export r; \
 	s=`cd $(srcdir); ${PWD_COMMAND}`; export s; \
-	for i in prev-*; do \
-	  j=`echo $$i | sed s/^prev-//`; \
+	for i in stageprofile-*; do \
+	  j=`echo $$i | sed s/^stageprofile-//`; \
 	  cd $$r/$$i && \
 	  { find . -type d | sort | sed 's,.*,$(SHELL) '"$$s"'/mkinstalldirs "../'$$j'/&",' | $(SHELL); } && \
 	  { find . -name '*.*da' | sed 's,.*,$(LN) -f "&" "../'$$j'/&",' | $(SHELL); }; \
-- 
2.14.2


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

* [PATCH] Append PWD to path when using -fprofile-generate=/some/path.
  2017-05-25 10:00 [PATCH] Introduce 4-stages profiledbootstrap to get a better profile Martin Liška
                   ` (2 preceding siblings ...)
  2017-05-29  5:14 ` Markus Trippelsdorf
@ 2017-10-27 13:19 ` Martin Liška
  2017-12-20 14:55   ` Martin Liška
  2017-12-20 17:35   ` Martin Sebor
  3 siblings, 2 replies; 32+ messages in thread
From: Martin Liška @ 2017-10-27 13:19 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener, Jan Hubicka

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

Hello.

It's improvement that I consider still useful even though we're not going to use
it for profiled bootstrap.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready for trunk?
Thanks,
Martin

[-- Attachment #2: 0001-Append-PWD-to-path-when-using-fprofile-generate-some.patch --]
[-- Type: text/x-patch, Size: 2189 bytes --]

From 1a32e0b41b291bef3d58126754834f6c41148ace Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 16 Aug 2017 10:22:57 +0200
Subject: [PATCH] Append PWD to path when using -fprofile-generate=/some/path.

gcc/ChangeLog:

2017-10-27  Martin Liska  <mliska@suse.cz>

	* coverage.c (coverage_init): Append absolute path of object
	file.
	* doc/invoke.texi: Document the behavior.
---
 gcc/coverage.c      | 20 ++++++++++++++++++--
 gcc/doc/invoke.texi |  3 +++
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/gcc/coverage.c b/gcc/coverage.c
index 8a56a677f15..c66651f1045 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -1220,8 +1220,24 @@ coverage_init (const char *filename)
     g->get_passes ()->get_pass_profile ()->static_pass_number;
   g->get_dumps ()->dump_start (profile_pass_num, NULL);
 
-  if (!profile_data_prefix && !IS_ABSOLUTE_PATH (filename))
-    profile_data_prefix = getpwd ();
+  if (!IS_ABSOLUTE_PATH (filename))
+    {
+      if (profile_data_prefix)
+	{
+	  const char *pwd = getpwd ();
+	  unsigned l1 = strlen (profile_data_prefix);
+	  unsigned l2 = strlen (pwd);
+
+	  char *b = XNEWVEC (char, l1 + l2 + 2);
+	  memcpy (b, profile_data_prefix, l1);
+	  b[l1] = '/';
+	  memcpy (b + l1 + 1, pwd, l2);
+	  b[l1 + l2 + 1] = '\0';
+	  profile_data_prefix = b;
+	}
+      else
+	profile_data_prefix = getpwd ();
+    }
 
   if (profile_data_prefix)
     prefix_len = strlen (profile_data_prefix);
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index 71b2445f70f..682ab570584 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -10915,6 +10915,9 @@ and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
 and its related options.  Both absolute and relative paths can be used.
 By default, GCC uses the current directory as @var{path}, thus the
 profile data file appears in the same directory as the object file.
+In order to prevent filename clashing, if object file name is not an absolute
+path, current working directory path is appended to @var{path}
+and used as a destination for @file{@var{sourcename}.gcda} file.
 
 @item -fprofile-generate
 @itemx -fprofile-generate=@var{path}
-- 
2.14.2


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

* Re: [RFC] Make 4-stage PGO bootstrap really working
  2017-10-27 13:07           ` Martin Liška
@ 2017-10-27 15:00             ` Markus Trippelsdorf
  2017-10-30 11:08               ` Richard Biener
  0 siblings, 1 reply; 32+ messages in thread
From: Markus Trippelsdorf @ 2017-10-27 15:00 UTC (permalink / raw)
  To: Martin Liška; +Cc: Jan Hubicka, GCC Patches, Richard Biener

On 2017.10.27 at 15:03 +0200, Martin Liška wrote:
> > And BTW would it make sense to add -gtoggle to stage2 in bootstrap-lto?
> 
> Why do you want to have it there? Am I right that we do not do a stage
> comparison with LTO bootstrap?

The idea was to trigger -g -flto at least during one stage, just as a
sanity check. 
Comparison wouldn't make sense, because we would compare LTO object
files.

-- 
Markus

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

* Re: [RFC] Make 4-stage PGO bootstrap really working
  2017-10-27 15:00             ` Markus Trippelsdorf
@ 2017-10-30 11:08               ` Richard Biener
  0 siblings, 0 replies; 32+ messages in thread
From: Richard Biener @ 2017-10-30 11:08 UTC (permalink / raw)
  To: Markus Trippelsdorf; +Cc: Martin Liška, Jan Hubicka, GCC Patches

On Fri, Oct 27, 2017 at 4:31 PM, Markus Trippelsdorf
<markus@trippelsdorf.de> wrote:
> On 2017.10.27 at 15:03 +0200, Martin Liška wrote:
>> > And BTW would it make sense to add -gtoggle to stage2 in bootstrap-lto?
>>
>> Why do you want to have it there? Am I right that we do not do a stage
>> comparison with LTO bootstrap?
>
> The idea was to trigger -g -flto at least during one stage, just as a
> sanity check.
> Comparison wouldn't make sense, because we would compare LTO object
> files.

I've always wanted to make us compare the actual binaries now that the checksums
do not cause miscompares...  of course linker behavior will then
factor in and I'm
not sure how reliable such compare would be.

And yes, at the moment we _do_ compare LTO bytecode... (which obviously will
fail with -g vs. -g0)

Richard.

> --
> Markus

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

* Re: [PATCH] Append PWD to path when using -fprofile-generate=/some/path.
  2017-10-27 13:19 ` [PATCH] Append PWD to path when using -fprofile-generate=/some/path Martin Liška
@ 2017-12-20 14:55   ` Martin Liška
  2017-12-20 17:35   ` Martin Sebor
  1 sibling, 0 replies; 32+ messages in thread
From: Martin Liška @ 2017-12-20 14:55 UTC (permalink / raw)
  To: GCC Patches; +Cc: Richard Biener, Jan Hubicka

PING^1

On 10/27/2017 03:17 PM, Martin Liška wrote:
> Hello.
> 
> It's improvement that I consider still useful even though we're not going to use
> it for profiled bootstrap.
> 
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
> 
> Ready for trunk?
> Thanks,
> Martin

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

* Re: [PATCH] Append PWD to path when using -fprofile-generate=/some/path.
  2017-10-27 13:19 ` [PATCH] Append PWD to path when using -fprofile-generate=/some/path Martin Liška
  2017-12-20 14:55   ` Martin Liška
@ 2017-12-20 17:35   ` Martin Sebor
  2017-12-20 17:45     ` Jakub Jelinek
  1 sibling, 1 reply; 32+ messages in thread
From: Martin Sebor @ 2017-12-20 17:35 UTC (permalink / raw)
  To: Martin Liška, GCC Patches; +Cc: Richard Biener, Jan Hubicka

On 10/27/2017 07:17 AM, Martin Liška wrote:
> Hello.
>
> It's improvement that I consider still useful even though we're not
> going to use
> it for profiled bootstrap.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

For what it's worth, although it looks correct as is, I think
the code in the patch would be clearer and less prone to off
by-1 errors, while at the same time equally as efficient, if
it were written in terms of strcpy and strcat:

   char *b = XNEWVEC (char,
                      2 + strlen (pwd)
                      + strlen (profile_data_prefix));

   strcpy (b, profile_data_prefix);
   strcat (b, "/");
   strcat (b, pwd);

GCC has all the smarts to turn this code into the elaborated
form using memcpy.  Plus, it's getting better at checking
string functions for invalid accesses, but it's not quite
as good at checking raw memory functions, or at checking
combinations of those and direct accesses to array elements.
We might as well eat our own dog food and put all this
machinery to good use within GCC itself.

Martin

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

* Re: [PATCH] Append PWD to path when using -fprofile-generate=/some/path.
  2017-12-20 17:35   ` Martin Sebor
@ 2017-12-20 17:45     ` Jakub Jelinek
  2017-12-20 18:00       ` Martin Sebor
  2017-12-21  9:13       ` Martin Liška
  0 siblings, 2 replies; 32+ messages in thread
From: Jakub Jelinek @ 2017-12-20 17:45 UTC (permalink / raw)
  To: Martin Sebor; +Cc: Martin Liška, GCC Patches, Richard Biener, Jan Hubicka

On Wed, Dec 20, 2017 at 10:35:44AM -0700, Martin Sebor wrote:
> On 10/27/2017 07:17 AM, Martin Liška wrote:
> > Hello.
> > 
> > It's improvement that I consider still useful even though we're not
> > going to use
> > it for profiled bootstrap.
> > 
> > Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
> 
> For what it's worth, although it looks correct as is, I think
> the code in the patch would be clearer and less prone to off
> by-1 errors, while at the same time equally as efficient, if
> it were written in terms of strcpy and strcat:
> 
>   char *b = XNEWVEC (char,
>                      2 + strlen (pwd)
>                      + strlen (profile_data_prefix));
> 
>   strcpy (b, profile_data_prefix);
>   strcat (b, "/");
>   strcat (b, pwd);

I disagree.  One thing is that GCC attempts to optimize even bad code;
in many cases just can't as soon as there is some call in between etc.,
the other is that we just shouldn't give bad examples.
When you know the sizes, we shouldn't be lazy and rely on compiler to figure
out what we should have written.  Though on this case we have a nice
function for all of that,
  char *b = concat (profile_data_prefix, "/", pwd, NULL);

Another thing is that the "/" in there is wrong, so
  const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
  char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
needs to be used instead.
Does profile_data_prefix have any dir separators stripped from the end?
Is pwd guaranteed to be relative in this case?

	Jakub

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

* Re: [PATCH] Append PWD to path when using -fprofile-generate=/some/path.
  2017-12-20 17:45     ` Jakub Jelinek
@ 2017-12-20 18:00       ` Martin Sebor
  2017-12-21  9:13       ` Martin Liška
  1 sibling, 0 replies; 32+ messages in thread
From: Martin Sebor @ 2017-12-20 18:00 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: Martin Liška, GCC Patches, Richard Biener, Jan Hubicka

On 12/20/2017 10:45 AM, Jakub Jelinek wrote:
> On Wed, Dec 20, 2017 at 10:35:44AM -0700, Martin Sebor wrote:
>> On 10/27/2017 07:17 AM, Martin Liška wrote:
>>> Hello.
>>>
>>> It's improvement that I consider still useful even though we're not
>>> going to use
>>> it for profiled bootstrap.
>>>
>>> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>>
>> For what it's worth, although it looks correct as is, I think
>> the code in the patch would be clearer and less prone to off
>> by-1 errors, while at the same time equally as efficient, if
>> it were written in terms of strcpy and strcat:
>>
>>   char *b = XNEWVEC (char,
>>                      2 + strlen (pwd)
>>                      + strlen (profile_data_prefix));
>>
>>   strcpy (b, profile_data_prefix);
>>   strcat (b, "/");
>>   strcat (b, pwd);
>
> I disagree.

Of course you do.

>  One thing is that GCC attempts to optimize even bad code;
> in many cases just can't as soon as there is some call in between etc.,
> the other is that we just shouldn't give bad examples.
> When you know the sizes, we shouldn't be lazy and rely on compiler to figure
> out what we should have written.

It's my turn to disagree now.  We most certainly should be lazy
and rely on our tools and high-level abstractions to do the work
for us.  That's what they're for.

> Though on this case we have a nice
> function for all of that,
>   char *b = concat (profile_data_prefix, "/", pwd, NULL);

Even better (unless this is being lazy ;-)

Martin

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

* Re: [PATCH] Append PWD to path when using -fprofile-generate=/some/path.
  2017-12-20 17:45     ` Jakub Jelinek
  2017-12-20 18:00       ` Martin Sebor
@ 2017-12-21  9:13       ` Martin Liška
  2017-12-21 16:30         ` Martin Sebor
  2018-05-16 12:26         ` [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759) Martin Liška
  1 sibling, 2 replies; 32+ messages in thread
From: Martin Liška @ 2017-12-21  9:13 UTC (permalink / raw)
  To: Jakub Jelinek, Martin Sebor; +Cc: GCC Patches, Richard Biener, Jan Hubicka

On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
> Another thing is that the "/" in there is wrong, so
>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
> needs to be used instead.

This looks much nicer, I forgot about DIR_SEPARATOR.

> Does profile_data_prefix have any dir separators stripped from the end?

That's easy to achieve..

> Is pwd guaranteed to be relative in this case?

.. however this is absolute path, which would be problematic on a DOC based FS.
Maybe we should do the same path mangling as we do for purpose of gcov:

https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424

What do you think about it?
Regarding the string manipulation: I'm not an expert, but work with string in C
is for me always a pain :)

Martin

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

* Re: [PATCH] Append PWD to path when using -fprofile-generate=/some/path.
  2017-12-21  9:13       ` Martin Liška
@ 2017-12-21 16:30         ` Martin Sebor
  2018-05-16 12:26         ` [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759) Martin Liška
  1 sibling, 0 replies; 32+ messages in thread
From: Martin Sebor @ 2017-12-21 16:30 UTC (permalink / raw)
  To: Martin Liška, Jakub Jelinek; +Cc: GCC Patches, Richard Biener, Jan Hubicka

On 12/21/2017 02:13 AM, Martin Liška wrote:
> On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
>> Another thing is that the "/" in there is wrong, so
>>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
>> needs to be used instead.
>
> This looks much nicer, I forgot about DIR_SEPARATOR.
>
>> Does profile_data_prefix have any dir separators stripped from the end?
>
> That's easy to achieve..
>
>> Is pwd guaranteed to be relative in this case?
>
> .. however this is absolute path, which would be problematic on a DOC based FS.
> Maybe we should do the same path mangling as we do for purpose of gcov:
>
> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424
>
> What do you think about it?
> Regarding the string manipulation: I'm not an expert, but work with string in C
> is for me always a pain :)

For me too, especially when using the lowest level APIs like
memcpy or even strcpy.  Higher-level interfaces like this concat
or sprintf (and asprintf) take away the onerous tedium of getting
the character counts and offsets right.  C++ std::string makes it
completely trivial by also managing memory:

   std::string path = prefix + separator + suffix;

String may not be appropriate everywhere but for things where
the space overhead isn't significant (e.g., pathnames) it's
the right tool for the job.  (Trying to use string in the case
of this small change probably wouldn't make sense without also
making the change in the rest of the file.)

Martin

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

* [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759).
  2017-12-21  9:13       ` Martin Liška
  2017-12-21 16:30         ` Martin Sebor
@ 2018-05-16 12:26         ` Martin Liška
  2018-06-20 11:54           ` Martin Liška
                             ` (2 more replies)
  1 sibling, 3 replies; 32+ messages in thread
From: Martin Liška @ 2018-05-16 12:26 UTC (permalink / raw)
  To: Jakub Jelinek, Martin Sebor; +Cc: GCC Patches, Richard Biener, Jan Hubicka

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

On 12/21/2017 10:13 AM, Martin Liška wrote:
> On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
>> Another thing is that the "/" in there is wrong, so
>>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
>> needs to be used instead.
> 
> This looks much nicer, I forgot about DIR_SEPARATOR.
> 
>> Does profile_data_prefix have any dir separators stripped from the end?
> 
> That's easy to achieve..
> 
>> Is pwd guaranteed to be relative in this case?
> 
> .. however this is absolute path, which would be problematic on a DOC based FS.
> Maybe we should do the same path mangling as we do for purpose of gcov:
> 
> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424

Hi.

I decided to implement that. Which means for:

$ gcc -fprofile-generate=/tmp/myfolder empty.c -O2 && ./a.out 

we get following file:
/tmp/myfolder/#home#marxin#Programming#testcases#tmp#empty.gcda

That guarantees we have a unique file path. As seen in the PR it
can produce a funny ICE.

I've been testing the patch.
Ready after it finishes tests?

Martin

> 
> What do you think about it?
> Regarding the string manipulation: I'm not an expert, but work with string in C
> is for me always a pain :)
> 
> Martin
> 


[-- Attachment #2: 0001-When-using-fprofile-generate-some-path-mangle-absolu.patch --]
[-- Type: text/x-patch, Size: 5224 bytes --]

From 386a4561a4d1501e8959871791289e95f6a89af5 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Wed, 16 Aug 2017 10:22:57 +0200
Subject: [PATCH] When using -fprofile-generate=/some/path mangle absolute path
 of file (PR lto/85759).

gcc/ChangeLog:

2018-05-16  Martin Liska  <mliska@suse.cz>

	PR lto/85759
	* coverage.c (coverage_init): Mangle full path name.
	* doc/invoke.texi: Document the change.
	* gcov-io.c (mangle_path): New.
	* gcov-io.h (mangle_path): Likewise.
	* gcov.c (mangle_name): Use mangle_path for path mangling.
---
 gcc/coverage.c      | 20 ++++++++++++++++++--
 gcc/doc/invoke.texi |  3 +++
 gcc/gcov-io.c       | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
 gcc/gcov-io.h       |  1 +
 gcc/gcov.c          | 37 +------------------------------------
 5 files changed, 72 insertions(+), 38 deletions(-)

diff --git a/gcc/coverage.c b/gcc/coverage.c
index 32ef298a11f..6e621c3ff96 100644
--- a/gcc/coverage.c
+++ b/gcc/coverage.c
@@ -1227,8 +1227,24 @@ coverage_init (const char *filename)
     g->get_passes ()->get_pass_profile ()->static_pass_number;
   g->get_dumps ()->dump_start (profile_pass_num, NULL);
 
-  if (!profile_data_prefix && !IS_ABSOLUTE_PATH (filename))
-    profile_data_prefix = getpwd ();
+  if (!IS_ABSOLUTE_PATH (filename))
+    {
+      /* When a profile_data_prefix is provided, then mangle full path
+	 of filename in order to prevent file path clashing.  */
+      if (profile_data_prefix)
+	{
+#if HAVE_DOS_BASED_FILE_SYSTEM
+	  const char separator = "\\";
+#else
+	  const char *separator = "/";
+#endif
+	  filename = concat (getpwd (), separator, filename, NULL);
+	  filename = mangle_path (filename);
+	  len = strlen (filename);
+	}
+      else
+	profile_data_prefix = getpwd ();
+    }
 
   if (profile_data_prefix)
     prefix_len = strlen (profile_data_prefix);
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index ca3772bbebf..4859cec0ab5 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -11253,6 +11253,9 @@ and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
 and its related options.  Both absolute and relative paths can be used.
 By default, GCC uses the current directory as @var{path}, thus the
 profile data file appears in the same directory as the object file.
+In order to prevent filename clashing, if object file name is not an absolute
+path, we mangle absolute path of @file{@var{sourcename}.gcda} file and
+use it as file name of a @file{.gcda} file.
 
 @item -fprofile-generate
 @itemx -fprofile-generate=@var{path}
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index 3fe1e613ebc..68660d6d3cf 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -576,6 +576,55 @@ gcov_read_counter (void)
   return value;
 }
 
+/* Mangle filename path of BASE and output new allocated pointer with
+   mangled path.  */
+
+char *
+mangle_path (char const *base)
+{
+  /* Convert '/' to '#', convert '..' to '^',
+     convert ':' to '~' on DOS based file system.  */
+  const char *probe;
+  char *buffer = (char *)xmalloc (strlen (base) + 10);
+  char *ptr = buffer;
+
+#if HAVE_DOS_BASED_FILE_SYSTEM
+  if (base[0] && base[1] == ':')
+    {
+      ptr[0] = base[0];
+      ptr[1] = '~';
+      ptr += 2;
+      base += 2;
+    }
+#endif
+  for (; *base; base = probe)
+    {
+      size_t len;
+
+      for (probe = base; *probe; probe++)
+	if (*probe == '/')
+	  break;
+      len = probe - base;
+      if (len == 2 && base[0] == '.' && base[1] == '.')
+	*ptr++ = '^';
+      else
+	{
+	  memcpy (ptr, base, len);
+	  ptr += len;
+	}
+      if (*probe)
+	{
+	  *ptr++ = '#';
+	  probe++;
+	}
+    }
+
+  /* Terminate the string.  */
+  *ptr = '\0';
+
+  return buffer;
+}
+
 /* We need to expose the below function when compiling for gcov-tool.  */
 
 #if !IN_LIBGCOV || defined (IN_GCOV_TOOL)
diff --git a/gcc/gcov-io.h b/gcc/gcov-io.h
index d6389c48908..cdf9f4cac3f 100644
--- a/gcc/gcov-io.h
+++ b/gcc/gcov-io.h
@@ -381,6 +381,7 @@ GCOV_LINKAGE void gcov_read_summary (struct gcov_summary *) ATTRIBUTE_HIDDEN;
 GCOV_LINKAGE const char *gcov_read_string (void);
 GCOV_LINKAGE void gcov_sync (gcov_position_t /*base*/,
 			     gcov_unsigned_t /*length */);
+char *mangle_path (char const *base);
 
 #if !IN_GCOV
 /* Available outside gcov */
diff --git a/gcc/gcov.c b/gcc/gcov.c
index 6bbfe33ca33..7c1950d5df9 100644
--- a/gcc/gcov.c
+++ b/gcc/gcov.c
@@ -2434,42 +2434,7 @@ mangle_name (char const *base, char *ptr)
       ptr += len;
     }
   else
-    {
-      /* Convert '/' to '#', convert '..' to '^',
-	 convert ':' to '~' on DOS based file system.  */
-      const char *probe;
-
-#if HAVE_DOS_BASED_FILE_SYSTEM
-      if (base[0] && base[1] == ':')
-	{
-	  ptr[0] = base[0];
-	  ptr[1] = '~';
-	  ptr += 2;
-	  base += 2;
-	}
-#endif
-      for (; *base; base = probe)
-	{
-	  size_t len;
-
-	  for (probe = base; *probe; probe++)
-	    if (*probe == '/')
-	      break;
-	  len = probe - base;
-	  if (len == 2 && base[0] == '.' && base[1] == '.')
-	    *ptr++ = '^';
-	  else
-	    {
-	      memcpy (ptr, base, len);
-	      ptr += len;
-	    }
-	  if (*probe)
-	    {
-	      *ptr++ = '#';
-	      probe++;
-	    }
-	}
-    }
+    ptr = mangle_path (base);
 
   return ptr;
 }
-- 
2.16.3


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

* Re: [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759).
  2018-05-16 12:26         ` [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759) Martin Liška
@ 2018-06-20 11:54           ` Martin Liška
  2018-06-22 20:35           ` Jeff Law
  2018-07-03  9:39           ` Jonathan Wakely
  2 siblings, 0 replies; 32+ messages in thread
From: Martin Liška @ 2018-06-20 11:54 UTC (permalink / raw)
  To: Jakub Jelinek, Martin Sebor; +Cc: GCC Patches, Richard Biener, Jan Hubicka

PING^1

On 05/16/2018 01:53 PM, Martin Liška wrote:
> On 12/21/2017 10:13 AM, Martin Liška wrote:
>> On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
>>> Another thing is that the "/" in there is wrong, so
>>>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>>>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
>>> needs to be used instead.
>>
>> This looks much nicer, I forgot about DIR_SEPARATOR.
>>
>>> Does profile_data_prefix have any dir separators stripped from the end?
>>
>> That's easy to achieve..
>>
>>> Is pwd guaranteed to be relative in this case?
>>
>> .. however this is absolute path, which would be problematic on a DOC based FS.
>> Maybe we should do the same path mangling as we do for purpose of gcov:
>>
>> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424
> 
> Hi.
> 
> I decided to implement that. Which means for:
> 
> $ gcc -fprofile-generate=/tmp/myfolder empty.c -O2 && ./a.out 
> 
> we get following file:
> /tmp/myfolder/#home#marxin#Programming#testcases#tmp#empty.gcda
> 
> That guarantees we have a unique file path. As seen in the PR it
> can produce a funny ICE.
> 
> I've been testing the patch.
> Ready after it finishes tests?
> 
> Martin
> 
>>
>> What do you think about it?
>> Regarding the string manipulation: I'm not an expert, but work with string in C
>> is for me always a pain :)
>>
>> Martin
>>
> 

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

* Re: [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759).
  2018-05-16 12:26         ` [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759) Martin Liška
  2018-06-20 11:54           ` Martin Liška
@ 2018-06-22 20:35           ` Jeff Law
  2018-06-29 14:38             ` Martin Liška
  2018-07-03  9:39           ` Jonathan Wakely
  2 siblings, 1 reply; 32+ messages in thread
From: Jeff Law @ 2018-06-22 20:35 UTC (permalink / raw)
  To: Martin Liška, Jakub Jelinek, Martin Sebor
  Cc: GCC Patches, Richard Biener, Jan Hubicka

On 05/16/2018 05:53 AM, Martin Liška wrote:
> On 12/21/2017 10:13 AM, Martin Liška wrote:
>> On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
>>> Another thing is that the "/" in there is wrong, so
>>>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>>>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
>>> needs to be used instead.
>> This looks much nicer, I forgot about DIR_SEPARATOR.
>>
>>> Does profile_data_prefix have any dir separators stripped from the end?
>> That's easy to achieve..
>>
>>> Is pwd guaranteed to be relative in this case?
>> .. however this is absolute path, which would be problematic on a DOC based FS.
>> Maybe we should do the same path mangling as we do for purpose of gcov:
>>
>> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424
> Hi.
> 
> I decided to implement that. Which means for:
> 
> $ gcc -fprofile-generate=/tmp/myfolder empty.c -O2 && ./a.out 
> 
> we get following file:
> /tmp/myfolder/#home#marxin#Programming#testcases#tmp#empty.gcda
> 
> That guarantees we have a unique file path. As seen in the PR it
> can produce a funny ICE.
> 
> I've been testing the patch.
> Ready after it finishes tests?
> 
> Martin
> 
>> What do you think about it?
>> Regarding the string manipulation: I'm not an expert, but work with string in C
>> is for me always a pain :)
>>
>> Martin
>>
> 
> 0001-When-using-fprofile-generate-some-path-mangle-absolu.patch
> 
> 
> From 386a4561a4d1501e8959871791289e95f6a89af5 Mon Sep 17 00:00:00 2001
> From: marxin <mliska@suse.cz>
> Date: Wed, 16 Aug 2017 10:22:57 +0200
> Subject: [PATCH] When using -fprofile-generate=/some/path mangle absolute path
>  of file (PR lto/85759).
> 
> gcc/ChangeLog:
> 
> 2018-05-16  Martin Liska  <mliska@suse.cz>
> 
> 	PR lto/85759
> 	* coverage.c (coverage_init): Mangle full path name.
> 	* doc/invoke.texi: Document the change.
> 	* gcov-io.c (mangle_path): New.
> 	* gcov-io.h (mangle_path): Likewise.
> 	* gcov.c (mangle_name): Use mangle_path for path mangling.
ISTM you can self-approve this now if you want it to move forward :-)

jeff

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

* Re: [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759).
  2018-06-22 20:35           ` Jeff Law
@ 2018-06-29 14:38             ` Martin Liška
  2018-07-02  8:51               ` Rainer Orth
  2018-07-20  4:02               ` Bin.Cheng
  0 siblings, 2 replies; 32+ messages in thread
From: Martin Liška @ 2018-06-29 14:38 UTC (permalink / raw)
  To: Jeff Law, Jakub Jelinek, Martin Sebor
  Cc: GCC Patches, Richard Biener, Jan Hubicka

On 06/22/2018 10:35 PM, Jeff Law wrote:
> On 05/16/2018 05:53 AM, Martin Liška wrote:
>> On 12/21/2017 10:13 AM, Martin Liška wrote:
>>> On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
>>>> Another thing is that the "/" in there is wrong, so
>>>>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>>>>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
>>>> needs to be used instead.
>>> This looks much nicer, I forgot about DIR_SEPARATOR.
>>>
>>>> Does profile_data_prefix have any dir separators stripped from the end?
>>> That's easy to achieve..
>>>
>>>> Is pwd guaranteed to be relative in this case?
>>> .. however this is absolute path, which would be problematic on a DOC based FS.
>>> Maybe we should do the same path mangling as we do for purpose of gcov:
>>>
>>> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424
>> Hi.
>>
>> I decided to implement that. Which means for:
>>
>> $ gcc -fprofile-generate=/tmp/myfolder empty.c -O2 && ./a.out 
>>
>> we get following file:
>> /tmp/myfolder/#home#marxin#Programming#testcases#tmp#empty.gcda
>>
>> That guarantees we have a unique file path. As seen in the PR it
>> can produce a funny ICE.
>>
>> I've been testing the patch.
>> Ready after it finishes tests?
>>
>> Martin
>>
>>> What do you think about it?
>>> Regarding the string manipulation: I'm not an expert, but work with string in C
>>> is for me always a pain :)
>>>
>>> Martin
>>>
>>
>> 0001-When-using-fprofile-generate-some-path-mangle-absolu.patch
>>
>>
>> From 386a4561a4d1501e8959871791289e95f6a89af5 Mon Sep 17 00:00:00 2001
>> From: marxin <mliska@suse.cz>
>> Date: Wed, 16 Aug 2017 10:22:57 +0200
>> Subject: [PATCH] When using -fprofile-generate=/some/path mangle absolute path
>>  of file (PR lto/85759).
>>
>> gcc/ChangeLog:
>>
>> 2018-05-16  Martin Liska  <mliska@suse.cz>
>>
>> 	PR lto/85759
>> 	* coverage.c (coverage_init): Mangle full path name.
>> 	* doc/invoke.texi: Document the change.
>> 	* gcov-io.c (mangle_path): New.
>> 	* gcov-io.h (mangle_path): Likewise.
>> 	* gcov.c (mangle_name): Use mangle_path for path mangling.
> ISTM you can self-approve this now if you want it to move forward :-)
> 
> jeff
> 

Sure, let me install the patch then.

Martin

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

* Re: [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759).
  2018-06-29 14:38             ` Martin Liška
@ 2018-07-02  8:51               ` Rainer Orth
  2018-07-20  4:02               ` Bin.Cheng
  1 sibling, 0 replies; 32+ messages in thread
From: Rainer Orth @ 2018-07-02  8:51 UTC (permalink / raw)
  To: Martin Liška
  Cc: Jeff Law, Jakub Jelinek, Martin Sebor, GCC Patches,
	Richard Biener, Jan Hubicka

Hi Martin,

> On 06/22/2018 10:35 PM, Jeff Law wrote:
>> On 05/16/2018 05:53 AM, Martin Liška wrote:
>>> On 12/21/2017 10:13 AM, Martin Liška wrote:
>>>> On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
>>>>> Another thing is that the "/" in there is wrong, so
>>>>>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>>>>>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
>>>>> needs to be used instead.
>>>> This looks much nicer, I forgot about DIR_SEPARATOR.
>>>>
>>>>> Does profile_data_prefix have any dir separators stripped from the end?
>>>> That's easy to achieve..
>>>>
>>>>> Is pwd guaranteed to be relative in this case?
>>>> .. however this is absolute path, which would be problematic on a DOC
>>>> based FS.
>>>> Maybe we should do the same path mangling as we do for purpose of gcov:
>>>>
>>>> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424
>>> Hi.
>>>
>>> I decided to implement that. Which means for:
>>>
>>> $ gcc -fprofile-generate=/tmp/myfolder empty.c -O2 && ./a.out 
>>>
>>> we get following file:
>>> /tmp/myfolder/#home#marxin#Programming#testcases#tmp#empty.gcda
>>>
>>> That guarantees we have a unique file path. As seen in the PR it
>>> can produce a funny ICE.
>>>
>>> I've been testing the patch.
>>> Ready after it finishes tests?
>>>
>>> Martin
>>>
>>>> What do you think about it?
>>>> Regarding the string manipulation: I'm not an expert, but work with
>>>> string in C
>>>> is for me always a pain :)
>>>>
>>>> Martin
>>>>
>>>
>>> 0001-When-using-fprofile-generate-some-path-mangle-absolu.patch
>>>
>>>
>>> From 386a4561a4d1501e8959871791289e95f6a89af5 Mon Sep 17 00:00:00 2001
>>> From: marxin <mliska@suse.cz>
>>> Date: Wed, 16 Aug 2017 10:22:57 +0200
>>> Subject: [PATCH] When using -fprofile-generate=/some/path mangle absolute path
>>>  of file (PR lto/85759).
>>>
>>> gcc/ChangeLog:
>>>
>>> 2018-05-16  Martin Liska  <mliska@suse.cz>
>>>
>>> 	PR lto/85759
>>> 	* coverage.c (coverage_init): Mangle full path name.
>>> 	* doc/invoke.texi: Document the change.
>>> 	* gcov-io.c (mangle_path): New.
>>> 	* gcov-io.h (mangle_path): Likewise.
>>> 	* gcov.c (mangle_name): Use mangle_path for path mangling.
>> ISTM you can self-approve this now if you want it to move forward :-)
>> 
>> jeff
>> 
>
> Sure, let me install the patch then.

your patch caused 3 testcases to regress everywhere:

+UNRESOLVED: gcc.dg/pr47793.c scan-file .
+FAIL: gcc.dg/profile-dir-1.c scan-ipa-dump cgraph " ./profile-dir-1.gcda"
+FAIL: gcc.dg/profile-dir-3.c scan-ipa-dump cgraph " ./profile-dir-3.gcda"

Please fix.

	Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

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

* Re: [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759).
  2018-05-16 12:26         ` [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759) Martin Liška
  2018-06-20 11:54           ` Martin Liška
  2018-06-22 20:35           ` Jeff Law
@ 2018-07-03  9:39           ` Jonathan Wakely
  2 siblings, 0 replies; 32+ messages in thread
From: Jonathan Wakely @ 2018-07-03  9:39 UTC (permalink / raw)
  To: Martin Liška
  Cc: Jakub Jelinek, Martin Sebor, GCC Patches, Richard Biener, Jan Hubicka

On 16/05/18 13:53 +0200, Martin Liška wrote:
>On 12/21/2017 10:13 AM, Martin Liška wrote:
>> On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
>>> Another thing is that the "/" in there is wrong, so
>>>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>>>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
>>> needs to be used instead.
>>
>> This looks much nicer, I forgot about DIR_SEPARATOR.
>>
>>> Does profile_data_prefix have any dir separators stripped from the end?
>>
>> That's easy to achieve..
>>
>>> Is pwd guaranteed to be relative in this case?
>>
>> .. however this is absolute path, which would be problematic on a DOC based FS.
>> Maybe we should do the same path mangling as we do for purpose of gcov:
>>
>> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424
>
>Hi.
>
>I decided to implement that. Which means for:
>
>$ gcc -fprofile-generate=/tmp/myfolder empty.c -O2 && ./a.out
>
>we get following file:
>/tmp/myfolder/#home#marxin#Programming#testcases#tmp#empty.gcda
>
>That guarantees we have a unique file path. As seen in the PR it
>can produce a funny ICE.
>
>I've been testing the patch.
>Ready after it finishes tests?
>
>Martin
>
>>
>> What do you think about it?
>> Regarding the string manipulation: I'm not an expert, but work with string in C
>> is for me always a pain :)
>>
>> Martin
>>
>

>From 386a4561a4d1501e8959871791289e95f6a89af5 Mon Sep 17 00:00:00 2001
>From: marxin <mliska@suse.cz>
>Date: Wed, 16 Aug 2017 10:22:57 +0200
>Subject: [PATCH] When using -fprofile-generate=/some/path mangle absolute path
> of file (PR lto/85759).
>
>gcc/ChangeLog:
>
>2018-05-16  Martin Liska  <mliska@suse.cz>
>
>	PR lto/85759
>	* coverage.c (coverage_init): Mangle full path name.
>	* doc/invoke.texi: Document the change.
>	* gcov-io.c (mangle_path): New.
>	* gcov-io.h (mangle_path): Likewise.
>	* gcov.c (mangle_name): Use mangle_path for path mangling.
>---
> gcc/coverage.c      | 20 ++++++++++++++++++--
> gcc/doc/invoke.texi |  3 +++
> gcc/gcov-io.c       | 49 +++++++++++++++++++++++++++++++++++++++++++++++++
> gcc/gcov-io.h       |  1 +
> gcc/gcov.c          | 37 +------------------------------------
> 5 files changed, 72 insertions(+), 38 deletions(-)
>
>diff --git a/gcc/coverage.c b/gcc/coverage.c
>index 32ef298a11f..6e621c3ff96 100644
>--- a/gcc/coverage.c
>+++ b/gcc/coverage.c
>@@ -1227,8 +1227,24 @@ coverage_init (const char *filename)
>     g->get_passes ()->get_pass_profile ()->static_pass_number;
>   g->get_dumps ()->dump_start (profile_pass_num, NULL);
> 
>-  if (!profile_data_prefix && !IS_ABSOLUTE_PATH (filename))
>-    profile_data_prefix = getpwd ();
>+  if (!IS_ABSOLUTE_PATH (filename))
>+    {
>+      /* When a profile_data_prefix is provided, then mangle full path
>+	 of filename in order to prevent file path clashing.  */
>+      if (profile_data_prefix)
>+	{
>+#if HAVE_DOS_BASED_FILE_SYSTEM
>+	  const char separator = "\\";

As mentioned on IRC, this is ill-formed due to the missing *

>+#else
>+	  const char *separator = "/";
>+#endif
>+	  filename = concat (getpwd (), separator, filename, NULL);
>+	  filename = mangle_path (filename);
>+	  len = strlen (filename);
>+	}
>+      else
>+	profile_data_prefix = getpwd ();
>+    }
> 
>   if (profile_data_prefix)
>     prefix_len = strlen (profile_data_prefix);
>diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
>index ca3772bbebf..4859cec0ab5 100644
>--- a/gcc/doc/invoke.texi
>+++ b/gcc/doc/invoke.texi
>@@ -11253,6 +11253,9 @@ and used by @option{-fprofile-use} and @option{-fbranch-probabilities}
> and its related options.  Both absolute and relative paths can be used.
> By default, GCC uses the current directory as @var{path}, thus the
> profile data file appears in the same directory as the object file.
>+In order to prevent filename clashing, if object file name is not an absolute
>+path, we mangle absolute path of @file{@var{sourcename}.gcda} file and
>+use it as file name of a @file{.gcda} file.

This is missing several definite articles, and is inconsistent about
using "filename" and "file name", i.e.

In order to prevent the file name clashing, if the object file name is
not an absolute path, we mangle the absolute path of the
@file{@var{sourcename}.gcda} file and use it as the file name of a
@file{.gcda} file. 

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

* Re: [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759).
  2018-06-29 14:38             ` Martin Liška
  2018-07-02  8:51               ` Rainer Orth
@ 2018-07-20  4:02               ` Bin.Cheng
  2018-07-20  8:43                 ` Martin Liška
  1 sibling, 1 reply; 32+ messages in thread
From: Bin.Cheng @ 2018-07-20  4:02 UTC (permalink / raw)
  To: Martin Liška; +Cc: GCC Patches

On Fri, Jun 29, 2018 at 9:54 PM, Martin Liška <mliska@suse.cz> wrote:
> On 06/22/2018 10:35 PM, Jeff Law wrote:
>> On 05/16/2018 05:53 AM, Martin Liška wrote:
>>> On 12/21/2017 10:13 AM, Martin Liška wrote:
>>>> On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
>>>>> Another thing is that the "/" in there is wrong, so
>>>>>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>>>>>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
>>>>> needs to be used instead.
>>>> This looks much nicer, I forgot about DIR_SEPARATOR.
>>>>
>>>>> Does profile_data_prefix have any dir separators stripped from the end?
>>>> That's easy to achieve..
>>>>
>>>>> Is pwd guaranteed to be relative in this case?
>>>> .. however this is absolute path, which would be problematic on a DOC based FS.
>>>> Maybe we should do the same path mangling as we do for purpose of gcov:
>>>>
>>>> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424
>>> Hi.
>>>
>>> I decided to implement that. Which means for:
>>>
>>> $ gcc -fprofile-generate=/tmp/myfolder empty.c -O2 && ./a.out
>>>
>>> we get following file:
>>> /tmp/myfolder/#home#marxin#Programming#testcases#tmp#empty.gcda
>>>
>>> That guarantees we have a unique file path. As seen in the PR it
>>> can produce a funny ICE.
>>>
>>> I've been testing the patch.
>>> Ready after it finishes tests?
>>>
>>> Martin
>>>
>>>> What do you think about it?
>>>> Regarding the string manipulation: I'm not an expert, but work with string in C
>>>> is for me always a pain :)
>>>>
>>>> Martin
>>>>
>>>
>>> 0001-When-using-fprofile-generate-some-path-mangle-absolu.patch
>>>
>>>
>>> From 386a4561a4d1501e8959871791289e95f6a89af5 Mon Sep 17 00:00:00 2001
>>> From: marxin <mliska@suse.cz>
>>> Date: Wed, 16 Aug 2017 10:22:57 +0200
>>> Subject: [PATCH] When using -fprofile-generate=/some/path mangle absolute path
>>>  of file (PR lto/85759).
>>>
>>> gcc/ChangeLog:
>>>
>>> 2018-05-16  Martin Liska  <mliska@suse.cz>
>>>
>>>      PR lto/85759
>>>      * coverage.c (coverage_init): Mangle full path name.
>>>      * doc/invoke.texi: Document the change.
>>>      * gcov-io.c (mangle_path): New.
>>>      * gcov-io.h (mangle_path): Likewise.
>>>      * gcov.c (mangle_name): Use mangle_path for path mangling.
>> ISTM you can self-approve this now if you want it to move forward :-)
>>
>> jeff
>>
>
> Sure, let me install the patch then.
Hi,
I am a bit confused after path mangling change.
Now with below command line:
$ ./gcc -O2 -fprofile-use=./ sort.c -o sort.c
or
$ ./gcc -O2 -fprofile-use=./sort.gcda sort.c -o sort.c

The da_file_name and the final name used in gcov_open is as:

$ p name
$11 = 0x2e63050
./#home#chengbin.cb#work#gcc-patches#trunk-orig#target.build#bin#sort.gcda
or
p da_file_name
$1 = 0x2e63050 "sort.gcda/#home#chengbin.cb#work#gcc-patches#trunk-orig#target.build#bin#sort.gcda"


These are not valid paths?  Or how should I modify the command line options?

Thanks,
bin
>
> Martin

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

* Re: [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759).
  2018-07-20  4:02               ` Bin.Cheng
@ 2018-07-20  8:43                 ` Martin Liška
  0 siblings, 0 replies; 32+ messages in thread
From: Martin Liška @ 2018-07-20  8:43 UTC (permalink / raw)
  To: Bin.Cheng; +Cc: GCC Patches

On 07/20/2018 06:02 AM, Bin.Cheng wrote:
> On Fri, Jun 29, 2018 at 9:54 PM, Martin Liška <mliska@suse.cz> wrote:
>> On 06/22/2018 10:35 PM, Jeff Law wrote:
>>> On 05/16/2018 05:53 AM, Martin Liška wrote:
>>>> On 12/21/2017 10:13 AM, Martin Liška wrote:
>>>>> On 12/20/2017 06:45 PM, Jakub Jelinek wrote:
>>>>>> Another thing is that the "/" in there is wrong, so
>>>>>>   const char dir_separator_str[] = { DIR_SEPARATOR, '\0' };
>>>>>>   char *b = concat (profile_data_prefix, dir_separator_str, pwd, NULL);
>>>>>> needs to be used instead.
>>>>> This looks much nicer, I forgot about DIR_SEPARATOR.
>>>>>
>>>>>> Does profile_data_prefix have any dir separators stripped from the end?
>>>>> That's easy to achieve..
>>>>>
>>>>>> Is pwd guaranteed to be relative in this case?
>>>>> .. however this is absolute path, which would be problematic on a DOC based FS.
>>>>> Maybe we should do the same path mangling as we do for purpose of gcov:
>>>>>
>>>>> https://github.com/gcc-mirror/gcc/blob/master/gcc/gcov.c#L2424
>>>> Hi.
>>>>
>>>> I decided to implement that. Which means for:
>>>>
>>>> $ gcc -fprofile-generate=/tmp/myfolder empty.c -O2 && ./a.out
>>>>
>>>> we get following file:
>>>> /tmp/myfolder/#home#marxin#Programming#testcases#tmp#empty.gcda
>>>>
>>>> That guarantees we have a unique file path. As seen in the PR it
>>>> can produce a funny ICE.
>>>>
>>>> I've been testing the patch.
>>>> Ready after it finishes tests?
>>>>
>>>> Martin
>>>>
>>>>> What do you think about it?
>>>>> Regarding the string manipulation: I'm not an expert, but work with string in C
>>>>> is for me always a pain :)
>>>>>
>>>>> Martin
>>>>>
>>>>
>>>> 0001-When-using-fprofile-generate-some-path-mangle-absolu.patch
>>>>
>>>>
>>>> From 386a4561a4d1501e8959871791289e95f6a89af5 Mon Sep 17 00:00:00 2001
>>>> From: marxin <mliska@suse.cz>
>>>> Date: Wed, 16 Aug 2017 10:22:57 +0200
>>>> Subject: [PATCH] When using -fprofile-generate=/some/path mangle absolute path
>>>>  of file (PR lto/85759).
>>>>
>>>> gcc/ChangeLog:
>>>>
>>>> 2018-05-16  Martin Liska  <mliska@suse.cz>
>>>>
>>>>      PR lto/85759
>>>>      * coverage.c (coverage_init): Mangle full path name.
>>>>      * doc/invoke.texi: Document the change.
>>>>      * gcov-io.c (mangle_path): New.
>>>>      * gcov-io.h (mangle_path): Likewise.
>>>>      * gcov.c (mangle_name): Use mangle_path for path mangling.
>>> ISTM you can self-approve this now if you want it to move forward :-)
>>>
>>> jeff
>>>
>>
>> Sure, let me install the patch then.
> Hi,
> I am a bit confused after path mangling change.
> Now with below command line:

Hi.

> $ ./gcc -O2 -fprofile-use=./ sort.c -o sort.c

Does not make sense, it's default. When using argument
to the option, an absolute path is preferred to be used.

> or
> $ ./gcc -O2 -fprofile-use=./sort.gcda sort.c -o sort.c

Should be always a folder, not a path to a file.

> 
> The da_file_name and the final name used in gcov_open is as:
> 
> $ p name
> $11 = 0x2e63050
> ./#home#chengbin.cb#work#gcc-patches#trunk-orig#target.build#bin#sort.gcda
> or
> p da_file_name
> $1 = 0x2e63050 "sort.gcda/#home#chengbin.cb#work#gcc-patches#trunk-orig#target.build#bin#sort.gcda"
> 
> 
> These are not valid paths?  Or how should I modify the command line options?

Yes, please fix options.

Martin

> 
> Thanks,
> bin
>>
>> Martin

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

end of thread, other threads:[~2018-07-20  8:43 UTC | newest]

Thread overview: 32+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-25 10:00 [PATCH] Introduce 4-stages profiledbootstrap to get a better profile Martin Liška
2017-05-25 10:00 ` Martin Liška
2017-05-25 11:38 ` Markus Trippelsdorf
2017-05-25 16:28   ` Martin Liška
2017-05-29 15:11     ` Jan Hubicka
2017-05-29  5:14 ` Markus Trippelsdorf
2017-06-06 13:30   ` Martin Liška
2017-06-19 10:37     ` Jan Hubicka
2017-08-30 10:44       ` [RFC] Make 4-stage PGO bootstrap really working Martin Liška
2017-09-14 12:21         ` Martin Liška
2017-10-19 12:59           ` Martin Liška
2017-10-19 14:53             ` Markus Trippelsdorf
2017-10-25 12:43         ` Markus Trippelsdorf
2017-10-27 13:07           ` Martin Liška
2017-10-27 15:00             ` Markus Trippelsdorf
2017-10-30 11:08               ` Richard Biener
2017-10-27 13:17           ` [PATCH][OBVIOUS] Fix profiledbootstrap Martin Liška
2017-10-27 13:19 ` [PATCH] Append PWD to path when using -fprofile-generate=/some/path Martin Liška
2017-12-20 14:55   ` Martin Liška
2017-12-20 17:35   ` Martin Sebor
2017-12-20 17:45     ` Jakub Jelinek
2017-12-20 18:00       ` Martin Sebor
2017-12-21  9:13       ` Martin Liška
2017-12-21 16:30         ` Martin Sebor
2018-05-16 12:26         ` [PATCH] When using -fprofile-generate=/some/path mangle absolute path of file (PR lto/85759) Martin Liška
2018-06-20 11:54           ` Martin Liška
2018-06-22 20:35           ` Jeff Law
2018-06-29 14:38             ` Martin Liška
2018-07-02  8:51               ` Rainer Orth
2018-07-20  4:02               ` Bin.Cheng
2018-07-20  8:43                 ` Martin Liška
2018-07-03  9:39           ` Jonathan Wakely

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).