tech-toolchain archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: gcc 16 bootstrap, stage 2 and 3 differ



On Mon, Aug 17, 2026 at 01:42:45PM +0100, RVP wrote:
> On Mon, 17 Aug 2026, Thomas Klausner wrote:
> 
> > If you don't see the difference (I didn't), its:
> > 
> > -fno-checking
> > 
> > vs.
> > 
> > -fchecking=1
> > 
> > all the rest is the same.
> > 
> 
> That's fine, I should think. It's how the Makefile defines it:
> 
> ```
>     619 STAGE1_TFLAGS += -fno-checking
>     620 STAGE2_CFLAGS += -fno-checking
>     621 STAGE2_TFLAGS += -fno-checking
>     622 STAGE3_CFLAGS += -fchecking=1
>     623 STAGE3_TFLAGS += -fchecking=1
> ```
> 
> > vs. in the build log:
> > 
> > gmake[3]: Leaving directory '/tmp/lang/gcc16/work/build'
> > Comparing stages 2 and 3
> > warning: gcc/cobol/parse.o differs
> > Bootstrap comparison failure!
> > gcc/build/genoutput.o differs
> > gcc/build/gensupport.o differs
> > gcc/build/genrecog.o differs
> > gcc/build/genmatch.o differs
> > gcc/c/gimple-parser.o differs
> > gcc/c/c-typeck.o differs
> > gcc/c/c-parser.o differs
> > gcc/c/c-decl.o differs
> > gcc/cobol/except.o differs
> > ...
> > 
> > Looking at the toplevel Makefile, the comparison uses
> > 
> > do-compare = cmp $$f1 $$f2 16 16
> > 
> > which is kind of expected since the configure script sets it to
> > 
> > do_compare="$gcc_cv_prog_cmp_skip"
> > 
> 
> `do-compare' is overridden later on in the Makefile when gcc is being built:
> 
> ```
>    1045 BUILD_CONFIG = bootstrap-debug
>    1046 ifneq ($(BUILD_CONFIG),)
>    1047 include $(foreach CONFIG, $(BUILD_CONFIG), $(srcdir)/config/$(CONFIG).mk)
>    1048 endif ```
> 
> and in `config/bootstrap-debug.mk' we have:
> 
> ```
> STAGE2_CFLAGS += -gtoggle
> do-compare = $(SHELL) $(srcdir)/contrib/compare-debug $$f1 $$f2
> ```
> 
> Can you fiddle with the Makefile to show what `do-compare' is at that point?
> 
> ```
>   29332 compare:
>   [...]
>   29348           $(do-compare) > /dev/null 2>&1; \
> ```

do-compare uses cmp:

...
cmp /tmp/lang/gcc16/work/build/stage2-gcc/xml.o /tmp/lang/gcc16/work/build/stage3-gcc/xml.o 16 16
...
gcc/xml.o differs

using this diff:

--- work/build/Makefile.orig    2026-09-16 09:08:05.259244314 +0000
+++ work/build/Makefile
@@ -29633,6 +29633,7 @@ compare:
        for file in $${files} ${extra-compare}; do \
          f1=$$r/stage2-$$file; f2=$$r/stage3-$$file; \
          if test ! -f $$f1; then continue; fi; \
+         echo $(do-compare) ; \
          $(do-compare) > /dev/null 2>&1; \
          if test $$? -eq 1; then \
            case $$file in \
@@ -29861,6 +29862,7 @@ compare3:
        for file in $${files} ${extra-compare}; do \
          f1=$$r/stage3-$$file; f2=$$r/stage4-$$file; \
          if test ! -f $$f1; then continue; fi; \
+         echo $(do-compare3) ; \
          $(do-compare3) > /dev/null 2>&1; \
          if test $$? -eq 1; then \
            case $$file in \


 Thomas


Home | Main Index | Thread Index | Old Index