mirror of https://github.com/python/cpython
gh-112301: Make fortify source option check -Werror (gh-122141)
This commit is contained in:
parent
2f74b709b6
commit
ca0f7c447c
|
@ -9788,13 +9788,13 @@ if test "$enable_slower_safety" = "yes"
|
||||||
then
|
then
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -D_FORTIFY_SOURCE=3" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether C compiler accepts -D_FORTIFY_SOURCE=3" >&5
|
||||||
printf %s "checking whether C compiler accepts -D_FORTIFY_SOURCE=3... " >&6; }
|
printf %s "checking whether C compiler accepts -D_FORTIFY_SOURCE=3... " >&6; }
|
||||||
if test ${ax_cv_check_cflags___D_FORTIFY_SOURCE_3+y}
|
if test ${ax_cv_check_cflags__Werror__D_FORTIFY_SOURCE_3+y}
|
||||||
then :
|
then :
|
||||||
printf %s "(cached) " >&6
|
printf %s "(cached) " >&6
|
||||||
else $as_nop
|
else $as_nop
|
||||||
|
|
||||||
ax_check_save_flags=$CFLAGS
|
ax_check_save_flags=$CFLAGS
|
||||||
CFLAGS="$CFLAGS -D_FORTIFY_SOURCE=3"
|
CFLAGS="$CFLAGS -Werror -D_FORTIFY_SOURCE=3"
|
||||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
/* end confdefs.h. */
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
@ -9808,16 +9808,16 @@ main (void)
|
||||||
_ACEOF
|
_ACEOF
|
||||||
if ac_fn_c_try_compile "$LINENO"
|
if ac_fn_c_try_compile "$LINENO"
|
||||||
then :
|
then :
|
||||||
ax_cv_check_cflags___D_FORTIFY_SOURCE_3=yes
|
ax_cv_check_cflags__Werror__D_FORTIFY_SOURCE_3=yes
|
||||||
else $as_nop
|
else $as_nop
|
||||||
ax_cv_check_cflags___D_FORTIFY_SOURCE_3=no
|
ax_cv_check_cflags__Werror__D_FORTIFY_SOURCE_3=no
|
||||||
fi
|
fi
|
||||||
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||||
CFLAGS=$ax_check_save_flags
|
CFLAGS=$ax_check_save_flags
|
||||||
fi
|
fi
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags___D_FORTIFY_SOURCE_3" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ax_cv_check_cflags__Werror__D_FORTIFY_SOURCE_3" >&5
|
||||||
printf "%s\n" "$ax_cv_check_cflags___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___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"
|
BASECFLAGS="$BASECFLAGS -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3"
|
||||||
else $as_nop
|
else $as_nop
|
||||||
|
|
|
@ -2519,7 +2519,7 @@ 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])])
|
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])
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case $GCC in
|
case $GCC in
|
||||||
|
|
Loading…
Reference in New Issue