Bug 218164

Summary: lang/gcc5: Bootstrap comparison failure
Product: Ports & Packages Reporter: Michał "phoe" Herda <phoe>
Component: Individual Port(s)Assignee: freebsd-toolchain mailing list <toolchain>
Status: New ---    
Severity: Affects Only Me CC: sparc64
Priority: ---    
Version: Latest   
Hardware: sparc64   
OS: Any   

Description Michał "phoe" Herda 2017-03-27 15:30:19 UTC
I am attempting to compile gcc5 on FreeBSD 11.0-RELEASE-p2 on sparc64. 
The compilation fails during bootstrap comparison.

I attempted to compile gcc5 with the default system compiler (gcc 4.2.1) as well as with gcc47 (which built normally); both give the same error.

...
...
Comparing stages 2 and 3
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1obj-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
Bootstrap comparison failure!
gcc/fortran/simplify.o differs
gcc/cfgexpand.o differs
gcc/haifa-sched.o differs
gcc/sched-rgn.o differs
gcc/tree-ssa-dce.o differs
gcc/tree-ssa-loop-niter.o differs
gcc/tree-ssa-sccvn.o differs
libcpp/macro.o differs
libdecnumber/decimal128.o differs
libiberty/pic/sha1.o differs
sparc64-portbld-freebsd11.0/libgcc/_divdi3.o differs
sparc64-portbld-freebsd11.0/libstdc++-v3/src/c++11/sstream-inst.o differs
gmake[4]: *** [Makefile:19638: compare] Error 1
gmake[4]: Leaving directory '/usr/ports/lang/gcc5/work/.build'
gmake[3]: *** [Makefile:19618: stage3-bubble] Error 2
gmake[3]: Leaving directory '/usr/ports/lang/gcc5/work/.build'
gmake[2]: *** [Makefile:19692: bootstrap-lean] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/gcc5/work/.build'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/gcc5
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/gcc5
Comment 1 Michał "phoe" Herda 2017-03-27 18:28:41 UTC
Same thing with gcc48:

...
...
Comparing stages 2 and 3
warning: gcc/cc1obj-checksum.o differs
warning: gcc/cc1-checksum.o differs
warning: gcc/cc1plus-checksum.o differs
Bootstrap comparison failure!
gcc/omp-low.o differs
libcpp/line-map.o differs
libiberty/pic/regex.o differs
libiberty/md5.o differs
libiberty/cp-demangle.o differs
sparc64-portbld-freebsd11.0/libgcc/_floatundidf_s.o differs
sparc64-portbld-freebsd11.0/libstdc++-v3/src/c++98/bitmap_allocator.o differs
gmake[4]: *** [Makefile:18939: compare] Error 1
gmake[4]: Leaving directory '/usr/ports/lang/gcc48/work/.build'
gmake[3]: *** [Makefile:18919: stage3-bubble] Error 2
gmake[3]: Leaving directory '/usr/ports/lang/gcc48/work/.build'
gmake[2]: *** [Makefile:18993: bootstrap-lean] Error 2
gmake[2]: Leaving directory '/usr/ports/lang/gcc48/work/.build'
===> Compilation failed unexpectedly.
Try to set MAKE_JOBS_UNSAFE=yes and rebuild before reporting the failure to
the maintainer.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/lang/gcc48
*** Error code 1

Stop.
make: stopped in /usr/ports/lang/gcc48
Comment 2 Michał "phoe" Herda 2017-03-27 20:16:13 UTC
I can build both gcc5 and gcc48 as long as I do not select bootstrapping in config.
Comment 3 Gerald Pfeifer freebsd_committer 2017-04-01 14:26:34 UTC
(In reply to Michał "phoe" Herda from comment #2)
> I can build both gcc5 and gcc48 as long as I do not select bootstrapping 
> in config.

If anything, it's actually supposed to be the other way around,
boostrapping should be the safer option.

The error you see is GCC compiling itself repeatedly does not lead
to a consistent result as it should.

Clearly this does not happen for other SPARC targets of GCC, and I'm
afraid I won't be able to help with this.

(Luckily there is at least a workaround of disabling bootstrap, which
is the default for lang/gcc.)