diff options
Diffstat (limited to 'gcc/configure.ac')
-rw-r--r-- | gcc/configure.ac | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/gcc/configure.ac b/gcc/configure.ac index ca51cdf..ff6444a 100644 --- a/gcc/configure.ac +++ b/gcc/configure.ac @@ -811,6 +811,29 @@ AC_MSG_RESULT($enable_multiarch$ma_msg_suffix) AC_SUBST(with_cpu) AC_SUBST(with_float) +# default stack clash protection guard size as power of twos in bytes. +# Please keep these in sync with params.def. +stk_clash_min=12 +stk_clash_max=30 + +# Keep the default value when the option is not used to 0, this allows us to +# distinguish between the cases where the user specifially set a value via +# configure and when the normal default value is used. +AC_ARG_WITH(stack-clash-protection-guard-size, +[AS_HELP_STRING([--with-stack-clash-protection-guard-size=size], +[Set the default stack clash protection guard size for specific targets as a power of two in bytes.])], +[DEFAULT_STK_CLASH_GUARD_SIZE="$with_stack_clash_protection_guard_size"], [DEFAULT_STK_CLASH_GUARD_SIZE=0]) +if test $DEFAULT_STK_CLASH_GUARD_SIZE -ne 0 \ + && (test $DEFAULT_STK_CLASH_GUARD_SIZE -lt $stk_clash_min \ + || test $DEFAULT_STK_CLASH_GUARD_SIZE -gt $stk_clash_max); then + AC_MSG_ERROR(m4_normalize([ + Invalid value $DEFAULT_STK_CLASH_GUARD_SIZE for --with-stack-clash-protection-guard-size. \ + Must be between $stk_clash_min and $stk_clash_max.])) +fi + +AC_DEFINE_UNQUOTED(DEFAULT_STK_CLASH_GUARD_SIZE, $DEFAULT_STK_CLASH_GUARD_SIZE, + [Define to larger than zero set the default stack clash protector size.]) + # Enable __cxa_atexit for C++. AC_ARG_ENABLE(__cxa_atexit, [AS_HELP_STRING([--enable-__cxa_atexit], [enable __cxa_atexit for C++])], |