Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 95155 - GCC 3.4.4 build fails with "Bootstrap comparison failure!" on hardened x86
Summary: GCC 3.4.4 build fails with "Bootstrap comparison failure!" on hardened x86
Status: RESOLVED WONTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: The Gentoo Linux Hardened Team
URL:
Whiteboard:
Keywords:
: 95348 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-06-05 14:57 UTC by Karl-Johan Karlsson
Modified: 2006-01-30 16:43 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Error log attempting to compile gcc-3.4.4 (gcc-3.4.4-error-log.txt,18.92 KB, text/plain)
2005-06-05 15:20 UTC, Mike Auty (RETIRED)
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Karl-Johan Karlsson 2005-06-05 14:57:39 UTC
Trying to upgrade to GCC 3.4.4 from 3.4.3-20050110 fails with the message 
"Bootstrap comparison failure!" on three different hardened x86 boxes (one 
Pentium MMX, two K6 3D). It works on a non-hardened AMD64, but I have no non-
hardened x86:s to test on at the moment.

Error (and emerge --info) output below is from the Pentium box, with minimal 
CFLAGS. Output on the K6:s is similar, except no error are reported for ./c-
errors.o, ./g77spec.o, ./main.o and f/*.

echo timestamp > stage3_build
echo stage3_build > stage_last

Bootstrap complete - make "quickstrap" to redo last build,
or "cleanstrap" to redo the bootstrap from scratch.
make[1]: Leaving directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc'
Comparing stage2 and stage3 of the compiler
make[1]: Entering directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc'
rm -f .bad_compare
case "gnucompare-lean" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo 
gnucompare-lean | s
ed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
for dir in . cp f; do \
  if [ "`echo $dir/*.o`" != "$dir/*.o" ] ; then \
    for file in $dir/*.o; do \
      case "gnucompare-lean" in \
        slowcompare* ) \
          tail +16c ./$file > tmp-foo1; \
          tail +16c stage$stage/$file > tmp-foo2 \
            && (cmp tmp-foo1 tmp-foo2 > /dev/null 2>&1 || echo $file differs >>
 .bad_compare) || tr
ue; \
          ;; \
        fastcompare* ) \
          cmp $file stage$stage/$file 16 16 > /dev/null 2>&1; \
          test $? -eq 1 && echo $file differs >> .bad_compare || true; \
          ;; \
        gnucompare* ) \
          cmp --ignore-initial=16 $file stage$stage/$file > /dev/null 2>&1; \
          test $? -eq 1 && echo $file differs >> .bad_compare || true; \
          ;; \
      esac ; \
    done; \
  else true; fi; \
done
rm -f tmp-foo*
case "gnucompare-lean" in *compare | *compare-lean ) stage=2 ;; * ) stage=`echo 
gnucompare-lean | s
ed -e 's,^[a-z]*compare\([0-9][0-9]*\).*,\1,'` ;; esac; \
if [ -f .bad_compare ]; then \
  echo "Bootstrap comparison failure!"; \
  cat .bad_compare; \
  exit 1; \
else \
  case "gnucompare-lean" in \
    *-lean ) rm -rf stage$stage ;; \
    *) ;; \
  esac; true; \
fi
Bootstrap comparison failure!
./alias.o differs
./alloc-pool.o differs
./attribs.o differs
./bb-reorder.o differs
./bitmap.o differs
./bt-load.o differs
./builtins.o differs
./c-aux-info.o differs
./c-common.o differs
./c-convert.o differs
./c-cppbuiltin.o differs
./c-decl.o differs
./c-dump.o differs
./c-errors.o differs
./c-format.o differs
./c-incpath.o differs
./c-lang.o differs
./c-lex.o differs
./c-objc-common.o differs
./c-opts.o differs
./c-parse.o differs
./c-pch.o differs
./c-ppoutput.o differs
./c-pragma.o differs
./c-pretty-print.o differs
./c-semantics.o differs
./c-typeck.o differs
./caller-save.o differs
./calls.o differs
./cfg.o differs
./cfganal.o differs
./cfgbuild.o differs
./cfgcleanup.o differs
./cfglayout.o differs
./cfgloop.o differs
./cfgloopanal.o differs
./cfgloopmanip.o differs
./cfgrtl.o differs
./cgraph.o differs
./cgraphunit.o differs
./collect2.o differs
./combine.o differs
./conflict.o differs
./convert.o differs
./coverage.o differs
./cppcharset.o differs
./cpperror.o differs
./cppexp.o differs
./cppfiles.o differs
./cpphash.o differs
./cppinit.o differs
./cpplex.o differs
./cpplib.o differs
./cppmacro.o differs
./cpppch.o differs
./cppspec.o differs
./cpptrad.o differs
./crtbeginT.o differs
./cse.o differs
./cselib.o differs
./dbxout.o differs
./debug.o differs
./df.o differs
./diagnostic.o differs
./dojump.o differs
./doloop.o differs
./dominance.o differs
./dwarf2asm.o differs
./dwarf2out.o differs
./emit-rtl.o differs
./errors.o differs
./et-forest.o differs
./except.o differs
./explow.o differs
./expmed.o differs
./expr.o differs
./final.o differs
./flow.o differs
./fold-const.o differs
./function.o differs
./g++spec.o differs
./g77spec.o differs
./gcc.o differs
./gccspec.o differs
./gcov-dump.o differs
./gcov-iov.o differs
./gcov.o differs
./gcse.o differs
./genattr.o differs
./genattrtab.o differs
./genautomata.o differs
./gencheck.o differs
./gencodes.o differs
./genconditions.o differs
./genconfig.o differs
./genconstants.o differs
./genemit.o differs
./genextract.o differs
./genflags.o differs
./gengenrtl.o differs
./gengtype-lex.o differs
./gengtype-yacc.o differs
./gengtype.o differs
./genmodes.o differs
./genopinit.o differs
./genoutput.o differs
./genpeep.o differs
./genpreds.o differs
./genrecog.o differs
./genrtl.o differs
./gensupport.o differs
./ggc-common.o differs
./ggc-page.o differs
./global.o differs
./graph.o differs
./gtype-desc.o differs
./haifa-sched.o differs
./hashtable.o differs
./hooks.o differs
./i386.o differs
./ifcvt.o differs
./insn-attrtab.o differs
./insn-emit.o differs
./insn-extract.o differs
./insn-modes.o differs
./insn-opinit.o differs
./insn-output.o differs
./insn-recog.o differs
./integrate.o differs
./intl.o differs
./jump.o differs
./langhooks.o differs
./lcm.o differs
./line-map.o differs
./lists.o differs
./local-alloc.o differs
./loop-init.o differs
./loop-unroll.o differs
./loop-unswitch.o differs
./loop.o differs
./main.o differs
./mkdeps.o differs
./optabs.o differs
./opts.o differs
./params.o differs
./postreload.o differs
./predict.o differs
./prefix.o differs
./pretty-print.o differs
./print-rtl.o differs
./print-rtl1.o differs
./print-tree.o differs
./profile.o differs
./protector.o differs
./ra-build.o differs
./ra-colorize.o differs
./ra-debug.o differs
./ra-rewrite.o differs
./ra.o differs
./read-rtl.o differs
./real.o differs
./recog.o differs
./reg-stack.o differs
./regclass.o differs
./regmove.o differs
./regrename.o differs
./reload.o differs
./reload1.o differs
./resource.o differs
./rtl-error.o differs
./rtl.o differs
./rtlanal.o differs
./sbitmap.o differs
./sched-deps.o differs
./sched-ebb.o differs
./sched-rgn.o differs
./sched-vis.o differs
./sibcall.o differs
./simplify-rtx.o differs
./sreal.o differs
./stmt.o differs
./stor-layout.o differs
./stringpool.o differs
./stub-objc.o differs
./targhooks.o differs
./timevar.o differs
./tlink.o differs
./toplev.o differs
./tracer.o differs
./tree-dump.o differs
./tree-inline.o differs
./tree-optimize.o differs
./tree.o differs
./unroll.o differs
./value-prof.o differs
./varasm.o differs
./varray.o differs
./web.o differs
cp/call.o differs
cp/class.o differs
cp/cp-lang.o differs
cp/cvt.o differs
cp/cxx-pretty-print.o differs
cp/decl.o differs
cp/decl2.o differs
cp/dump.o differs
cp/error.o differs
cp/except.o differs
cp/expr.o differs
cp/friend.o differs
cp/init.o differs
cp/lex.o differs
cp/mangle.o differs
cp/method.o differs
cp/name-lookup.o differs
cp/optimize.o differs
cp/parser.o differs
cp/pt.o differs
cp/ptree.o differs
cp/repo.o differs
cp/rtti.o differs
cp/search.o differs
cp/semantics.o differs
cp/tree.o differs
cp/typeck.o differs
cp/typeck2.o differs
f/bad.o differs
f/bit.o differs
f/bld.o differs
f/com.o differs
f/data.o differs
f/equiv.o differs
f/expr.o differs
f/fini.o differs
f/global.o differs
f/implic.o differs
f/info.o differs
f/intrin.o differs
f/lab.o differs
f/lex.o differs
f/malloc.o differs
f/name.o differs
f/parse.o differs
f/src.o differs
f/st.o differs
f/sta.o differs
f/stb.o differs
f/stc.o differs
f/std.o differs
f/ste.o differs
f/storag.o differs
f/str.o differs
f/sts.o differs
f/stt.o differs
f/stu.o differs
f/stw.o differs
f/symbol.o differs
f/target.o differs
f/top.o differs
f/type.o differs
f/where.o differs
make[1]: *** [gnucompare-lean] Error 1
make[1]: Leaving directory `/var/tmp/portage/gcc-3.4.4/work/build/gcc'
make: *** [bootstrap-lean] Error 2

Reproducible: Always
Steps to Reproduce:




Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.4.3-20050110, glibc-2.3.5-
r0, 2.6.11-hardened-r1 i586)
=================================================================
System uname: 2.6.11-hardened-r1 i586 Pentium MMX
Gentoo Base System version 1.6.12
dev-lang/python:     2.2.3-r5, 2.3.5
sys-apps/sandbox:    1.2.8
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.16-r1
sys-devel/libtool:   1.5.18
virtual/os-headers:  2.6.11-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i586-pc-linux-gnu"
CFLAGS="-march=pentium-mmx -O2 -pipe"
CHOST="i586-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config /usr/share/
config /usr/share/texmf/dvipdfm/config/ /usr/share/texmf/dvips/config/ /usr/
share/texmf/tex/generic/config/ /usr/share/texmf/tex/platex/config/ /usr/share/
texmf/xdvi/ /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-march=pentium-mmx -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig collision-protect distlocks sandbox sfperms strict userpriv 
usersandbox"
GENTOO_MIRRORS="http://trumpetti.atm.tut.fi/gentoo/ http://gentoo.oregonstate.
edu http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.europe.gentoo.org/gentoo-portage"
USE="x86 alsa bash-completion berkdb bitmap-fonts crypt curl emacs emboss 
fortran gdbm gtk2 hardened imap libg++ libwww maildir mmx mp3 ncurses nls nptl 
nptlonly pam perl python readline sasl sendfile slang spell ssl tcpd tetex 
truetype-fonts type1-fonts xml2 zlib userland_GNU kernel_linux elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS, PORTDIR_OVERLAY
Comment 1 Mike Auty (RETIRED) gentoo-dev 2005-06-05 15:19:35 UTC
I'm getting precisely the same on my AMD64 (but everything is built in 32-bit
mode).  It's ntplonly with hardened, pic and pie set.  The odd thing is I've got
two other hardened, pic, pie, nptlonly boxes, both of which compiled it a day or
two earlier fine.  I'm also now having troubles recompiling glibc, but I don't
know if that's related or not.  I've also provided my full error log, and an
emerge info.

Looking up common bootstrap failures, it's often suggested that this is a
hardware problem, however I ran memtest86 over my RAM, and it detected no
problems (I stopped it after 75% and 10 hours).  It also suggests that there is
some reason that the files get built differently between the two stages. 
Supposedly something non-deterministic is occuring, however this error message
is repeatable, every time.  I disabled ccache in case that was the problem, but
still it happens.

I'd be very happy to test out any patches, fixes or anything else that people
might want me to try (as long as they explain it).  Thanks...

Portage 2.0.51.22-r1 (default-linux/x86/2005.0, gcc-3.4.3-20050110,
glibc-2.3.5-r0, 2.6.12-rc5 i686)
=================================================================
System uname: 2.6.12-rc5 i686 AMD Athlon(tm) 64 Processor 3400+
Gentoo Base System version 1.6.12
ccache version 2.4 [disabled]
dev-lang/python:     2.3.5
sys-apps/sandbox:    1.2.8
sys-devel/autoconf:  2.13, 2.59-r6
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.5
sys-devel/binutils:  2.16-r1
sys-devel/libtool:   1.5.18
virtual/os-headers:  2.6.11-r1
ACCEPT_KEYWORDS="x86 ~x86"
AUTOCLEAN="yes"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/2/share/config /usr/kde/3/share/config
/usr/lib/X11/xkb /usr/lib/mozilla/defaults/pref /usr/share/config
/var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/terminfo /etc/env.d"
CXXFLAGS="-O2 -march=athlon-xp -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
FEATURES="autoconfig distlocks sandbox sfperms strict"
GENTOO_MIRRORS="http://distfiles.gentoo.org
http://distro.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/overlays/personal"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="x86 3dnow X aalib acl acpi adns alsa avi bash-completion berkdb
bitmap-fonts boundschecking cairo ccache cdr cjk client crypt cups djvu dlloader
dvd dvdr dvi eds emboss encode fam flac foomaticdb fortran gd gdbm gif glitz
gnome gnutls gstreamer gtk gtk2 gtkhtml hal hardened imagemagick imap imlib java
jpeg junit libg++ libwww mad mikmod mime mmx mmxext motif mozilla mozsvg mp3
mpeg ncurses nls nptl nptlonly nvidia ogg oggvorbis opengl pam pdflib perl pic
pie png postgres python quicktime readline real sdl server snmp spell sse sse2
ssl svg svga t1lib tcpd theora tiff truetype truetype-fonts type1-fonts unicode
vorbis win32codecs xine xml2 xrandr xv xvid zlib userland_GNU kernel_linux
elibc_glibc"
Unset:  ASFLAGS, CTARGET, LANG, LC_ALL, LDFLAGS, LINGUAS
Comment 2 Mike Auty (RETIRED) gentoo-dev 2005-06-05 15:20:30 UTC
Created attachment 60684 [details]
Error log attempting to compile gcc-3.4.4
Comment 3 Dinil Penne 2005-06-06 02:21:17 UTC
Having the same problem
Comment 4 César Fernández 2005-06-06 06:33:25 UTC
Same error here...
Comment 5 Robert Paskowitz (RETIRED) gentoo-dev 2005-06-22 22:02:14 UTC
*** Bug 95348 has been marked as a duplicate of this bug. ***
Comment 6 solar (RETIRED) gentoo-dev 2006-01-05 18:41:48 UTC
Is this bug still valid?
Comment 7 Mike Auty (RETIRED) gentoo-dev 2006-01-06 00:52:49 UTC
I'm no longer experiencing these problems.  I did at some point manage to build gcc-3.4.4 with the hardened USE flag set, although I'm now on to 3.4.5.  Hope this helps...
Comment 8 Karl-Johan Karlsson 2006-01-06 05:54:25 UTC
Works here too. I hade >=3.4.4 masked for a long time, but when I tried 3.4.5 it worked. I just tried pulling 3.4.4 from the CVS attic, and it built as well.
Comment 9 Kevin F. Quinn (RETIRED) gentoo-dev 2006-01-30 16:43:20 UTC
Marking WONTFIX as 3.4.3 is no longer in the tree, and either we haven't been able to reproduce the problem, or it has been fixed as a side-effect of something else, or is no longer relevant.

For anyone struggling to upgrade a compiler, I would suggest the best approach is to switch to a different compiler to bootstrap the new one.  Trying the vanilla version of the current compiler is a good choice, as is the most recent stable version if it's still installed.