From: Frans Pop <elendil@planet.nl>
To: Sam Ravnborg <sam@ravnborg.org>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
akpm@linux-foundation.org, torvalds@linux-foundation.org,
linux-kbuild@vger.kernel.org, barryn@pobox.com
Subject: Re: [PATCH,v2] Only add '-fwrapv' to gcc CFLAGS for gcc 4.2 and later
Date: Sat, 18 Jul 2009 00:43:51 +0200 [thread overview]
Message-ID: <200907180043.53257.elendil@planet.nl> (raw)
In-Reply-To: <20090717221846.GA7347@merkur.ravnborg.org>
On Saturday 18 July 2009, Sam Ravnborg wrote:
> > # disable invalid "can't wrap" optimizations for signed / pointers
> > -KBUILD_CFLAGS += $(call cc-option,-fwrapv)
> > +KBUILD_CFLAGS += $(shell if [ $(call cc-version) -ge 0402 ]; then \
> > + echo $(call cc-option,-fwrapv); fi ;)
>
> This would be simpler if you use:
That's now academic as Linus decided on a different fix.
> # cc-ifversion
> # Usage: EXTRA_CFLAGS += $(call cc-ifversion, -lt, 0402, -O1)
> cc-ifversion = $(shell [ $(call cc-version, $(CC)) $(1) $(2) ] && echo $(3))
>
> We have only one user at the moment so I understand why you missed it.
:-)
I based my patch on arch/x86/Makefile:
35: KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \
36: echo $(call cc-option,-fno-unit-at-a-time); fi ;)
Guess that could be improved to use cc-ifversion then.
And a quick git grep gives a few other potential candidates:
arch/ia64/Makefile:44:ifeq ($(call cc-version),0304)
arch/parisc/Makefile:129: @if test "$(call cc-version)" -lt "0303"; then \
arch/powerpc/Makefile:80:GCC_BROKEN_VEC := $(shell if [ $(call cc-version) -lt 0400 ] ; then echo "y"; fi)
arch/powerpc/Makefile:219: @if test "$(call cc-version)" = "0304" ; then \
arch/um/Makefile-i386:38:KBUILD_CFLAGS += $(shell if [ $(call cc-version) -lt 0400 ] ; then \
Cheers,
FJP
next prev parent reply other threads:[~2009-07-17 22:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-10 7:28 [Bug 13012] 2.6.28.9 causes init to segfault on Debian etch; 2.6.28.8 OK Frans Pop
2009-07-10 14:59 ` Frans Pop
2009-07-12 17:58 ` Linus Torvalds
2009-07-12 18:24 ` Linus Torvalds
2009-07-13 5:29 ` Ian Lance Taylor
2009-07-25 3:23 ` Dave Jones
2009-07-25 16:49 ` Linus Torvalds
2009-07-10 20:05 ` [PATCH,v2] Only add '-fwrapv' to gcc CFLAGS for gcc 4.2 and later Frans Pop
2009-07-17 22:18 ` Sam Ravnborg
2009-07-17 22:43 ` Frans Pop [this message]
2009-07-18 6:59 ` Sam Ravnborg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200907180043.53257.elendil@planet.nl \
--to=elendil@planet.nl \
--cc=akpm@linux-foundation.org \
--cc=barryn@pobox.com \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sam@ravnborg.org \
--cc=torvalds@linux-foundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox