]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.25/patches.fixes/add-fwrapv-to-gcc-CFLAGS
Changed checkfs to auto reboot after correctable fsck fixes.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.25 / patches.fixes / add-fwrapv-to-gcc-CFLAGS
CommitLineData
00e5a55c
BS
1From: Linus Torvalds <torvalds@linux-foundation.org>
2Date: Thu, 19 Mar 2009 18:10:17 +0000 (-0700)
3Subject: Add '-fwrapv' to gcc CFLAGS
4Patch-mainline: 2.6.29
5Git-commit: 68df3755e383e6fecf2354a67b08f92f18536594
6References: bko#12597 bnc#487106
7
8Add '-fwrapv' to gcc CFLAGS
9
10This makes sure that gcc doesn't try to optimize away wrapping
11arithmetic, which the kernel occasionally uses for overflow testing, ie
12things like
13
14 if (ptr + offset < ptr)
15
16which technically is undefined for non-unsigned types. See
17
18 http://bugzilla.kernel.org/show_bug.cgi?id=12597
19
20for details.
21
22Not all versions of gcc support it, so we need to make it conditional
23(it looks like it was introduced in gcc-3.4).
24
25Reminded-by: Alan Cox <alan@lxorguk.ukuu.org.uk>
26Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
27Acked-by: Jeff Mahoney <jeffm@suse.com>
28---
29
30 Makefile | 1 +
31 1 file changed, 1 insertion(+)
32
33--- a/Makefile
34+++ b/Makefile
35@@ -341,6 +341,7 @@ KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXI
36 KBUILD_CFLAGS := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
37 -fno-strict-aliasing -fno-common \
38 -Werror-implicit-function-declaration
39+KBUILD_CFLAGS += $(call cc-option,-fwrapv)
40 KBUILD_AFLAGS := -D__ASSEMBLY__
41
42 # Warn about unsupported modules in kernels built inside Autobuild