]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/2.6.27.27/don-t-use-fwrapv-compiler-option-it-s-buggy-in-gcc-4.1.x.patch
drop drm patch
[thirdparty/kernel/stable-queue.git] / releases / 2.6.27.27 / don-t-use-fwrapv-compiler-option-it-s-buggy-in-gcc-4.1.x.patch
CommitLineData
056945a6
GKH
1From a137802ee839ace40079bebde24cfb416f73208a Mon Sep 17 00:00:00 2001
2From: Linus Torvalds <torvalds@linux-foundation.org>
3Date: Sun, 12 Jul 2009 11:25:04 -0700
4Subject: Don't use '-fwrapv' compiler option: it's buggy in gcc-4.1.x
5
6From: Linus Torvalds <torvalds@linux-foundation.org>
7
8commit a137802ee839ace40079bebde24cfb416f73208a upstream.
9
10This causes kernel images that don't run init to completion with certain
11broken gcc versions.
12
13This fixes kernel bugzilla entry:
14 http://bugzilla.kernel.org/show_bug.cgi?id=13012
15
16I suspect the gcc problem is this:
17 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28230
18
19Fix the problem by using the -fno-strict-overflow flag instead, which
20not only does not exist in the known-to-be-broken versions of gcc (it
21was introduced later than fwrapv), but seems to be much less disturbing
22to gcc too: the difference in the generated code by -fno-strict-overflow
23are smaller (compared to using neither flag) than when using -fwrapv.
24
25Reported-by: Barry K. Nathan <barryn@pobox.com>
26Pushed-by: Frans Pop <elendil@planet.nl>
27Cc: Andrew Morton <akpm@linux-foundation.org>
28Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
29Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
30
31---
32 Makefile | 2 +-
33 1 file changed, 1 insertion(+), 1 deletion(-)
34
35--- a/Makefile
36+++ b/Makefile
37@@ -557,7 +557,7 @@ KBUILD_CFLAGS += $(call cc-option,-Wdecl
38 KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
39
40 # disable invalid "can't wrap" optimzations for signed / pointers
41-KBUILD_CFLAGS += $(call cc-option,-fwrapv)
42+KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
43
44 # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
45 # But warn user when we do so