linux-kbuild.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@alien8.de>
To: Ingo Molnar <mingo@elte.hu>
Cc: Sam Ravnborg <sam@ravnborg.org>, Michal Marek <mmarek@suse.cz>,
	Arnd Bergmann <arnd@arndb.de>,
	torvalds@linux-foundation.org, x86@kernel.org,
	linux-kernel@vger.kernel.org, linux-kbuild@vger.kernel.org,
	bp@amd64.org
Subject: Re: [PATCH -v5] kbuild: Add extra gcc checks
Date: Thu, 10 Mar 2011 10:20:34 +0100	[thread overview]
Message-ID: <20110310092034.GA21454@liondog.tnic> (raw)
In-Reply-To: <20110310090444.GA25522@elte.hu>

On Thu, Mar 10, 2011 at 10:04:44AM +0100, Ingo Molnar wrote:
> 
> * Sam Ravnborg <sam@ravnborg.org> wrote:
> 
> > > Another, related, very nice kbuild feature would be to allow for arch maintainers to 
> > > mark certain files as "should only build fine without warnings" - i.e. -Werror 
> > > should be the default. There would be a Kconfig feature to opt out of this, 
> > > CONFIG_CC_IGNORE_WARNINGS=y or so. This would allow for people to still build the 
> > > kernel with old (or buggy) versions of GCC.
> > 
> > To add -Werror for all files conditionally you can do:
> > 
> >     ccflags-$(CONFIG_WERROR) += -Werror
> > 
> > For individual files we can then drop -Werror like this:
> > 
> >     CFLAGS_REMOVE_foobar.o := -Werror
> > 
> > So it should be doable with the existing infrastructure.
> 
> Stupid question: is there an existing kbuild rule that i could use to enable -Werror 
> for a single .o file, such as kernel/sched.o - without affecting other files in 
> kernel/ that i do not maintain?
> 
> Also, adding 3 lines per object file is pretty ugly - would it be possible to create 
> a nicer, compact, single-line way to someone condense a CONFIG_ERROR opt-out 
> mechanism, the -Werror default and the single-object-file into a single rule?
> 
> Something like:
> 
>   obj-werror-y += sched.o

I believe you can do

CFLAGS_sched.o = -Werror

or similar but you'll have to try it out. I remember doing a more
involved per-object flags fumbling with the popcnt stuff, i.e. you might
want to take a look at d61931d89be506372d01a90d1755f6d0a9fafe2d where
we pass it an arch-specific config option so you can have per-object,
per-arch build flags :).

HTH.

-- 
Regards/Gruss,
    Boris.

  parent reply	other threads:[~2011-03-10  9:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01  8:35 [PATCH -v5] kbuild: Add extra gcc checks Borislav Petkov
2011-03-09 14:45 ` Michal Marek
2011-03-09 15:06   ` Borislav Petkov
2011-03-09 15:11   ` Ingo Molnar
2011-03-09 17:56     ` Sam Ravnborg
2011-03-10  9:04       ` Ingo Molnar
2011-03-10  9:17         ` Michal Marek
2011-03-10 10:25           ` Sam Ravnborg
2011-03-10  9:20         ` Borislav Petkov [this message]
2011-03-10 11:56         ` Arnd Bergmann

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=20110310092034.GA21454@liondog.tnic \
    --to=bp@alien8.de \
    --cc=arnd@arndb.de \
    --cc=bp@amd64.org \
    --cc=linux-kbuild@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=mmarek@suse.cz \
    --cc=sam@ravnborg.org \
    --cc=torvalds@linux-foundation.org \
    --cc=x86@kernel.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;
as well as URLs for NNTP newsgroup(s).