Skip to content

Commit d6448fd

Browse files
Commit
1 parent 0b21682 commit d6448fd

2 files changed

Lines changed: 57 additions & 47 deletions

File tree

configure

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

configure.ac

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2221,28 +2221,6 @@ AC_MSG_RESULT([$BOLT_APPLY_FLAGS])
22212221
# compiler and platform. BASECFLAGS tweaks need to be made even if the
22222222
# user set OPT.
22232223

2224-
dnl Historically, some of our code assumed that signed integer overflow
2225-
dnl is defined behaviour via twos-complement.
2226-
dnl Set STRICT_OVERFLOW_CFLAGS and NO_STRICT_OVERFLOW_CFLAGS depending on compiler support.
2227-
dnl Pass the latter to modules that depend on such behaviour.
2228-
_SAVE_VAR([CFLAGS])
2229-
CFLAGS="-fstrict-overflow -fno-strict-overflow"
2230-
AC_CACHE_CHECK([if $CC supports -fstrict-overflow and -fno-strict-overflow],
2231-
[ac_cv_cc_supports_fstrict_overflow],
2232-
AC_COMPILE_IFELSE(
2233-
[AC_LANG_PROGRAM([[]], [[]])],
2234-
[ac_cv_cc_supports_fstrict_overflow=yes],
2235-
[ac_cv_cc_supports_fstrict_overflow=no]
2236-
)
2237-
)
2238-
_RESTORE_VAR([CFLAGS])
2239-
2240-
AS_VAR_IF([ac_cv_cc_supports_fstrict_overflow], [yes],
2241-
[STRICT_OVERFLOW_CFLAGS="-fstrict-overflow"
2242-
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"],
2243-
[STRICT_OVERFLOW_CFLAGS=""
2244-
NO_STRICT_OVERFLOW_CFLAGS=""])
2245-
22462224
AC_MSG_CHECKING([for --with-strict-overflow])
22472225
AC_ARG_WITH([strict-overflow],
22482226
AS_HELP_STRING(
@@ -2251,12 +2229,37 @@ AC_ARG_WITH([strict-overflow],
22512229
),
22522230
[
22532231
AS_VAR_IF(
2254-
[ac_cv_cc_supports_fstrict_overflow], [no],
2255-
[AC_MSG_WARN([--with-strict-overflow=yes requires a compiler that supports -fstrict-overflow])],
2256-
[]
2232+
[with_strict_overflow], [yes],
2233+
[dnl Historically, some of our code assumed that signed integer overflow
2234+
dnl is defined behaviour via twos-complement.
2235+
dnl Set STRICT_OVERFLOW_CFLAGS and NO_STRICT_OVERFLOW_CFLAGS depending on compiler support.
2236+
dnl Pass the latter to modules that depend on such behaviour.
2237+
_SAVE_VAR([CFLAGS])
2238+
CFLAGS="-fstrict-overflow -fno-strict-overflow"
2239+
AC_CACHE_CHECK([if $CC supports -fstrict-overflow and -fno-strict-overflow],
2240+
[ac_cv_cc_supports_fstrict_overflow],
2241+
AC_COMPILE_IFELSE(
2242+
[AC_LANG_PROGRAM([[]], [[]])],
2243+
[ac_cv_cc_supports_fstrict_overflow=yes],
2244+
[ac_cv_cc_supports_fstrict_overflow=no]
2245+
)
2246+
)
2247+
_RESTORE_VAR([CFLAGS])
2248+
2249+
AS_VAR_IF([ac_cv_cc_supports_fstrict_overflow], [yes],
2250+
[STRICT_OVERFLOW_CFLAGS="-fstrict-overflow"
2251+
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"],
2252+
[AC_MSG_WARN([--with-strict-overflow=yes requires a compiler that supports -fstrict-overflow])
2253+
STRICT_OVERFLOW_CFLAGS=""
2254+
NO_STRICT_OVERFLOW_CFLAGS=""])
2255+
],
2256+
[STRICT_OVERFLOW_CFLAGS=""
2257+
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"]
22572258
)
22582259
],
2259-
[with_strict_overflow=no]
2260+
[with_strict_overflow=no
2261+
STRICT_OVERFLOW_CFLAGS=""
2262+
NO_STRICT_OVERFLOW_CFLAGS="-fno-strict-overflow"]
22602263
)
22612264
AC_MSG_RESULT([$with_strict_overflow])
22622265

0 commit comments

Comments
 (0)