Index: build/config/sanitizers/BUILD.gn |
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn |
index 67d9568c22cb7d380c0fc071f794f294e1c455e5..637fc881174f37fbcf016d8e314c1f3315ba55fb 100644 |
--- a/build/config/sanitizers/BUILD.gn |
+++ b/build/config/sanitizers/BUILD.gn |
@@ -218,10 +218,10 @@ config("default_sanitizer_ldflags") { |
] |
} |
if (use_cfi_diag) { |
- ldflags += [ |
- "-fno-sanitize-trap=cfi", |
- "-fsanitize-recover=cfi", |
- ] |
+ ldflags += [ "-fno-sanitize-trap=cfi" ] |
+ if (use_cfi_recover) { |
+ ldflags += [ "-fsanitize-recover=cfi" ] |
+ } |
} |
} |
} else if (is_win && is_asan) { |
@@ -382,12 +382,14 @@ config("cfi_flags") { |
if (use_cfi_diag) { |
cflags += [ |
"-fno-sanitize-trap=cfi", |
- "-fsanitize-recover=cfi", |
"-fno-inline-functions", |
"-fno-inline", |
"-fno-omit-frame-pointer", |
"-O1", |
] |
+ if (use_cfi_recover) { |
+ cflags += [ "-fsanitize-recover=cfi" ] |
+ } |
} else { |
defines = [ "CFI_ENFORCEMENT" ] |
} |