mirror of https://github.com/python/cpython
gh-121996: Fix --disable-safety and --enable-slower-safety options (gh-122414)
This commit is contained in:
parent
15d4cd0967
commit
046670c3a0
|
@ -9682,10 +9682,10 @@ then :
|
||||||
then :
|
then :
|
||||||
disable_safety=no
|
disable_safety=no
|
||||||
else $as_nop
|
else $as_nop
|
||||||
disable_saftey=yes
|
disable_safety=yes
|
||||||
fi
|
fi
|
||||||
else $as_nop
|
else $as_nop
|
||||||
disable_saftey=no
|
disable_safety=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $disable_safety" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $disable_safety" >&5
|
||||||
|
@ -9726,7 +9726,7 @@ fi
|
||||||
printf "%s\n" "$ax_cv_check_cflags__Werror__fstack_protector_strong" >&6; }
|
printf "%s\n" "$ax_cv_check_cflags__Werror__fstack_protector_strong" >&6; }
|
||||||
if test "x$ax_cv_check_cflags__Werror__fstack_protector_strong" = xyes
|
if test "x$ax_cv_check_cflags__Werror__fstack_protector_strong" = xyes
|
||||||
then :
|
then :
|
||||||
BASECFLAGS="$BASECFLAGS -fstack-protector-strong"
|
CFLAGS_NODIST="$CFLAGS_NODIST -fstack-protector-strong"
|
||||||
else $as_nop
|
else $as_nop
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -fstack-protector-strong not supported" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -fstack-protector-strong not supported" >&5
|
||||||
printf "%s\n" "$as_me: WARNING: -fstack-protector-strong not supported" >&2;}
|
printf "%s\n" "$as_me: WARNING: -fstack-protector-strong not supported" >&2;}
|
||||||
|
@ -9765,7 +9765,7 @@ fi
|
||||||
printf "%s\n" "$ax_cv_check_cflags__Werror__Wtrampolines" >&6; }
|
printf "%s\n" "$ax_cv_check_cflags__Werror__Wtrampolines" >&6; }
|
||||||
if test "x$ax_cv_check_cflags__Werror__Wtrampolines" = xyes
|
if test "x$ax_cv_check_cflags__Werror__Wtrampolines" = xyes
|
||||||
then :
|
then :
|
||||||
BASECFLAGS="$BASECFLAGS -Wtrampolines"
|
CFLAGS_NODIST="$CFLAGS_NODIST -Wtrampolines"
|
||||||
else $as_nop
|
else $as_nop
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -Wtrampolines not supported" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -Wtrampolines not supported" >&5
|
||||||
printf "%s\n" "$as_me: WARNING: -Wtrampolines not supported" >&2;}
|
printf "%s\n" "$as_me: WARNING: -Wtrampolines not supported" >&2;}
|
||||||
|
@ -9778,7 +9778,14 @@ printf %s "checking for --enable-slower-safety... " >&6; }
|
||||||
# Check whether --enable-slower-safety was given.
|
# Check whether --enable-slower-safety was given.
|
||||||
if test ${enable_slower_safety+y}
|
if test ${enable_slower_safety+y}
|
||||||
then :
|
then :
|
||||||
enableval=$enable_slower_safety;
|
enableval=$enable_slower_safety; if test "x$disable_slower_safety" = xyes
|
||||||
|
then :
|
||||||
|
enable_slower_safety=no
|
||||||
|
else $as_nop
|
||||||
|
enable_slower_safety=yes
|
||||||
|
fi
|
||||||
|
else $as_nop
|
||||||
|
enable_slower_safety=no
|
||||||
fi
|
fi
|
||||||
|
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_slower_safety" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $enable_slower_safety" >&5
|
||||||
|
@ -9819,7 +9826,7 @@ fi
|
||||||
printf "%s\n" "$ax_cv_check_cflags__Werror__D_FORTIFY_SOURCE_3" >&6; }
|
printf "%s\n" "$ax_cv_check_cflags__Werror__D_FORTIFY_SOURCE_3" >&6; }
|
||||||
if test "x$ax_cv_check_cflags__Werror__D_FORTIFY_SOURCE_3" = xyes
|
if test "x$ax_cv_check_cflags__Werror__D_FORTIFY_SOURCE_3" = xyes
|
||||||
then :
|
then :
|
||||||
BASECFLAGS="$BASECFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3"
|
CFLAGS_NODIST="$CFLAGS_NODIST -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3"
|
||||||
else $as_nop
|
else $as_nop
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -D_FORTIFY_SOURCE=3 not supported" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: -D_FORTIFY_SOURCE=3 not supported" >&5
|
||||||
printf "%s\n" "$as_me: WARNING: -D_FORTIFY_SOURCE=3 not supported" >&2;}
|
printf "%s\n" "$as_me: WARNING: -D_FORTIFY_SOURCE=3 not supported" >&2;}
|
||||||
|
|
11
configure.ac
11
configure.ac
|
@ -2503,23 +2503,24 @@ AS_VAR_IF([with_strict_overflow], [yes],
|
||||||
AC_MSG_CHECKING([for --disable-safety])
|
AC_MSG_CHECKING([for --disable-safety])
|
||||||
AC_ARG_ENABLE([safety],
|
AC_ARG_ENABLE([safety],
|
||||||
[AS_HELP_STRING([--disable-safety], [disable usage of the security compiler options with no performance overhead])],
|
[AS_HELP_STRING([--disable-safety], [disable usage of the security compiler options with no performance overhead])],
|
||||||
[AS_VAR_IF([enable_safety], [yes], [disable_safety=no], [disable_saftey=yes])], [disable_saftey=no])
|
[AS_VAR_IF([enable_safety], [yes], [disable_safety=no], [disable_safety=yes])], [disable_safety=no])
|
||||||
AC_MSG_RESULT([$disable_safety])
|
AC_MSG_RESULT([$disable_safety])
|
||||||
|
|
||||||
if test "$disable_safety" = "no"
|
if test "$disable_safety" = "no"
|
||||||
then
|
then
|
||||||
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [BASECFLAGS="$BASECFLAGS -fstack-protector-strong"], [AC_MSG_WARN([-fstack-protector-strong not supported])], [-Werror])
|
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [CFLAGS_NODIST="$CFLAGS_NODIST -fstack-protector-strong"], [AC_MSG_WARN([-fstack-protector-strong not supported])], [-Werror])
|
||||||
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [BASECFLAGS="$BASECFLAGS -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror])
|
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [CFLAGS_NODIST="$CFLAGS_NODIST -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING([for --enable-slower-safety])
|
AC_MSG_CHECKING([for --enable-slower-safety])
|
||||||
AC_ARG_ENABLE([slower-safety],
|
AC_ARG_ENABLE([slower-safety],
|
||||||
[AS_HELP_STRING([--enable-slower-safety], [enable usage of the security compiler options with performance overhead])],[])
|
[AS_HELP_STRING([--enable-slower-safety], [enable usage of the security compiler options with performance overhead])],
|
||||||
|
[AS_VAR_IF([disable_slower_safety], [yes], [enable_slower_safety=no], [enable_slower_safety=yes])], [enable_slower_safety=no])
|
||||||
AC_MSG_RESULT([$enable_slower_safety])
|
AC_MSG_RESULT([$enable_slower_safety])
|
||||||
|
|
||||||
if test "$enable_slower_safety" = "yes"
|
if test "$enable_slower_safety" = "yes"
|
||||||
then
|
then
|
||||||
AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=3], [BASECFLAGS="$BASECFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3"], [AC_MSG_WARN([-D_FORTIFY_SOURCE=3 not supported])], [-Werror])
|
AX_CHECK_COMPILE_FLAG([-D_FORTIFY_SOURCE=3], [CFLAGS_NODIST="$CFLAGS_NODIST -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3"], [AC_MSG_WARN([-D_FORTIFY_SOURCE=3 not supported])], [-Werror])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $GCC in
|
case $GCC in
|
||||||
|
|
Loading…
Reference in New Issue