diff options
author | rl1987 <rl1987@sdf.lonestar.org> | 2020-03-13 20:24:54 +0200 |
---|---|---|
committer | teor <teor@torproject.org> | 2020-03-17 21:06:15 +1000 |
commit | 5591f424753c1f732e4c9d58b31070b878f18484 (patch) | |
tree | 5ed481d24aea865312968074669ad783e3110b64 | |
parent | 437da7fb3a1a8834a2cc939119f71da15d5bea64 (diff) | |
download | tor-5591f424753c1f732e4c9d58b31070b878f18484.tar.gz tor-5591f424753c1f732e4c9d58b31070b878f18484.zip |
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.
-rw-r--r-- | .travis.yml | 15 | ||||
-rw-r--r-- | configure.ac | 7 |
2 files changed, 14 insertions, 8 deletions
diff --git a/.travis.yml b/.travis.yml index 49745278b5..77dd78f270 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/configure.ac b/configure.ac index aa511a3911..9d3bef999f 100644 --- a/configure.ac +++ b/configure.ac @@ -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, |