diff mbox series

PR85574 - add gcc/lto$(exeext) to files compared

Message ID alpine.LSU.2.20.1901031450060.23386@zhemvz.fhfr.qr
State New
Headers show
Series PR85574 - add gcc/lto$(exeext) to files compared | expand

Commit Message

Richard Biener Jan. 3, 2019, 2:15 p.m. UTC
This makes sure we do not regress PR85574 and thus that when
doing LTO bootstrap the generated binaries do not differ from
stage2 to stage3.  Note we indepenently verify the object
files which contain just LTO bytecode do not differ (besides
differences in the LTO options sections).

This has the chance of breaking on some targets given we've
never compared binaries before but just object files.

Still it's an invariant we'd like to hold, so hopefully it
works out.

Bootstrapped on x86_64-unknown-linux-gnu, LTO bootstrapped on
x86_64-unknown-linux-gnu.

OK for trunk?

Note I picked just gcc/lto1 as a binary that will surely be
available when doing LTO bootstrap rather than also compare
all $(exeext) found in stageN-gcc/ (build/gen* are for example
also LTO compiled).  The explicit list could also be amended
of course.

Thanks,
Richard.

2019-01-03  Richard Biener  <rguenther@suse.de>

	PR bootstrap/85574
	* Makefile.tpl (compare target): Also compare extra-compare
	files.
	* Makefile.in: Regenerate.

	config/
	* bootstrap-lto.mk (extra-compare): Set to gcc/lto1$(exeext).

Comments

Richard Biener May 2, 2019, 1:59 p.m. UTC | #1
On Thu, Jan 3, 2019 at 3:16 PM Richard Biener <rguenther@suse.de> wrote:
>
>
> This makes sure we do not regress PR85574 and thus that when
> doing LTO bootstrap the generated binaries do not differ from
> stage2 to stage3.  Note we indepenently verify the object
> files which contain just LTO bytecode do not differ (besides
> differences in the LTO options sections).
>
> This has the chance of breaking on some targets given we've
> never compared binaries before but just object files.
>
> Still it's an invariant we'd like to hold, so hopefully it
> works out.
>
> Bootstrapped on x86_64-unknown-linux-gnu, LTO bootstrapped on
> x86_64-unknown-linux-gnu.
>
> OK for trunk?

Now committed as r270798 after LTO bootstrap on x86_64-linux.

Richard.

>
> Note I picked just gcc/lto1 as a binary that will surely be
> available when doing LTO bootstrap rather than also compare
> all $(exeext) found in stageN-gcc/ (build/gen* are for example
> also LTO compiled).  The explicit list could also be amended
> of course.
>
> Thanks,
> Richard.
>
> 2019-01-03  Richard Biener  <rguenther@suse.de>
>
>         PR bootstrap/85574
>         * Makefile.tpl (compare target): Also compare extra-compare
>         files.
>         * Makefile.in: Regenerate.
>
>         config/
>         * bootstrap-lto.mk (extra-compare): Set to gcc/lto1$(exeext).
>
> Index: Makefile.in
> ===================================================================
> --- Makefile.in (revision 267551)
> +++ Makefile.in (working copy)
> @@ -53850,7 +53850,7 @@ compare:
>          sed=`echo stage3 | sed 's,^stage,,;s,.,.,g'`; \
>         files=`find stage3-* -name "*$(objext)" -print | \
>                  sed -n s,^stage$$sed-,,p`; \
> -       for file in $${files}; do \
> +       for file in $${files} ${extra-compare}; do \
>           f1=$$r/stage2-$$file; f2=$$r/stage3-$$file; \
>           if test ! -f $$f1; then continue; fi; \
>           $(do-compare) > /dev/null 2>&1; \
> @@ -54248,7 +54248,7 @@ compare3:
>          sed=`echo stage4 | sed 's,^stage,,;s,.,.,g'`; \
>         files=`find stage4-* -name "*$(objext)" -print | \
>                  sed -n s,^stage$$sed-,,p`; \
> -       for file in $${files}; do \
> +       for file in $${files} ${extra-compare}; do \
>           f1=$$r/stage3-$$file; f2=$$r/stage4-$$file; \
>           if test ! -f $$f1; then continue; fi; \
>           $(do-compare3) > /dev/null 2>&1; \
> Index: Makefile.tpl
> ===================================================================
> --- Makefile.tpl        (revision 267551)
> +++ Makefile.tpl        (working copy)
> @@ -1675,7 +1675,7 @@ do-clean: clean-stage[+id+]
>          sed=`echo stage[+id+] | sed 's,^stage,,;s,.,.,g'`; \
>         files=`find stage[+id+]-* -name "*$(objext)" -print | \
>                  sed -n s,^stage$$sed-,,p`; \
> -       for file in $${files}; do \
> +       for file in $${files} ${extra-compare}; do \
>           f1=$$r/stage[+prev+]-$$file; f2=$$r/stage[+id+]-$$file; \
>           if test ! -f $$f1; then continue; fi; \
>           $(do-[+compare-target+]) > /dev/null 2>&1; \
> Index: config/bootstrap-lto.mk
> ===================================================================
> --- config/bootstrap-lto.mk     (revision 267551)
> +++ config/bootstrap-lto.mk     (working copy)
> @@ -15,3 +15,4 @@ LTO_EXPORTS = AR="$(LTO_AR)"; export AR;
>  LTO_FLAGS_TO_PASS = AR="$(LTO_AR)" RANLIB="$(LTO_RANLIB)"
>
>  do-compare = $(SHELL) $(srcdir)/contrib/compare-lto $$f1 $$f2
> +extra-compare = gcc/lto1$(exeext)
diff mbox series

Patch

Index: Makefile.in
===================================================================
--- Makefile.in	(revision 267551)
+++ Makefile.in	(working copy)
@@ -53850,7 +53850,7 @@  compare:
         sed=`echo stage3 | sed 's,^stage,,;s,.,.,g'`; \
 	files=`find stage3-* -name "*$(objext)" -print | \
 		 sed -n s,^stage$$sed-,,p`; \
-	for file in $${files}; do \
+	for file in $${files} ${extra-compare}; do \
 	  f1=$$r/stage2-$$file; f2=$$r/stage3-$$file; \
 	  if test ! -f $$f1; then continue; fi; \
 	  $(do-compare) > /dev/null 2>&1; \
@@ -54248,7 +54248,7 @@  compare3:
         sed=`echo stage4 | sed 's,^stage,,;s,.,.,g'`; \
 	files=`find stage4-* -name "*$(objext)" -print | \
 		 sed -n s,^stage$$sed-,,p`; \
-	for file in $${files}; do \
+	for file in $${files} ${extra-compare}; do \
 	  f1=$$r/stage3-$$file; f2=$$r/stage4-$$file; \
 	  if test ! -f $$f1; then continue; fi; \
 	  $(do-compare3) > /dev/null 2>&1; \
Index: Makefile.tpl
===================================================================
--- Makefile.tpl	(revision 267551)
+++ Makefile.tpl	(working copy)
@@ -1675,7 +1675,7 @@  do-clean: clean-stage[+id+]
         sed=`echo stage[+id+] | sed 's,^stage,,;s,.,.,g'`; \
 	files=`find stage[+id+]-* -name "*$(objext)" -print | \
 		 sed -n s,^stage$$sed-,,p`; \
-	for file in $${files}; do \
+	for file in $${files} ${extra-compare}; do \
 	  f1=$$r/stage[+prev+]-$$file; f2=$$r/stage[+id+]-$$file; \
 	  if test ! -f $$f1; then continue; fi; \
 	  $(do-[+compare-target+]) > /dev/null 2>&1; \
Index: config/bootstrap-lto.mk
===================================================================
--- config/bootstrap-lto.mk	(revision 267551)
+++ config/bootstrap-lto.mk	(working copy)
@@ -15,3 +15,4 @@  LTO_EXPORTS = AR="$(LTO_AR)"; export AR;
 LTO_FLAGS_TO_PASS = AR="$(LTO_AR)" RANLIB="$(LTO_RANLIB)"
 
 do-compare = $(SHELL) $(srcdir)/contrib/compare-lto $$f1 $$f2
+extra-compare = gcc/lto1$(exeext)