On Arch (at least) the shell chokes when the CC variable contains space,
for the given construct - $("$CC" foobar).
Since we variable is likely to contain the executable and arguments, the
quotation is wrong. Drop it and ultimately resolve the LD_PRELOAD
issues... That said, the tests still fail over here, segfault-ing in (or
due to) the LD_PRELOAD library init-modules.so.
Fixes: f5b4ff82 ("Add support for clang sanitizers")
Fixes: c7686797 ("scripts/sanitizer-env.sh: support new clang 19 DSO")
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/365
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
# set -euo pipefail # don't set these, since this script is sourced
if [[ ${CC-} == *gcc* ]]; then
- OUR_PRELOAD=$("$CC" -print-file-name=libasan.so)
+ OUR_PRELOAD=$($CC -print-file-name=libasan.so)
elif [[ ${CC-} == *clang* ]]; then
# With v19, the library lacks the CPU arch in its name
- OUR_PRELOAD=$("$CC" -print-file-name=libclang_rt.asan.so)
+ 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)
+ OUR_PRELOAD=$($CC -print-file-name=libclang_rt.asan-x86_64.so)
fi
else
cat <<- EOF >&2