summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2010-05-30 22:04:11 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2010-05-30 22:04:11 +0000
commit31606dbda80fa9770f6688d61fde311be5485e93 (patch)
tree74b1d88e66ffdfed19de13466af36bfb890c7fdf
parent1c5fadaec6a19c132785784c9a318b2807323d1c (diff)
Only enable -fstack-protector by default on targets that support it.
ok marco@
-rw-r--r--gnu/gcc/gcc/common.opt2
-rw-r--r--gnu/gcc/gcc/toplev.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/gnu/gcc/gcc/common.opt b/gnu/gcc/gcc/common.opt
index d0991d244f9..57f7ed1a713 100644
--- a/gnu/gcc/gcc/common.opt
+++ b/gnu/gcc/gcc/common.opt
@@ -863,7 +863,7 @@ Common RejectNegative Joined
-fstack-limit-symbol=<name> Trap if the stack goes past symbol <name>
fstack-protector
-Common Report Var(flag_stack_protect, 1) Init(1)
+Common Report Var(flag_stack_protect, 1) Init(-1)
Use propolice as a stack protection method
fstack-protector-all
diff --git a/gnu/gcc/gcc/toplev.c b/gnu/gcc/gcc/toplev.c
index 53fcdfe580c..5d438e0de27 100644
--- a/gnu/gcc/gcc/toplev.c
+++ b/gnu/gcc/gcc/toplev.c
@@ -1833,6 +1833,8 @@ process_options (void)
/* Targets must be able to place spill slots at lower addresses. If the
target already uses a soft frame pointer, the transition is trivial. */
+ if (flag_stack_protect == -1)
+ flag_stack_protect = FRAME_GROWS_DOWNWARD ? 1 : 0;
if (!FRAME_GROWS_DOWNWARD && flag_stack_protect)
{
warning (0, "-fstack-protector not supported for this target");