Opened 10 years ago
Closed 10 years ago
#3672 closed defect (worksforme)
gcc-4.9.1 makes buggy grub (waiting for confimation)
Reported by: | ruslan | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 7.7 |
Component: | Book | Version: | SVN |
Severity: | normal | Keywords: | |
Cc: |
Description
When building grub-2.00 with its default CFLAGS I got buggy grub.
During setup(hd0) it was always "Error 6: Mismatched or corrupt version of stage1/stage 2"
Then I rebuilt grub with CFLAGS="-O1" and error dissapeared, setup(hd0) was successful.
I tested it on x86 laptop and in virtualbox in both cases it was the same behavior.
Looks that some optimization in gcc does not work well with grub.
Change History (7)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
I cannot confirm this. My i686 7.6 system has a shared /boot, and I do not recall when I last reinstalled grub before today. So, after backing up, I rebuilt grub, noting that its default CFLAGS are -Os. Installed it, which updated all of /boot/grub/i386-pc/*, reboted. No problem. I then reran grub-install sda and again rebooted. Still no problem.
For anybody else testing this, on a desktop add --disable-grub-mkfont (it looks for an old header, I think from freetype).
What I am not sure of is where that setup(hd0) message is shown - is it during grub-install, or during the boot ?
comment:3 by , 10 years ago
Have you reported this to the grub maintainers? There is a grub-2.02 beta that's been out for several months. You might want to ask the maintainers about this issue at: https://lists.gnu.org/mailman/listinfo/grub-devel
Looking at the grub source. I could find no reference to the error message you report. I also could not find any reference to a command "setup", although there is a binary grub-bios-setup.
[ /sources/grub-2.00 ]$ grep -r -i mismatched * build-aux/texinfo.tex: % as its first line, TeX doesn't complain about mismatched braces docs/texinfo.tex: % as its first line, TeX doesn't complain about mismatched braces grub-core/kern/dl.c: grub_error (GRUB_ERR_BAD_MODULE, "mismatched names");
Doesn't match your message at all.
This message reminds me of grub legacy. Grub2 does not use the stage1/stage2 terminology to my knowledge.
comment:4 by , 10 years ago
Sorry, confused versions of grub, since I was trying both - 2.00 and 0.97. 2.00 did not work, it could not boot saying "partition hd(0,msdos1) not found" and showing his rescue shell.
Then I tried 0.97 and it did not work too. Setup(hd0) command is from grub-0.97.
But they both started working when I changed optimization flag to -O1.
comment:5 by , 10 years ago
Summary: | gcc-4.9.1 makes buggy grub → gcc-4.9.1 makes buggy grub (waiting for confimation) |
---|
We need to wait for at least one other person to confirm the problem.
When building grub-2.00 with its default CFLAGS I got buggy grub.