diff options
Diffstat (limited to 'tools/ci/inria/extra-checks')
-rwxr-xr-x | tools/ci/inria/extra-checks | 50 |
1 files changed, 16 insertions, 34 deletions
diff --git a/tools/ci/inria/extra-checks b/tools/ci/inria/extra-checks index 1a9663839f..fc929d46d6 100755 --- a/tools/ci/inria/extra-checks +++ b/tools/ci/inria/extra-checks @@ -48,16 +48,6 @@ arch_error() { error "$msg" } -# Change a variable in Makefile.config -# Usage: set_config_var <variable name> <new value> - - -set_config_var() { - conffile=Makefile.config - mv ${conffile} ${conffile}.bak - (grep -v "^$1=" ${conffile}.bak; echo "$1=$2") > ${conffile} -} - ######################################################################### # Print each command before its execution @@ -151,10 +141,6 @@ echo "======== clang 9, address sanitizer, UB sanitizer ==========" git clean -q -f -d -x # Use clang 9 -# We cannot give the sanitizer options as part of -cc because -# then various autoconfiguration tests fail. -# Instead, we'll fix OC_CFLAGS a posteriori. -./configure CC=clang-9 --disable-stdlib-manpages --enable-dependency-generation # These are the undefined behaviors we want to check # Others occur on purpose e.g. signed arithmetic overflow @@ -172,12 +158,14 @@ shift-exponent,\ unreachable" # Select address sanitizer and UB sanitizer, with trap-on-error behavior +sanitizers="-fsanitize=address -fsanitize-trap=$ubsan" + # Don't optimize too much to get better backtraces of errors -set_config_var OC_CFLAGS "-O1 \ --fno-strict-aliasing -fwrapv -fno-omit-frame-pointer \ --Wall -Werror \ --fsanitize=address \ --fsanitize-trap=$ubsan" + +./configure \ + CC=clang-9 \ + CFLAGS="-O1 -fno-omit-frame-pointer $sanitizers" \ + --disable-stdlib-manpages --enable-dependency-generation # Build the system. We want to check for memory leaks, hence # 1- force ocamlrun to free memory before exiting @@ -205,14 +193,13 @@ echo "======== clang 9, thread sanitizer ==========" git clean -q -f -d -x -./configure CC=clang-9 --disable-stdlib-manpages --enable-dependency-generation - # Select thread sanitizer # Don't optimize too much to get better backtraces of errors -set_config_var OC_CFLAGS "-O1 \ --fno-strict-aliasing -fwrapv -fno-omit-frame-pointer \ --Wall -Werror \ --fsanitize=thread" + +./configure \ + CC=clang-9 \ + CFLAGS="-O1 -fno-omit-frame-pointer -fsanitize=thread" \ + --disable-stdlib-manpages --enable-dependency-generation # Build the system make $jobs @@ -234,20 +221,15 @@ TSAN_OPTIONS="die_after_fork=0" $run_testsuite # git clean -q -f -d -x # # Use clang 6.0 -# # We cannot give the sanitizer options as part of -cc because -# # then various autoconfiguration tests fail. -# # Instead, we'll fix OC_CFLAGS a posteriori. # # Memory sanitizer doesn't like the static data generated by ocamlopt, # # hence build bytecode only -# ./configure CC=clang-9 --disable-native-compiler - # # Select memory sanitizer # # Don't optimize at all to get better backtraces of errors -# set_config_var OC_CFLAGS "-O0 -g \ -# -fno-strict-aliasing -fwrapv -fno-omit-frame-pointer \ -# -Wall -Werror \ -# -fsanitize=memory" +# ./configure \ +# CC=clang-9 \ +# CFLAGS="-O0 -g -fno-omit-frame-pointer -fsanitize=memory" \ +# --disable-native-compiler # # A tool that makes error backtraces nicer # # Need to pick the one that matches clang-6.0 # export MSAN_SYMBOLIZER_PATH=/usr/lib/llvm-6.0/bin/llvm-symbolizer |