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

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 1158643002: GN: Build with a custom libc++ when using ASAN, TSAN or MSAN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-instrumented-libraries-prebuilt
Patch Set: rebase Created 5 years, 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | build/config/sanitizers/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 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/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 if (current_cpu == "arm") { 7 if (current_cpu == "arm") {
8 import("//build/config/arm.gni") 8 import("//build/config/arm.gni")
9 } 9 }
10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { 10 if (current_cpu == "mipsel" || current_cpu == "mips64el") {
11 import("//build/config/mips.gni") 11 import("//build/config/mips.gni")
12 } 12 }
13 if (is_posix) { 13 if (is_posix) {
14 import("//build/config/gcc/gcc_version.gni") 14 import("//build/config/gcc/gcc_version.gni")
15 } 15 }
16 16
17 import("//build/toolchain/ccache.gni") 17 import("//build/toolchain/ccache.gni")
18 import("//build/config/sanitizers/sanitizers.gni")
18 19
19 declare_args() { 20 declare_args() {
20 # Normally, Android builds are lightly optimized, even for debug builds, to 21 # Normally, Android builds are lightly optimized, even for debug builds, to
21 # keep binary size down. Setting this flag to true disables such optimization 22 # keep binary size down. Setting this flag to true disables such optimization
22 android_full_debug = false 23 android_full_debug = false
23 24
24 # Whether to use the binary binutils checked into third_party/binutils. 25 # Whether to use the binary binutils checked into third_party/binutils.
25 # These are not multi-arch so cannot be used except on x86 and x86-64 (the 26 # These are not multi-arch so cannot be used except on x86 and x86-64 (the
26 # only two architectures that are currently checked in). Turn this off when 27 # only two architectures that are currently checked in). Turn this off when
27 # you are using a custom toolchain and need to control -B in cflags. 28 # you are using a custom toolchain and need to control -B in cflags.
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 } 169 }
169 if (is_msan) { 170 if (is_msan) {
170 msan_blacklist_path = 171 msan_blacklist_path =
171 rebase_path("//tools/msan/blacklist.txt", root_build_dir) 172 rebase_path("//tools/msan/blacklist.txt", root_build_dir)
172 cflags += [ 173 cflags += [
173 "-fsanitize=memory", 174 "-fsanitize=memory",
174 "-fsanitize-memory-track-origins=$msan_track_origins", 175 "-fsanitize-memory-track-origins=$msan_track_origins",
175 "-fsanitize-blacklist=$msan_blacklist_path", 176 "-fsanitize-blacklist=$msan_blacklist_path",
176 ] 177 ]
177 178
178 # TODO(GYP): Support instrumented libraries and custom libc++. 179 # TODO(GYP): Support instrumented libraries.
180 }
181
182 if (use_custom_libcxx) {
183 cflags_cc += [ "-nostdinc++" ]
184 include_dirs = [
185 "//buildtools/third_party/libc++/trunk/include",
186 "//buildtools/third_party/libc++abi/trunk/include",
187 ]
179 } 188 }
180 } 189 }
181 190
182 if (is_clang && is_debug) { 191 if (is_clang && is_debug) {
183 # Allow comparing the address of references and 'this' against 0 192 # Allow comparing the address of references and 'this' against 0
184 # in debug builds. Technically, these can never be null in 193 # in debug builds. Technically, these can never be null in
185 # well-defined C/C++ and Clang can optimize such checks away in 194 # well-defined C/C++ and Clang can optimize such checks away in
186 # release builds, but they may be used in asserts in debug builds. 195 # release builds, but they may be used in asserts in debug builds.
187 cflags_cc += [ 196 cflags_cc += [
188 "-Wno-undefined-bool-conversion", 197 "-Wno-undefined-bool-conversion",
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 cflags += [ "-gsplit-dwarf" ] 1172 cflags += [ "-gsplit-dwarf" ]
1164 } 1173 }
1165 } 1174 }
1166 } 1175 }
1167 1176
1168 config("no_symbols") { 1177 config("no_symbols") {
1169 if (!is_win) { 1178 if (!is_win) {
1170 cflags = [ "-g0" ] 1179 cflags = [ "-g0" ]
1171 } 1180 }
1172 } 1181 }
OLDNEW
« no previous file with comments | « no previous file | build/config/sanitizers/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698