OLD | NEW |
1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 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/c++/c++.gni") |
5 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
6 import("//build/toolchain/toolchain.gni") | 7 import("//build/toolchain/toolchain.gni") |
7 | 8 |
8 # Sanitizer builds need to override operator new, operator delete, and | |
9 # some exception handling symbols, so libc++ must be a shared library | |
10 # to prevent duplicate symbol errors when linking. | |
11 libcpp_is_static = !is_component_build && !using_sanitizer | |
12 | |
13 # Used by libc++ and libc++abi. | 9 # Used by libc++ and libc++abi. |
14 config("config") { | 10 config("config") { |
15 defines = [ "LIBCXX_BUILDING_LIBCXXABI" ] | 11 defines = [ "LIBCXX_BUILDING_LIBCXXABI" ] |
16 if (libcpp_is_static) { | 12 if (libcpp_is_static) { |
17 # Don't leak any symbols on a static build. | 13 # Don't leak any symbols on a static build. |
18 defines += [ | 14 defines += [ |
19 "_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS", | 15 "_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS", |
20 "_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS", | 16 "_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS", |
21 | 17 |
22 # This resets the visibility to default only for the various | 18 # This resets the visibility to default only for the various |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 "//build/config/compiler:no_chromium_code", | 85 "//build/config/compiler:no_chromium_code", |
90 "//build/config/compiler:rtti", | 86 "//build/config/compiler:rtti", |
91 "//build/config/sanitizers:sanitizer_options_link_helper", | 87 "//build/config/sanitizers:sanitizer_options_link_helper", |
92 ] | 88 ] |
93 defines = [ "_LIBCPP_BUILDING_LIBRARY" ] | 89 defines = [ "_LIBCPP_BUILDING_LIBRARY" ] |
94 | 90 |
95 deps = [ | 91 deps = [ |
96 "//buildtools/third_party/libc++abi", | 92 "//buildtools/third_party/libc++abi", |
97 ] | 93 ] |
98 } | 94 } |
OLD | NEW |