Re: [patch 5/5] Add the -fstack-protector option to the CFLAGS

Arjan van de Ven
2006-07-28T21:40:59Z

On Fri, 2006-07-28 at 23:26 +0200, Sam Ravnborg wrote:
> On Fri, Jul 28, 2006 at 09:00:01PM +0200, Andi Kleen wrote:
> > On Friday 28 July 2006 20:48, Arjan van de Ven wrote:
> > > On Fri, 2006-07-28 at 20:45 +0200, Andi Kleen wrote:
> > > > > +ifdef CONFIG_CC_STACKPROTECTOR
> > > > > +CFLAGS += $(call cc-ifversion, -lt, 0402, -fno-stack-protector)
> > > > > +CFLAGS += $(call cc-ifversion, -ge, 0402, -fstack-protector)
> > > >
> > > > Why can't you just use the normal call cc-option for this?
> > >
> > > this requires gcc 4.2; cc-option is not useful for that.
> >
> > The CC option thing is also very ugly.
> The check is executed once pr. kernel compile - or at least once pr.
> line. The reson to use cc-ifversion is that we need to check for a
> specific gcc version and not just support for a specific argument type.
>
> That said - checking for a version is not as reliable as checking if a
> certain feature is really supported but Arjan suggested testing for
> version >= 4.2 should do it.

it's not hard to run a shell script that returns supported or not. I can
do the shell script no problem... but I would prefer that you then do
the Makefile foo for it :)
Would that work?