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 <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine
2022-11-16 14:34:16 +01:00
parent bc0ff75455
commit 4da2bd6f7e

View File

@@ -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"