toolchain: granular choice for stack protector
authorSteven Noonan <steven@uplinklabs.net>
Sun, 27 Dec 2015 11:07:31 +0000 (12:07 +0100)
committerThomas Petazzoni <thomas.petazzoni@free-electrons.com>
Sun, 27 Dec 2015 14:30:09 +0000 (15:30 +0100)
commitd29c7196bf5e610123dcc697197d4013d5869f68
tree208807555bb34233bab2817d968bc7e427a31daa
parent9ac65b37bd34a4ba9a97156ace0fe91ce3670912
toolchain: granular choice for stack protector

Currently, we only support two levels of stach-smashing protection:
  - entirely disabled,
  - protect _all_ functions with -fstack-protector-all.

-fstack-protector-all tends to be far too aggressive and impacts
performance too much to be worth on a real product.

Add a choice that allows us to select between different levels of
stack-smashing protection:
  - none
  - basic   (NEW)
  - strong  (NEW)
  - all

The differences are documented in the GCC online documentation:
    https://gcc.gnu.org/onlinedocs/gcc-4.9.2/gcc/Optimize-Options.html

Signed-off-by: Steven Noonan <steven@uplinklabs.net>
[yann.morin.1998@free.fr:
  - rebase
  - add legacy handling
  - SSP-strong depends on gcc >= 4.9
  - slightly simple ifeq-block in package/Makefile.in
  - keep the comment in the choice; add a comment shen strong is not
    available
  - drop the defaults (only keep the legacy)
  - update commit log
]
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
[Thomas:
 - only show the choice if the toolchain has SSP support
 - add details for the BR2_SSP_ALL option that it has a significant
   performance impact.]
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Config.in
Config.in.legacy
package/Makefile.in