https://gcc.gnu.org/bugzilla/show_bug.cgi?id=124936
Bug ID: 124936
Summary: Misleading message “<file> differs” when bootstrap
failed with LTO
Product: gcc
Version: 15.2.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: bootstrap
Assignee: unassigned at gcc dot gnu.org
Reporter: me at manueljacob dot de
CC: sjames at gcc dot gnu.org
Target Milestone: ---
When building the Arch Linux GCC package (which builds the GCC 15 branch and
uses LTO), stage 2 and 3 compared different during bootstrap. I tried to reduce
the problem with help by Sam James, but when I saw that bootstrapping worked
fine when building a second time, I gave up. However, I’m not reporting the
original problem here, but the error message.
I saw the following error message:
Comparing stages 2 and 3
Bootstrap comparison failure!
gcc/insn-recog-4.o differs
I searched for the mentioned file and found stage{1,2,3}-gcc/insn-recog-4.o.
Comparing stage2-gcc/insn-recog-4.o and stage3-gcc/insn-recog-4.o showed a few
differences, mostly in LTO sections. It also showed that
stage2-gcc/insn-recog-4.o contains string '-fno-checking' while
stage3-gcc/insn-recog-4.o contains '-fchecking=1'. This is to be expected for
LTO builds. Therefore, the comparison is actually done with the compare-lto
script that strips some things before comparison. The error message is
misleading because it suggests that gcc/insn-recog-4.o should be the same
between stage 2 and stage 3, while actually the files minus some sections
should be the same.
I’m not sure about what the best wording should be, but something like
“comparing gcc/insn-recog-4.o with compare-lto found differences” would have
helped in my case.