lkml.org 
[lkml]   [2014]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [patch core/stackprotector] stackprotector: Fix build when compiler lacks support
From
On Wed, Jan 1, 2014 at 3:42 AM, Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> On 2013-12-31 16:16 -0800, Linus Torvalds spake thusly:
>>
>> What we really really want to do is to have some way to add config
>> options based on shell scripts and compiler support. That would also
>> get rid of a lot of Makefile trickery etc.
>>
>> Then we could just make CC_STACKPROTECTOR_STRONG depend on
>> CC_SUPPORTS_STACKPROTECTOR_STRONG or whatever.
>
> Sam Ravnborg suggested somethink along those lines back in July:
> http://marc.info/?l=linux-kbuild&m=137399785206527&w=2
> and a tentative implementation:
> http://marc.info/?l=linux-kbuild&m=137409581406434&w=2

Ack. Looks good to me. I've wanted this for a long time for other
reasons, we should finally just do it.

That said, we should make sure that the shell execution thing gets
access to $(CC) etc variables that we have in

> Basically, that would give something like:
>
> config CC_SUPPORTS_STACKPROTECTOR_STRONG
> bool
> option exec="some/script/to/test-gcc -fstack-protector-strong"

For the compiler options, it would hopefully be sufficient to just do
something like

config CC_SUPPORTS_STACKPROTECTOR_STRONG
bool
option exec="$CC -fstack-protector-strong -c empty.c"

or something like that. No?

Linus


\
 
 \ /
  Last update: 2014-01-01 21:01    [W:0.095 / U:0.472 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site