FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-96821: Check for `-fstrict-overflow` only if `--with-strict-overflow` is passed by StanFromIreland · Pull Request #139595 · python/cpython · GitHub

/ cpython Public
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .ac  (1) No extension  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
103 changes: 76 additions & 27 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

47 changes: 21 additions & 26 deletions configure.ac
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -2235,28 +2235,6 @@ AC_MSG_RESULT([$BOLT_APPLY_FLAGS])
# compiler and platform. BASECFLAGS tweaks need to be made even if the
# user set OPT.

dnl Historically, some of our code assumed that signed integer overflow
dnl is defined behaviour via twos-complement.
dnl Set STRICT_OVERFLOW_CFLAGS and NO_STRICT_OVERFLOW_CFLAGS depending on compiler support.
dnl Pass the latter to modules that depend on such behaviour.
_SAVE_VAR([CFLAGS])
CFLAGS="-fstrict-overflow -fno-strict-overflow"
AC_CACHE_CHECK([if $CC supports -fstrict-overflow and -fno-strict-overflow],
[ac_cv_cc_supports_fstrict_overflow],
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[]], [[]])],
[ac_cv_cc_supports_fstrict_overflow=yes],
[ac_cv_cc_supports_fstrict_overflow=no]
)
)
_RESTORE_VAR([CFLAGS])

AS_VAR_IF([ac_cv_cc_supports_fstrict_overflow], [yes],
[STRICT_OVERFLOW_CFLAGS="-fstrict-overflow"
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"],
[STRICT_OVERFLOW_CFLAGS=""
NO_STRICT_OVERFLOW_CFLAGS=""])

AC_MSG_CHECKING([for --with-strict-overflow])
AC_ARG_WITH([strict-overflow],
AS_HELP_STRING(
Expand All @@ -2265,12 +2243,29 @@ AC_ARG_WITH([strict-overflow],
),
[
AS_VAR_IF(
[ac_cv_cc_supports_fstrict_overflow], [no],
[AC_MSG_WARN([--with-strict-overflow=yes requires a compiler that supports -fstrict-overflow])],
[]
[with_strict_overflow], [yes],
[dnl Historically, some of our code assumed that signed integer overflow
dnl is defined behaviour via twos-complement.
dnl Set STRICT_OVERFLOW_CFLAGS and NO_STRICT_OVERFLOW_CFLAGS depending on compiler support.
dnl Pass the latter to modules that depend on such behaviour.
AX_CHECK_COMPILE_FLAG([-fstrict-overflow],
[AX_CHECK_COMPILE_FLAG([-fno-strict-overflow],
[STRICT_OVERFLOW_CFLAGS="-fstrict-overflow"
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"],
[AC_MSG_WARN([--with-strict-overflow=yes requires a compiler that supports -fno-strict-overflow])
STRICT_OVERFLOW_CFLAGS=""
NO_STRICT_OVERFLOW_CFLAGS=""])],
[AC_MSG_WARN([--with-strict-overflow=yes requires a compiler that supports -fstrict-overflow])
STRICT_OVERFLOW_CFLAGS=""
NO_STRICT_OVERFLOW_CFLAGS=""])
],
[STRICT_OVERFLOW_CFLAGS=""
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"]
)
],
[with_strict_overflow=no]
[with_strict_overflow=no
STRICT_OVERFLOW_CFLAGS=""
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"]
)
AC_MSG_RESULT([$with_strict_overflow])

Expand Down
Loading

Back | FazBrowse Home | New Git URL