8000 gh-121996: Fix --disable-safety and --enable-slower-safety options (… · python/cpython@046670c · GitHub
[go: up one dir, main page]

Skip to content

Commit 046670c

Browse files
authored
gh-121996: Fix --disable-safety and --enable-slower-safety options (gh-122414)
1 parent 15d4cd0 commit 046670c

File tree

2 files changed

+19
-11
lines changed
Expand file tree

2 files changed

+19
-11
lines changed

configure

Lines changed: 13 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2503,23 +2503,24 @@ AS_VAR_IF([with_strict_overflow], [yes],
25032503
AC_MSG_CHECKING([for --disable-safety])
25042504
AC_ARG_ENABLE([safety],
25052505
[AS_HELP_STRING([--disable-safety], [disable usage of the security compiler options with no performance overhead])],
2506-
[AS_VAR_IF([enable_safety], [yes], [disable_safety=no], [disable_saftey=yes])], [disable_saftey=no])
2506+
[AS_VAR_IF([enable_safety], [yes], [disable_safety=no], [disable_safety=yes])], [disable_safety=no])
25072507
AC_MSG_RESULT([$disable_safety])
25082508

25092509
if test "$disable_safety" = "no"
25102510
then
2511-
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [BASECFLAGS="$BASECFLAGS -fstack-protector-strong"], [AC_MSG_WARN([-fstack-protector-strong not supported])], [-Werror])
2512-
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [BASECFLAGS="$BASECFLAGS -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror])
2511+
AX_CHECK_COMPILE_FLAG([-fstack-protector-strong], [CFLAGS_NODIST="$CFLAGS_NODIST -fstack-protector-strong"], [AC_MSG_WARN([-fstack-protector-strong not supported])], [-Werror])
2512+
AX_CHECK_COMPILE_FLAG([-Wtrampolines], [CFLAGS_NODIST="$CFLAGS_NODIST -Wtrampolines"], [AC_MSG_WARN([-Wtrampolines not supported])], [-Werror])
25132513
fi
25142514

25152515
AC_MSG_CHECKING([for --enable-slower-safety])
25162516
AC_ARG_ENABLE([slower-safety],
2517-
[AS_HELP_STRING([--enable-slower-safety], [enable usage of the security compiler options with performance overhead])],[])
2517+
[AS_HELP_STRING([--enable-slower-safety], [enable usage of the security compiler options with performance overhead])],
2518+
[AS_VAR_IF([disable_slower_safety], [yes], [enable_slower_safety=no], [enable_slower_safety=yes])], [enable_slower_safety=no])
25182519
AC_MSG_RESULT([$enable_slower_safety])
25192520

25202521
if test "$enable_slower_safety" = "yes"
25212522
then
2522-
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])
2523+
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])
25232524
fi
25242525

25252526
case $GCC in

0 commit comments

Comments
 (0)
0