scripts/sanitizer-env.sh: support new clang 19 DSO

Seemingly with version 19, the CPU arch was dropped from the DSO name.
Try that and fallback to the old one, as applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/219
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
This commit is contained in:
Emil Velikov 2024-11-01 13:32:07 +00:00 committed by Lucas De Marchi
parent 870aa6fe99
commit c7686797fc

View File

@ -5,7 +5,11 @@
if [[ ${CC-} == *gcc* ]]; then
OUR_PRELOAD=$("$CC" -print-file-name=libasan.so)
elif [[ ${CC-} == *clang* ]]; then
OUR_PRELOAD=$("$CC" -print-file-name=libclang_rt.asan-x86_64.so)
# With v19, the library lacks the CPU arch in its name
OUR_PRELOAD=$("$CC" -print-file-name=libclang_rt.asan.so)
if ! test -f "$OUR_PRELOAD"; then
OUR_PRELOAD=$("$CC" -print-file-name=libclang_rt.asan-x86_64.so)
fi
else
cat <<- EOF >&2