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

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

Issue 1809273002: Enable whole-program virtual function optimization in LTO mode. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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/config/compiler/BUILD.gn ('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 33497235a58613ae9eb6b58d9b894ef255dbe835..29bb7f1c03f05e0152cc1daa74502fe8bac23919 100644
--- a/build/config/sanitizers/BUILD.gn
+++ b/build/config/sanitizers/BUILD.gn
@@ -94,36 +94,13 @@ config("default_sanitizer_ldflags") {
if (is_ubsan_vptr) {
ldflags += [ "-fsanitize=vptr" ]
}
- if (is_lto && !is_nacl) {
- ldflags += [ "-flto" ]
-
- # Apply a lower LTO optimization level as the default is too slow.
- if (is_linux) {
- ldflags += [ "-Wl,-plugin-opt,O1" ]
- } else if (is_mac) {
- ldflags += [ "-Wl,-mllvm,-O1" ]
- }
-
- # Work-around for http://openradar.appspot.com/20356002
- if (is_mac) {
- ldflags += [ "-Wl,-all_load" ]
- }
-
- # Without this flag, LTO produces a .text section that is larger
- # than the maximum call displacement, preventing the linker from
- # relocating calls (http://llvm.org/PR22999).
- if (current_cpu == "arm") {
- ldflags += [ "-Wl,-plugin-opt,-function-sections" ]
- }
-
- if (is_cfi) {
- ldflags += [
- "-fsanitize=cfi-vcall",
- "-fsanitize=cfi-derived-cast",
- "-fsanitize=cfi-unrelated-cast",
- ]
- }
+ if (is_cfi && !is_nacl) {
+ ldflags += [
+ "-fsanitize=cfi-vcall",
+ "-fsanitize=cfi-derived-cast",
+ "-fsanitize=cfi-unrelated-cast",
+ ]
if (use_cfi_diag) {
ldflags += [
"-fno-sanitize-trap=cfi",
@@ -156,7 +133,7 @@ config("default_sanitizer_flags") {
# Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer,
# MemorySanitizer and non-official CFI builds.
- if (using_sanitizer || (is_lto && !is_official_build)) {
+ if (using_sanitizer || (is_cfi && !is_official_build)) {
if (is_posix) {
cflags += [ "-fno-omit-frame-pointer" ]
} else {
@@ -282,19 +259,15 @@ config("default_sanitizer_flags") {
"-fsanitize-blacklist=$ubsan_blacklist_path",
]
}
- if (is_lto && !is_nacl) {
- cflags += [ "-flto" ]
-
- if (is_cfi) {
- cfi_blacklist_path =
- 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 (is_cfi && !is_nacl) {
+ cfi_blacklist_path =
+ 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_diag) {
cflags += [
« no previous file with comments | « build/config/compiler/BUILD.gn ('k') | build/config/sanitizers/sanitizers.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698