From 31606dbda80fa9770f6688d61fde311be5485e93 Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Sun, 30 May 2010 22:04:11 +0000 Subject: Only enable -fstack-protector by default on targets that support it. ok marco@ --- gnu/gcc/gcc/common.opt | 2 +- gnu/gcc/gcc/toplev.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'gnu') 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= Trap if the stack goes past symbol 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"); -- cgit v1.2.3