Add --enable-all-bugs-are-fatal option to configure

This option enables the ALL_BUGS_ARE_FATAL macro.

And use --enable-all-bugs-are-fatal in the Travis configuration.
This commit is contained in:
rl1987 2020-03-13 20:24:54 +02:00 committed by teor
parent 437da7fb3a
commit 5591f42475
No known key found for this signature in database
GPG Key ID: 10FEAA0E7075672A
2 changed files with 14 additions and 8 deletions

View File

@ -93,9 +93,9 @@ matrix:
# compiler: clang
# os: osx
- env: ALL_BUGS_ARE_FATAL="yes"
- env: ALL_BUGS_ARE_FATAL="yes" SKIP_MAKE_CHECK="yes" CHUTNEY="yes"
- env: ALL_BUGS_ARE_FATAL="yes" SKIP_MAKE_CHECK="yes" TEST_STEM="yes"
- env: HARDENING_OPTIONS="--enable-assert-fatalism"
- env: HARDENING_OPTIONS="--enable-assert-fatalism" SKIP_MAKE_CHECK="yes" CHUTNEY="yes"
- env: HARDENING_OPTIONS="--enable-assert-fatalism" SKIP_MAKE_CHECK="yes" TEST_STEM="yes"
## Allow the build to report success (with non-required sub-builds
## continuing to run) if all required sub-builds have succeeded.
@ -118,9 +118,9 @@ matrix:
## chutney tests
#- env: CHUTNEY_MAKE="test-network-ipv6" CHUTNEY="yes" CHUTNEY_ALLOW_FAILURES="2" SKIP_MAKE_CHECK="yes"
# os: osx
- env: ALL_BUGS_ARE_FATAL="yes"
- env: ALL_BUGS_ARE_FATAL="yes" SKIP_MAKE_CHECK="yes" CHUTNEY="yes"
- env: ALL_BUGS_ARE_FATAL="yes" SKIP_MAKE_CHECK="yes" TEST_STEM="yes"
- env: HARDENING_OPTIONS="--enable-assert-fatalism"
- env: HARDENING_OPTIONS="--enable-assert-fatalism" SKIP_MAKE_CHECK="yes" CHUTNEY="yes"
- env: HARDENING_OPTIONS="--enable-assert-fatalism" SKIP_MAKE_CHECK="yes" TEST_STEM="yes"
## (Linux only) Use a recent Linux image (Ubuntu Bionic)
dist: bionic
@ -248,8 +248,7 @@ script:
- ./autogen.sh
- CONFIGURE_FLAGS="$ASCIIDOC_OPTIONS $COVERAGE_OPTIONS $HARDENING_OPTIONS $MODULES_OPTIONS $NSS_OPTIONS $OPENSSL_OPTIONS $RUST_OPTIONS --enable-fatal-warnings --disable-silent-rules"
- echo "Configure flags are $CONFIGURE_FLAGS CC=\"$CC $C_DIALECT_OPTIONS\""
- if [[ "$ALL_BUGS_ARE_FATAL" == "" ]]; then ./configure $CONFIGURE_FLAGS CC="$CC $C_DIALECT_OPTIONS"; fi
- if [[ "$ALL_BUGS_ARE_FATAL" != "" ]]; then ./configure CFLAGS="-DALL_BUGS_ARE_FATAL" $CONFIGURE_FLAGS CC="$CC $C_DIALECT_OPTIONS"; fi
- ./configure $CONFIGURE_FLAGS CC="$CC $C_DIALECT_OPTIONS";
## We run `make check` because that's what https://jenkins.torproject.org does.
- if [[ "$SKIP_MAKE_CHECK" == "" ]]; then make check; fi
- if [[ "$DISTCHECK" != "" ]]; then make distcheck DISTCHECK_CONFIGURE_FLAGS="$CONFIGURE_FLAGS"; fi

View File

@ -228,6 +228,13 @@ if test "x$enable_expensive_hardening" = "xyes" || test "x$enable_fragile_harden
AC_DEFINE(DEBUG_SMARTLIST, 1, [Enable smartlist debugging])
fi
AC_ARG_ENABLE(all-bugs-are-fatal,
AS_HELP_STRING(--enable-all-bugs-are-fatal, [force all soft asserts in Tor codebase (tor_assert_nonfatal(), BUG(), etc.) to act as hard asserts (tor_assert() and equivalents); makes Tor fragile; only recommended for dev builds]))
if test "x$enable_all_bugs_are_fatal" = "xyes"; then
AC_DEFINE(ALL_BUGS_ARE_FATAL, 1, [All assert failures are fatal])
fi
dnl Linker hardening options
dnl Currently these options are ELF specific - you can't use this with MacOSX
AC_ARG_ENABLE(linker-hardening,