For obj-c stage-final re-use the checksum from the previous stage
authorBernd Edlinger <bernd.edlinger@hotmail.de>
Fri, 28 May 2021 04:54:13 +0000 (06:54 +0200)
committerBernd Edlinger <bernd.edlinger@hotmail.de>
Mon, 7 Jun 2021 11:47:12 +0000 (13:47 +0200)
This silences the stage compare.

gcc/objc:
2021-06-07  Bernd Edlinger  <bernd.edlinger@softing.com>

* Make-lang.in (cc1obj-checksum.c): For stage-final re-use
the checksum from the previous stage.

gcc/objcp:
2021-06-07  Bernd Edlinger  <bernd.edlinger@softing.com>

* Make-lang.in (cc1objplus-checksum.c): For stage-final re-use
the checksum from the previous stage.

gcc/objc/Make-lang.in
gcc/objcp/Make-lang.in

index c91148a..9011140 100644 (file)
@@ -57,11 +57,19 @@ OBJC_OBJS = objc/objc-lang.o objc/objc-act.o hash-table.o \
 
 objc_OBJS = $(OBJC_OBJS) cc1obj-checksum.o
 
+# compute checksum over all object files and the options
+# re-use the checksum from the prev-final stage so it passes
+# the bootstrap comparison and allows comparing of the cc1 binary
 cc1obj-checksum.c : build/genchecksum$(build_exeext) checksum-options \
         $(OBJC_OBJS) $(C_AND_OBJC_OBJS) $(BACKEND) $(LIBDEPS)
-       build/genchecksum$(build_exeext) $(OBJC_OBJS) $(C_AND_OBJC_OBJS) \
-        $(BACKEND) $(LIBDEPS) checksum-options > cc1obj-checksum.c.tmp && \
-       $(srcdir)/../move-if-change cc1obj-checksum.c.tmp cc1obj-checksum.c
+       if [ -f ../stage_final ] \
+          && cmp -s ../stage_current ../stage_final; then \
+         cp ../prev-gcc/$@ $@; \
+       else \
+         build/genchecksum$(build_exeext) $(OBJC_OBJS) $(C_AND_OBJC_OBJS) \
+               $(BACKEND) $(LIBDEPS) checksum-options > $@.tmp && \
+         $(srcdir)/../move-if-change $@.tmp $@; \
+       fi
 
 cc1obj$(exeext): $(OBJC_OBJS) $(C_AND_OBJC_OBJS) cc1obj-checksum.o $(BACKEND) \
                 $(LIBDEPS) $(objc.prev)
index dfa4d23..3ecc50b 100644 (file)
@@ -60,12 +60,19 @@ OBJCXX_OBJS = objcp/objcp-act.o objcp/objcp-lang.o objcp/objcp-decl.o \
 
 obj-c++_OBJS = $(OBJCXX_OBJS) cc1objplus-checksum.o
 
+# compute checksum over all object files and the options
+# re-use the checksum from the prev-final stage so it passes
+# the bootstrap comparison and allows comparing of the cc1 binary
 cc1objplus-checksum.c : build/genchecksum$(build_exeext) checksum-options \
        $(OBJCXX_OBJS) $(BACKEND) $(CODYLIB) $(LIBDEPS)
-       build/genchecksum$(build_exeext) $(OBJCXX_OBJS) $(BACKEND) $(CODYLIB) \
-               $(LIBDEPS) checksum-options > cc1objplus-checksum.c.tmp && \
-       $(srcdir)/../move-if-change cc1objplus-checksum.c.tmp \
-       cc1objplus-checksum.c
+       if [ -f ../stage_final ] \
+          && cmp -s ../stage_current ../stage_final; then \
+         cp ../prev-gcc/$@ $@; \
+       else \
+         build/genchecksum$(build_exeext) $(OBJCXX_OBJS) $(BACKEND) \
+               $(CODYLIB) $(LIBDEPS) checksum-options > $@.tmp && \
+         $(srcdir)/../move-if-change $@.tmp $@; \
+       fi
 
 cc1objplus$(exeext): $(OBJCXX_OBJS) cc1objplus-checksum.o $(BACKEND) \
                     $(CODYLIB) $(LIBDEPS) $(obj-c++.prev)