| OLD | NEW |
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import("//build/config/chrome_build.gni") | 5 import("//build/config/chrome_build.gni") |
| 6 import("//build/config/chromecast_build.gni") | 6 import("//build/config/chromecast_build.gni") |
| 7 import("//build/config/sanitizers/sanitizers.gni") | 7 import("//build/config/sanitizers/sanitizers.gni") |
| 8 | 8 |
| 9 # Contains the dependencies needed for sanitizers to link into executables and | 9 # Contains the dependencies needed for sanitizers to link into executables and |
| 10 # shared_libraries. Unconditionally depend upon this target as it is empty if | 10 # shared_libraries. Unconditionally depend upon this target as it is empty if |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 # This needs to be in a separate config so that targets can opt out of | 143 # This needs to be in a separate config so that targets can opt out of |
| 144 # sanitizers (by removing the config) if they desire. Even if a target | 144 # sanitizers (by removing the config) if they desire. Even if a target |
| 145 # removes this config, executables & shared libraries should still depend on | 145 # removes this config, executables & shared libraries should still depend on |
| 146 # :deps if any of their dependencies have not opted out of sanitizers. | 146 # :deps if any of their dependencies have not opted out of sanitizers. |
| 147 config("default_sanitizer_flags") { | 147 config("default_sanitizer_flags") { |
| 148 cflags = [] | 148 cflags = [] |
| 149 cflags_cc = [] | 149 cflags_cc = [] |
| 150 defines = [] | 150 defines = [] |
| 151 configs = [ ":default_sanitizer_ldflags" ] | 151 configs = [ ":default_sanitizer_ldflags" ] |
| 152 | 152 |
| 153 # Sanitizers need line table info for stack traces. They don't need type info |
| 154 # or variable info, so we can leave that out to speed up the build. |
| 155 if (is_clang && using_sanitizer) { |
| 156 cflags += [ "-gline-tables-only" ] |
| 157 } |
| 158 |
| 153 # Only works on Posix-like platforms. | 159 # Only works on Posix-like platforms. |
| 154 # FIXME: this is not true, remove the conditional. | 160 # FIXME: this is not true, remove the conditional. |
| 155 if (is_posix) { | 161 if (is_posix) { |
| 156 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer, | 162 # Common options for AddressSanitizer, LeakSanitizer, ThreadSanitizer, |
| 157 # MemorySanitizer and non-official CFI builds. | 163 # MemorySanitizer and non-official CFI builds. |
| 158 if (using_sanitizer || (is_lto && !is_official_build)) { | 164 if (using_sanitizer || (is_lto && !is_official_build)) { |
| 159 cflags += [ | 165 cflags += [ "-fno-omit-frame-pointer" ] |
| 160 "-fno-omit-frame-pointer", | |
| 161 "-gline-tables-only", | |
| 162 ] | |
| 163 } | 166 } |
| 164 if (is_asan) { | 167 if (is_asan) { |
| 165 asan_blacklist_path = | 168 asan_blacklist_path = |
| 166 rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir) | 169 rebase_path("//tools/memory/asan/blacklist.txt", root_build_dir) |
| 167 cflags += [ | 170 cflags += [ |
| 168 "-fsanitize=address", | 171 "-fsanitize=address", |
| 169 "-fsanitize-blacklist=$asan_blacklist_path", | 172 "-fsanitize-blacklist=$asan_blacklist_path", |
| 170 ] | 173 ] |
| 171 if (is_android) { | 174 if (is_android) { |
| 172 # Android build relies on -Wl,--gc-sections removing unreachable code. | 175 # Android build relies on -Wl,--gc-sections removing unreachable code. |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 322 sources = [ | 325 sources = [ |
| 323 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_
rt.asan_osx_dynamic.dylib", | 326 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_
rt.asan_osx_dynamic.dylib", |
| 324 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_
rt.tsan_osx_dynamic.dylib", | 327 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_
rt.tsan_osx_dynamic.dylib", |
| 325 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_
rt.ubsan_osx_dynamic.dylib", | 328 "//third_party/llvm-build/Release+Asserts/compiler-rt/lib/darwin/libclang_
rt.ubsan_osx_dynamic.dylib", |
| 326 ] | 329 ] |
| 327 outputs = [ | 330 outputs = [ |
| 328 "$root_build_dir/{{source_file_part}}", | 331 "$root_build_dir/{{source_file_part}}", |
| 329 ] | 332 ] |
| 330 } | 333 } |
| 331 } | 334 } |
| OLD | NEW |