| 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 += [
|
|
|