Skip to content

Commit db06ce7

Browse files
committed
fix path to sanitize-ignorelist when running in CMake
1 parent a7f195d commit db06ce7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

toolchain/cc_wrapper.sh.tpl

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,18 @@ elif [[ ${BASH_SOURCE[0]} == "/"* ]]; then
4343
# This script is at _execroot_/external/_repo_name_/bin/clang_wrapper.sh
4444
execroot_path="${BASH_SOURCE[0]%/*/*/*/*}"
4545
clang="${execroot_path}/%{toolchain_path_prefix}bin/clang"
46-
exec "${clang}" "${@}"
46+
47+
# If we're compiling with -fsanitize-ignorelist, we need fix that path
48+
args=("$@")
49+
for ((i = 0; i < $#; i++)); do
50+
if [[ "${args[i]}" =~ ^-fsanitize-(ignore|black)list=[^/] ]]; then
51+
path="${args[i]#*=}"
52+
args[i]="-fsanitize-blacklist=${execroot_path}/${path}"
53+
break
54+
fi
55+
done
56+
57+
exec "${clang}" "${args[@]}"
4758
else
4859
echo >&2 "ERROR: could not find clang; PWD=\"${PWD}\"; PATH=\"${PATH}\"."
4960
exit 5

0 commit comments

Comments
 (0)