Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(244)

Unified Diff: build/config/sanitizers/BUILD.gn

Issue 2131423002: Implement use_cfi_cast to optionally enable cast checks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Localize CFI_CAST_CHECK define Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « build/common.gypi ('k') | build/config/sanitizers/sanitizers.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/sanitizers/BUILD.gn
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn
index 0b099f41003757215e0a26feb6264833c449c49f..f03c98f279fa75dc3eb4ba450974ea7eb4626578 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -155,11 +155,13 @@ config("default_sanitizer_ldflags") {
}
if (is_cfi && !is_nacl) {
- ldflags += [
- "-fsanitize=cfi-vcall",
- "-fsanitize=cfi-derived-cast",
- "-fsanitize=cfi-unrelated-cast",
- ]
+ ldflags += [ "-fsanitize=cfi-vcall" ]
+ if (use_cfi_cast) {
+ ldflags += [
+ "-fsanitize=cfi-derived-cast",
+ "-fsanitize=cfi-unrelated-cast",
+ ]
+ }
if (use_cfi_diag) {
ldflags += [
"-fno-sanitize-trap=cfi",
@@ -255,11 +257,16 @@ config("cfi_flags") {
rebase_path("//tools/cfi/blacklist.txt", root_build_dir)
cflags += [
"-fsanitize=cfi-vcall",
- "-fsanitize=cfi-derived-cast",
- "-fsanitize=cfi-unrelated-cast",
"-fsanitize-blacklist=$cfi_blacklist_path",
]
+ if (use_cfi_cast) {
+ cflags += [
+ "-fsanitize=cfi-derived-cast",
+ "-fsanitize=cfi-unrelated-cast",
+ ]
+ }
+
if (use_cfi_diag) {
cflags += [
"-fno-sanitize-trap=cfi",
« no previous file with comments | « build/common.gypi ('k') | build/config/sanitizers/sanitizers.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698