From c33b055d85b164206ccfd564cf15ea6acfe1f6b9 Mon Sep 17 00:00:00 2001 From: Stefan Berger Date: Wed, 29 Sep 2021 12:35:58 -0400 Subject: [PATCH] tests: Use nm and grep to check for ASAN clang doesn't link executables built with ASAN support to libasan, like gcc does, so we have to use nm rather than ldd for checking for whether the executable was built with ASAN. nm is part of the binutils package and should be available on all systems where gcc was installed. Signed-off-by: Stefan Berger --- tests/common | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/common b/tests/common index 7d32fd7db..8e85448a8 100644 --- a/tests/common +++ b/tests/common @@ -895,8 +895,8 @@ function skip_test_linked_with_asan() else act_exe="${swtpm_exe}" fi - if [ -n "$(ldd "${act_exe}" | grep libasan)" ]; then - echo "${act_exe} is linked with ASAN" + if [ -n "$(nm "${act_exe}" | grep __asan_)" ]; then + echo "${act_exe} is built with ASAN" exit 77 fi fi