Debian Bug report logs - #520548
Add -fwrapv to CFLAGS

version graph

Package: linux-2.6; Maintainer for linux-2.6 is (unknown);

Reported by: dann frazier <[email protected]>

Date: Fri, 20 Mar 2009 19:30:05 UTC

Severity: important

Tags: patch

Found in version 2.6.26-13lenny2

Fixed in version linux-2.6/2.6.26-14

Done: dann frazier <[email protected]>

Bug is archived. No further changes may be made.

Full log


Message #5 received at [email protected] (full text, mbox, reply):

Received: (at submit) by bugs.debian.org; 20 Mar 2009 19:29:08 +0000
From [email protected] Fri Mar 20 19:29:08 2009
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
	(2007-08-08) on rietz.debian.org
X-Spam-Level: 
X-Spam-Bayes: score:0.0000 Tokens: new, 66; hammy, 151; neutral, 78; spammy,
	0. spammytokens: hammytokens:0.000-+--Severity, 0.000-+--UD:show_bug.cgi,
	0.000-+--show_bugcgi, 0.000-+--show_bug.cgi, 0.000-+--UD:orig
X-Spam-Status: No, score=-9.6 required=4.0 tests=AWL,BAYES_00,FROMDEVELOPER,
	HAS_PACKAGE,IMPRONONCABLE_2,MURPHY_DRUGS_REL8,RCVD_IN_DNSWL_MED autolearn=ham
	version=3.2.3-bugs.debian.org_2005_01_02
Return-path: <[email protected]>
Received: from g1t0029.austin.hp.com ([15.216.28.36])
	by rietz.debian.org with esmtp (Exim 4.63)
	(envelope-from <[email protected]>)
	id 1LkkOy-0003yL-51
	for [email protected]; Fri, 20 Mar 2009 19:29:08 +0000
Received: from g4t0009.houston.hp.com (g4t0009.houston.hp.com [16.234.32.26])
	by g1t0029.austin.hp.com (Postfix) with ESMTP id E43243814D
	for <[email protected]>; Fri, 20 Mar 2009 19:29:01 +0000 (UTC)
Received: from ldl.fc.hp.com (ldl.fc.hp.com [15.11.146.30])
	by g4t0009.houston.hp.com (Postfix) with ESMTP id C6B4EC0BD
	for <[email protected]>; Fri, 20 Mar 2009 19:29:01 +0000 (UTC)
Received: from localhost (ldl.fc.hp.com [127.0.0.1])
	by ldl.fc.hp.com (Postfix) with ESMTP id 42CA939C043
	for <[email protected]>; Fri, 20 Mar 2009 13:29:01 -0600 (MDT)
X-Virus-Scanned: Debian amavisd-new at ldl.fc.hp.com
Received: from ldl.fc.hp.com ([127.0.0.1])
	by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id DVdywYaW0UZT for <[email protected]>;
	Fri, 20 Mar 2009 13:28:59 -0600 (MDT)
Received: from krebs (krebs.dannf [10.8.0.7])
	by ldl.fc.hp.com (Postfix) with ESMTP id B1B9139C009
	for <[email protected]>; Fri, 20 Mar 2009 13:28:59 -0600 (MDT)
Received: by krebs (Postfix, from userid 20800)
	id 1B6BE19CB11; Fri, 20 Mar 2009 13:29:30 -0600 (MDT)
Date: Fri, 20 Mar 2009 13:29:30 -0600
From: dann frazier <[email protected]>
To: [email protected]
Subject: Add -fwrapv to CFLAGS
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.18 (2008-05-17)
Delivered-To: [email protected]
Package: linux-2.6
Version: 2.6.26-13lenny2
Severity: important
Tags: patch

We should include this in stable updates. No ABI changes were detected
in a test build of the 686 flavor.

commit 68df3755e383e6fecf2354a67b08f92f18536594
Author: Linus Torvalds <[email protected]>
Date:   Thu Mar 19 11:10:17 2009 -0700

    Add '-fwrapv' to gcc CFLAGS
    
    This makes sure that gcc doesn't try to optimize away wrapping
    arithmetic, which the kernel occasionally uses for overflow testing, ie
    things like
    
    	if (ptr + offset < ptr)
    
    which technically is undefined for non-unsigned types. See
    
    	http://bugzilla.kernel.org/show_bug.cgi?id=12597
    
    for details.
    
    Not all versions of gcc support it, so we need to make it conditional
    (it looks like it was introduced in gcc-3.4).
    
    Reminded-by: Alan Cox <[email protected]>
    Signed-off-by: Linus Torvalds <[email protected]>

Adjusted to apply to Debian's 2.6.26 by dann frazier <[email protected]>

diff -urpN linux-source-2.6.26.orig/Makefile linux-source-2.6.26/Makefile
--- linux-source-2.6.26.orig/Makefile	2009-03-09 16:22:35.000000000 -0600
+++ linux-source-2.6.26/Makefile	2009-03-20 11:14:43.000000000 -0600
@@ -321,6 +321,7 @@ KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUXI
 KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
 		   -fno-strict-aliasing -fno-common \
 		   -Werror-implicit-function-declaration
+KBUILD_CFLAGS	+= $(call cc-option,-fwrapv)
 KBUILD_AFLAGS   := -D__ASSEMBLY__
 
 # Read KERNELRELEASE from include/config/kernel.release (if it exists)





Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Sat May 10 09:47:01 2025; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.