From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 4/5 v2] toolchain: -fstack-protector-strong can be back-ported
Date: Sat, 3 Aug 2019 23:16:09 +0200 [thread overview]
Message-ID: <f999b059-b1e5-ef8b-412c-79782db7870d@mind.be> (raw)
In-Reply-To: <17089_1552392582_5C87A186_17089_130_1_f6f2aff0-c673-4b8c-9779-7e671921c77f@OPEXCLILM6F.corporate.adroot.infra.ftgroup>
On 12/03/2019 13:09, yann.morin at orange.com wrote:
> From: "Yann E. MORIN" <yann.morin@orange.com>
>
> Currently, use of -fstack-protector-strong is only available for gcc
> starting with 4.9, on the assumption that it appeared with that version.
>
> Although this is true, it happens that quite a few vendors will have
> back-ported -fstack-protector-strong to older gcc versions (at least 4.8
> seen in the wild).
>
> Remove the guard against gcc>=4.9, and expand the help text.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin@orange.com>
> Cc: Matt Weber <matthew.weber@rockwellcollins.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
> Cc: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
>
> ---
> Notes:
>
> We could have changed the guard to something like:
> depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || BR2_TOOLCHAIN_EXTERNAL
>
> However, the latest gcc we support in the internal toolchain *is*
> gcc-4.9, so the condition would have always been true. Hence, we just
> drop the condition.
This note is in fact interesting, so I've added it to the commit message.
However, it would have been more appropriate (if we would have had the
condition) to make it
depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9 || BR2_TOOLCHAIN_EXTERNAL_CUSTOM
(because we know our predefined external toolchains <4.9 *don't* suport this
option). In fact, we only have one 4.8 predefined external toolchain: Sourcery
ARM. So for that one toolchain, it's not worth adding that condition. The
problem will anyway be caught by the check you just added, because it's also
executed for predefined external toolchains.
Regards,
Arnout
> ---
> Config.in | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/Config.in b/Config.in
> index 757ad1ca40..d5a0460f98 100644
> --- a/Config.in
> +++ b/Config.in
> @@ -746,14 +746,14 @@ config BR2_SSP_REGULAR
>
> config BR2_SSP_STRONG
> bool "-fstack-protector-strong"
> - depends on BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
> help
> Like -fstack-protector but includes additional functions to be
> protected - those that have local array definitions, or have
> references to local frame addresses.
>
> -comment "Stack Smashing Protection strong needs a toolchain w/ gcc >= 4.9"
> - depends on !BR2_TOOLCHAIN_GCC_AT_LEAST_4_9
> + -fstack-protector-strong officially appeared in gcc 4.9, but
> + some vendors have backported -fstack-protector-strong to older
> + versions of gcc.
>
> config BR2_SSP_ALL
> bool "-fstack-protector-all"
>
next prev parent reply other threads:[~2019-08-03 21:16 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1552392456.git.yann.morin@orange.com>
2019-03-12 12:09 ` [Buildroot] [PATCH 1/5 v2] toolchain: prepare to pass more additional CFLAGS via the wrapper yann.morin at orange.com
2019-03-12 23:13 ` Arnout Vandecappelle
2019-03-12 12:09 ` [Buildroot] [PATCH 2/5 v2] toolchain: set the ssp gcc option in kconfig yann.morin at orange.com
2019-03-12 13:33 ` Matthew Weber
2019-03-12 23:14 ` Arnout Vandecappelle
2019-03-12 12:09 ` [Buildroot] [PATCH 3/5 v2] toolchain: check the SSP option is known yann.morin at orange.com
2019-03-12 23:25 ` Arnout Vandecappelle
2019-03-13 7:27 ` yann.morin at orange.com
2019-03-26 19:26 ` Thomas Petazzoni
2019-03-27 6:35 ` yann.morin at orange.com
2019-08-03 21:13 ` Arnout Vandecappelle
2019-03-12 12:09 ` [Buildroot] [PATCH 4/5 v2] toolchain: -fstack-protector-strong can be back-ported yann.morin at orange.com
2019-08-03 21:16 ` Arnout Vandecappelle [this message]
2019-08-05 6:03 ` yann.morin at orange.com
2019-03-12 12:09 ` [Buildroot] [PATCH 5/5 v2] toolchain: allow PIC/PIE without RELRO yann.morin at orange.com
2019-03-12 13:50 ` Matthew Weber
2019-03-12 14:25 ` yann.morin at orange.com
2019-08-03 21:20 ` Arnout Vandecappelle
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=f999b059-b1e5-ef8b-412c-79782db7870d@mind.be \
--to=arnout@mind.be \
--cc=buildroot@busybox.net \
/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