aboutsummaryrefslogtreecommitdiff
path: root/gcc/opts.c
diff options
context:
space:
mode:
authorMagnus Granberg <zorry@gentoo.org>2015-08-19 22:07:06 +0000
committerJeff Law <law@gcc.gnu.org>2015-08-19 16:07:06 -0600
commite0f6cba004eb94ef9a06c68d09160d8601503085 (patch)
tree3ca7ccb634b618bf1984f21463abb0f4d2de83ff /gcc/opts.c
parentc24f5688adae2f885279e8fdce74a030e6944b7b (diff)
downloadgcc-e0f6cba004eb94ef9a06c68d09160d8601503085.zip
gcc-e0f6cba004eb94ef9a06c68d09160d8601503085.tar.gz
gcc-e0f6cba004eb94ef9a06c68d09160d8601503085.tar.bz2
common.opt (fstack-protector): Initialize to -1.
* common.opt (fstack-protector): Initialize to -1. (fstack-protector-all): Likewise. (fstack-protector-strong): Likewise. (fstack-protector-explicit): Likewise. * configure.ac: Add --enable-default-ssp. * defaults.h (DEFAULT_FLAG_SSP): New. Default SSP to strong. * opts.c (finish_options): Update opts->x_flag_stack_protect if it is -1. * doc/install.texi: Document --enable-default-ssp. * config.in: Regenerated. * configure: Likewise. * lib/target-supports.exp (check_effective_target_fstack_protector_enabled): New test. * gcc.target/i386/ssp-default.c: New test. From-SVN: r227017
Diffstat (limited to 'gcc/opts.c')
-rw-r--r--gcc/opts.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gcc/opts.c b/gcc/opts.c
index 32de605..f1a9acd 100644
--- a/gcc/opts.c
+++ b/gcc/opts.c
@@ -754,6 +754,11 @@ finish_options (struct gcc_options *opts, struct gcc_options *opts_set,
opts->x_flag_opts_finished = true;
}
+ /* We initialize opts->x_flag_stack_protect to -1 so that targets
+ can set a default value. */
+ if (opts->x_flag_stack_protect == -1)
+ opts->x_flag_stack_protect = DEFAULT_FLAG_SSP;
+
if (opts->x_optimize == 0)
{
/* Inlining does not work if not optimizing,