http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
Ryan Hill <dirtyepic at gentoo dot org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |dirtyepic at gentoo dot org
--- Comment #24 from Ryan Hill <dirtyepic at gentoo dot org> 2011-03-26
07:31:02 UTC ---
I'm seeing this exact behaviour with 4.6 (r171422) with grub-0.97.
Unfortunately again there is no self-contained test case.
It appears "stage2" is being miscompiled. At least, if I copy that file from a
4.5 build everything works.
This is how I can reproduce it:
- build grub-0.97. The object files are built like
gcc -m32 -DHAVE_CONFIG_H -I. -I.. -I../stage1 -Wall -Wmissing-prototypes
-Wunused -Wshadow -Wpointer-arith -falign-jumps=1 -falign-loops=1
-falign-functions=1 -Wundef -Os -fno-stack-protector -fno-builtin -nostdinc
-DSUPPORT_SERIAL=1 -DSUPPORT_HERCULES=1 -DSUPPORT_GRAPHICS=1 -DFSYS_EXT2FS=1
-DFSYS_FAT=1 -DFSYS_FFS=1 -DFSYS_UFS2=1 -DFSYS_MINIX=1 -DFSYS_REISERFS=1
-DFSYS_VSTAFS=1 -DFSYS_JFS=1 -DFSYS_XFS=1 -DFSYS_ISO9660=1
-DUSE_MD5_PASSWORDS=1 -g -MT pre_stage2_exec-stage2.o -MD -MP -MF
.deps/pre_stage2_exec-stage2.Tpo -c -o pre_stage2_exec-stage2.o `test -f
'stage2.c' || echo './'`stage2.c
- after installation, run `grub-install /dev/sda`
# grub-install /dev/sda
GNU GRUB version 0.97 (640K lower / 9216K upper memory)
[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ]
grub> root (hd0,0)
Filesystem type is ext2fs, partition type 0x83
grub> setup --stage2=/boot/grub/stage2 --prefix=/grub (hd0)
Checking if "/grub/stage1" exists... yes
Checking if "/grub/stage2" exists... yes
Checking if "/grub/e2fs_stage1_5" exists... yes
Running "embed /grub/e2fs_stage1_5 (hd0)"... 24 sectors are embedded.
succeeded
Running "install --stage2=/boot/grub/stage2 /grub/stage1 (hd0) (hd0)1+24 p
(hd0,0)/grub/stage2 /grub/menu.lst"... failed
Error 6: Mismatched or corrupt version of stage1/stage2
grub> quit
-fno-inline-small-functions works
-fno-inline-small-functions -finline-functions works
-fno-guess-branch-probability works
-fno-ipa-profile works
-fno-strict-aliasing works with -Os but not -O2
I understand this is impossible to debug. I'm just hoping it might spin some
wheels. Grub isn't something we like to miscompile. ;) Let me know what other
info/files would be useful.