From 4da2bd6f7ef2c606157fc56744794079345c3553 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Wed, 16 Nov 2022 14:34:16 +0100 Subject: [PATCH] Use modern Clang rather than old GCC for full-config ASan+UBSan test We had a GCC+ASan+UBSan full test run on both the default configuration and the full configuration. In the full configuration, use Clang instead. Empirically, a modern Clang's UBSan finds things that GCC's doesn't. Insist on a modern Clang (by default, our CI would pick the oldest available, which doesn't find as much stuff). Define "modern" as the most recent that's available on our CI right now, which is Ubuntu 20.04. Signed-off-by: Gilles Peskine --- tests/scripts/all.sh | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 9295c9d00f..1f76470b6f 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -924,10 +924,10 @@ component_test_default_cmake_gcc_asan () { tests/context-info.sh } -component_test_full_cmake_gcc_asan () { - msg "build: full config, cmake, gcc, ASan" +component_test_full_cmake_clang_asan () { + msg "build: full config, cmake, clang, ASan" scripts/config.py full - CC=gcc cmake -D CMAKE_BUILD_TYPE:String=Asan . + CC=clang cmake -D CMAKE_BUILD_TYPE:String=Asan . make msg "test: main suites (inc. selftests) (full config, ASan build)" @@ -945,6 +945,15 @@ component_test_full_cmake_gcc_asan () { msg "test: context-info.sh (full config, ASan build)" # ~ 15 sec tests/context-info.sh } +# Insist on a reasonably modern Clang. New versions find more problems, +# especially with UBSan. +support_test_full_cmake_clang_asan () { + local version + version="$(echo __clang_major__ | clang -E -)" + version="${version##*$'\n'}" + # Require at least the version in Ubuntu 20.04 + [[ $version != [!0-9]* && $version -ge 10 ]] +} component_test_psa_crypto_key_id_encodes_owner () { msg "build: full config + PSA_CRYPTO_KEY_ID_ENCODES_OWNER, cmake, gcc, ASan"