]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
scripts/sanitizer-env.sh: remove incorrect $CC quotes
authorEmil Velikov <emil.l.velikov@gmail.com>
Fri, 23 May 2025 11:01:29 +0000 (12:01 +0100)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Thu, 5 Jun 2025 06:38:02 +0000 (01:38 -0500)
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>
scripts/sanitizer-env.sh

index 2fbebc55d529702bfbbe23e66ef7a1d3c96bba62..6d26907cbc7b097b380adfc0ee620b1b2a066c20 100755 (executable)
@@ -3,12 +3,12 @@
 # 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