Re: [PATCH 21/30] stack-protector: test compiler capability in Kconfig and drop AUTO mode

2018-04-15 Thread Kees Cook
On Sun, Apr 15, 2018 at 6:28 AM, Masahiro Yamada wrote: > In my Makefile ... > > stackp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector > stackp-flags-$(CONFIG_CC_STACKPROTECTOR) := -fstack-protector > stackp-flags-$(CONFIG_CC_STACKPROTECTOR_STRONG) := -fstack-protect

Re: [PATCH 21/30] stack-protector: test compiler capability in Kconfig and drop AUTO mode

2018-04-15 Thread Masahiro Yamada
2018-04-14 3:11 GMT+09:00 Linus Torvalds : > On Fri, Apr 13, 2018 at 9:41 AM, Kees Cook wrote: >> >> How about something like this instead: > > I'd rather avoid the ifdef's in the Makefile if at all possible. > > I'd rather expose this as a Kconfig rule, and in the Kconfig just have > an entry som

Re: [PATCH 21/30] stack-protector: test compiler capability in Kconfig and drop AUTO mode

2018-04-15 Thread Masahiro Yamada
2018-04-14 1:41 GMT+09:00 Kees Cook : > On Thu, Apr 12, 2018 at 10:06 PM, Masahiro Yamada > wrote: >> +stackp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector >> +stackp-flags-$(CONFIG_CC_STACKPROTECTOR) := -fstack-protector >> +stackp-flags-$(CONFIG_CC_STACKPROTECTOR_ST

Re: [PATCH 21/30] stack-protector: test compiler capability in Kconfig and drop AUTO mode

2018-04-13 Thread Kees Cook
On Fri, Apr 13, 2018 at 11:11 AM, Linus Torvalds wrote: > config STACKPROTECTOR_FLAGS > string > default "-fstack-protector-strong" if CC_STACKPROTECTOR_STRONG > default "-fstack-protector" if CC_STACKPROTECTOR > default "-fno-stack-protector" if CC_HAS_STACKPRO

Re: [PATCH 21/30] stack-protector: test compiler capability in Kconfig and drop AUTO mode

2018-04-13 Thread Linus Torvalds
On Fri, Apr 13, 2018 at 9:41 AM, Kees Cook wrote: > > How about something like this instead: I'd rather avoid the ifdef's in the Makefile if at all possible. I'd rather expose this as a Kconfig rule, and in the Kconfig just have an entry something like this config STACKPROTECTOR_FLAGS

Re: [PATCH 21/30] stack-protector: test compiler capability in Kconfig and drop AUTO mode

2018-04-13 Thread Kees Cook
On Thu, Apr 12, 2018 at 10:06 PM, Masahiro Yamada wrote: > +stackp-flags-$(CONFIG_CC_HAS_STACKPROTECTOR_NONE) := -fno-stack-protector > +stackp-flags-$(CONFIG_CC_STACKPROTECTOR) := -fstack-protector > +stackp-flags-$(CONFIG_CC_STACKPROTECTOR_STRONG) := -fstack-protector-strong > + > +KB

[PATCH 21/30] stack-protector: test compiler capability in Kconfig and drop AUTO mode

2018-04-12 Thread Masahiro Yamada
Move the test for -fstack-protector(-strong) option to Kconfig. If the compiler does not support the option, the corresponding menu is automatically hidden. If STRONG is not supported, it will fall back to REGULAR. If REGULAR is not supported, it will be disabled. This means, AUTO is implicitly