Index: build/config/sanitizers/BUILD.gn |
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn |
index dddbf2fa49410578aa913c4d82e38e7c749026d6..fac7d51f682451e3493e77a8171903dd7920a9bf 100644 |
--- a/build/config/sanitizers/BUILD.gn |
+++ b/build/config/sanitizers/BUILD.gn |
@@ -157,9 +157,13 @@ config("default_sanitizer_ldflags") { |
if (is_cfi && !is_nacl) { |
ldflags += [ |
"-fsanitize=cfi-vcall", |
- "-fsanitize=cfi-derived-cast", |
- "-fsanitize=cfi-unrelated-cast", |
] |
+ if (use_cfi_cast) { |
+ ldflags += [ |
+ "-fsanitize=cfi-derived-cast", |
+ "-fsanitize=cfi-unrelated-cast", |
+ ] |
+ } |
if (use_cfi_diag) { |
ldflags += [ |
"-fno-sanitize-trap=cfi", |
@@ -255,8 +259,14 @@ config("cfi_flags") { |
rebase_path("//tools/cfi/blacklist.txt", root_build_dir) |
cflags += [ |
"-fsanitize=cfi-vcall", |
- "-fsanitize=cfi-derived-cast", |
- "-fsanitize=cfi-unrelated-cast", |
+ ] |
+ if (use_cfi_cast) { |
+ cflags += [ |
+ "-fsanitize=cfi-derived-cast", |
+ "-fsanitize=cfi-unrelated-cast", |
+ ] |
+ } |
+ cflags += [ |
"-fsanitize-blacklist=$cfi_blacklist_path", |
] |