Patchwork [1/3] grub: add -fno-reorder-functions into STAGE2_COMPILE

login
register
mail settings
Submitter Dexuan Cui
Date June 29, 2011, 1:09 p.m.
Message ID <c572d4f39bc61df11a8e5a344b88c7b3fe8e476f.1309352791.git.dexuan.cui@intel.com>
Download mbox | patch
Permalink /patch/6681/
State New, archived
Headers show

Comments

Dexuan Cui - June 29, 2011, 1:09 p.m.
This is used to work around a gcc-4.6's bug about the option.

[YOCTO #1099]

Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
---
 .../grub/grub-0.97/no-reorder-functions.patch      |   31 ++++++++++++++++++++
 meta/recipes-bsp/grub/grub_0.97.bb                 |    5 ++-
 2 files changed, 34 insertions(+), 2 deletions(-)
 create mode 100644 meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
Dexuan Cui - June 29, 2011, 1:17 p.m.
Cui, Dexuan wrote:
> This is used to work around a gcc-4.6's bug about the option.
> 
> [YOCTO #1099]
> 
> diff --git a/meta/recipes-bsp/grub/grub_0.97.bb
> b/meta/recipes-bsp/grub/grub_0.97.bb 
> index 131d942..ffacb61 100644
> --- a/meta/recipes-bsp/grub/grub_0.97.bb
> +++ b/meta/recipes-bsp/grub/grub_0.97.bb
>  RDEPENDS_${PN} = "diffutils"
> -PR = "r3"
> +PR = "r6"
Sorry, PR should be "r4" here... I used "r6" in my debugging.
I forgot to clean this up when I sent the patch.

I've re-pushed my branch.
Please use the new commit:
http://git.pokylinux.org/cgit.cgi/poky-contrib/commit/?h=dcui/master&id=5c670ef29d828e76ae101fcfe9234732af759dfa

Thanks,
-- Dexuan
Phil Blundell - June 29, 2011, 1:20 p.m.
On Wed, 2011-06-29 at 21:09 +0800, Dexuan Cui wrote:
> +This turned out to be a gcc's bug. See
> +https://bugs.gentoo.org/show_bug.cgi?id=360513
> +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
> +
> +Upstream gcc seems uninterested in the bug, so at present we can disable the
> +option as a workaround. Thanks Ryan Hill for the investigation and the
> +workaround patch.

I'm not sure it's fair to say that upstream gcc is uninterested.  It
doesn't appear that anybody has been willing or able to produce a
testcase which will allow the gcc people to debug the problem. 

p.
Richard Purdie - June 29, 2011, 2:04 p.m.
On Wed, 2011-06-29 at 14:20 +0100, Phil Blundell wrote:
> On Wed, 2011-06-29 at 21:09 +0800, Dexuan Cui wrote:
> > +This turned out to be a gcc's bug. See
> > +https://bugs.gentoo.org/show_bug.cgi?id=360513
> > +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
> > +
> > +Upstream gcc seems uninterested in the bug, so at present we can disable the
> > +option as a workaround. Thanks Ryan Hill for the investigation and the
> > +workaround patch.
> 
> I'm not sure it's fair to say that upstream gcc is uninterested.  It
> doesn't appear that anybody has been willing or able to produce a
> testcase which will allow the gcc people to debug the problem. 

Agreed, it would be good if the gcc people could get a testcase to fix
the problem. In the meantime I will take the workaround though.

Cheers,

RIchard

Patch

diff --git a/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch b/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
new file mode 100644
index 0000000..70037e4
--- /dev/null
+++ b/meta/recipes-bsp/grub/grub-0.97/no-reorder-functions.patch
@@ -0,0 +1,31 @@ 
+Upstream-Status: Inappropriate [disable feature]
+
+After the commit "tcmode-default: switch to gcc 4.6.0 for x86, x86-64 & arm",
+we got bug 1099 (http://bugzilla.yoctoproject.org/show_bug.cgi?id=1099):
+
+Running "install --stage2=/ssd/boot/grub/stage2 /boot/grub/stage1(hd0)
+     /boot/grub/stage2 p /boot/grub/menu list" failed
+Error 6: Mismatched or corrupt version of stage1/stage2
+
+This turned out to be a gcc's bug. See
+https://bugs.gentoo.org/show_bug.cgi?id=360513
+http://gcc.gnu.org/bugzilla/show_bug.cgi?id=39333
+
+Upstream gcc seems uninterested in the bug, so at present we can disable the
+option as a workaround. Thanks Ryan Hill for the investigation and the
+workaround patch.
+
+Dexuan Cui <dexuan.cui@intel.com>
+Wed Jun 29 20:21:39 CST 2011
+
+--- grub-0.97/stage2/Makefile.am.orig
++++ grub-0.97/stage2/Makefile.am
+@@ -79,7 +79,7 @@
+ HERCULES_FLAGS =
+ endif
+ 
+-STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-builtin -nostdinc \
++STAGE2_COMPILE = $(STAGE2_CFLAGS) -fno-reorder-functions -fno-builtin -nostdinc \
+ 	$(NETBOOT_FLAGS) $(SERIAL_FLAGS) $(HERCULES_FLAGS)
+ 
+ STAGE1_5_LINK = -nostdlib -Wl,-N -Wl,-Ttext -Wl,2000
diff --git a/meta/recipes-bsp/grub/grub_0.97.bb b/meta/recipes-bsp/grub/grub_0.97.bb
index 131d942..ffacb61 100644
--- a/meta/recipes-bsp/grub/grub_0.97.bb
+++ b/meta/recipes-bsp/grub/grub_0.97.bb
@@ -11,10 +11,11 @@  LIC_FILES_CHKSUM = "file://COPYING;md5=c93c0550bd3173f4504b2cbd8991e50b \
                     file://grub/main.c;beginline=3;endline=9;md5=22a5f28d2130fff9f2a17ed54be90ed6"
 
 RDEPENDS_${PN} = "diffutils"
-PR = "r3"
+PR = "r6"
 
 SRC_URI = "ftp://alpha.gnu.org/gnu/grub/grub-${PV}.tar.gz; \
-	   file://autohell.patch;apply=yes "
+            file://no-reorder-functions.patch \
+            file://autohell.patch "
 
 SRC_URI[md5sum] = "cd3f3eb54446be6003156158d51f4884"
 SRC_URI[sha256sum] = "4e1d15d12dbd3e9208111d6b806ad5a9857ca8850c47877d36575b904559260b"