summaryrefslogtreecommitdiffstats
path: root/patches/grub-0.97/0004-Work-around-a-miscompilation-of-stage2-with-GCC-4.6.patch
blob: 1bfa8de499ad7f948e7b44de595d91e8a18b446d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
From: Michael Olbrich <m.olbrich@pengutronix.de>
Date: Tue, 22 Nov 2011 15:01:33 +0100
Subject: [PATCH] Work around a miscompilation of stage2 with GCC 4.6.

This flag is not the cause of the miscompilation, but disabling it has the side-effect
of making it work at both -Os and -O2.

Vague upstream bug:
http://gcc.gnu.org/PR39333

https://bugs.gentoo.org/360513

Patch taken from Gentoo.

Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
---
 stage2/Makefile.am | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/stage2/Makefile.am b/stage2/Makefile.am
index f8e6d42..24b07e2 100644
--- a/stage2/Makefile.am
+++ b/stage2/Makefile.am
@@ -79,7 +79,7 @@ else
 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