]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/2.6.27.27/don-t-use-fwrapv-compiler-option-it-s-buggy-in-gcc-4.1.x.patch
Fixes for 4.19
[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
1 From a137802ee839ace40079bebde24cfb416f73208a Mon Sep 17 00:00:00 2001
2 From: Linus Torvalds <torvalds@linux-foundation.org>
3 Date: Sun, 12 Jul 2009 11:25:04 -0700
4 Subject: Don't use '-fwrapv' compiler option: it's buggy in gcc-4.1.x
5
6 From: Linus Torvalds <torvalds@linux-foundation.org>
7
8 commit a137802ee839ace40079bebde24cfb416f73208a upstream.
9
10 This causes kernel images that don't run init to completion with certain
11 broken gcc versions.
12
13 This fixes kernel bugzilla entry:
14 http://bugzilla.kernel.org/show_bug.cgi?id=13012
15
16 I suspect the gcc problem is this:
17 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28230
18
19 Fix the problem by using the -fno-strict-overflow flag instead, which
20 not only does not exist in the known-to-be-broken versions of gcc (it
21 was introduced later than fwrapv), but seems to be much less disturbing
22 to gcc too: the difference in the generated code by -fno-strict-overflow
23 are smaller (compared to using neither flag) than when using -fwrapv.
24
25 Reported-by: Barry K. Nathan <barryn@pobox.com>
26 Pushed-by: Frans Pop <elendil@planet.nl>
27 Cc: Andrew Morton <akpm@linux-foundation.org>
28 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
29 Signed-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