From a2d92667b581cadbc13bc61906cbe7cc1af646dd Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 18 Oct 2020 14:21:26 -0700 Subject: [PATCH] scripts/run_tests.sh: add CFI tests --- scripts/run_tests.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/scripts/run_tests.sh b/scripts/run_tests.sh index 0e1b3be..4dc3763 100755 --- a/scripts/run_tests.sh +++ b/scripts/run_tests.sh @@ -268,6 +268,16 @@ run_tests() { log "Skipping ASAN tests because compiler ($CC_VERSION) doesn't support ASAN" fi + cflags=("-fsanitize=cfi" "-fno-sanitize-recover=cfi" "-flto" + "-fvisibility=hidden") + if cflags_supported "${cflags[@]}"; then + begin "Running tests with CFI" + CFLAGS="$CFLAGS ${cflags[*]}" do_run_tests --quick + end + else + log "Skipping CFI tests because compiler ($CC_VERSION) doesn't support CFI" + fi + install_uninstall_tests check_symbol_prefixes }