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

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

Issue 1374423002: Add UBsan vtpr support to GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-ubsan
Patch Set: Created 5 years, 3 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
Index: build/config/sanitizers/BUILD.gn
diff --git a/build/config/sanitizers/BUILD.gn b/build/config/sanitizers/BUILD.gn
index c06e4e7721fe8a4aa184632b5045cb3848ebb65c..296c6c6c3b0f3a9ed78c6889b475b02522567e1a 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -8,7 +8,7 @@ import("//build/config/sanitizers/sanitizers.gni")
# shared_libraries. Unconditionally depend upon this target as it is empty if
# |is_asan|, |is_lsan|, |is_tsan|, |is_msan| and |use_custom_libcxx| are false.
group("deps") {
- if (is_asan || is_lsan || is_tsan || is_msan || is_ubsan) {
+ if (using_sanitizer) {
public_configs = [ ":sanitizer_options_link_helper" ]
deps = [
":options_sources",
@@ -40,6 +40,9 @@ config("sanitizer_options_link_helper") {
if (is_ubsan) {
ldflags += [ "-fsanitize=undefined" ]
}
+ if (is_ubsan_vptr) {
+ ldflags += [ "-fsanitize=vptr" ]
+ }
}
source_set("options_sources") {
@@ -153,6 +156,14 @@ config("default_sanitizer_flags") {
"-pbqp-coalescing",
]
}
+ if (is_ubsan_vptr) {
+ ubsan_vptr_blacklist_path =
+ rebase_path("//tools/ubsan/vptr_blacklist.txt", root_build_dir)
+ cflags += [
+ "-fsanitize=vptr",
+ "-fsanitize-blacklist=$ubsan_vptr_blacklist_path",
+ ]
+ }
if (is_cfi && !is_nacl) {
cfi_blacklist_path =
rebase_path("//tools/cfi/blacklist.txt", root_build_dir)

Powered by Google App Engine
This is Rietveld 408576698