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/sanitizers/sanitizers.gni") | 5 import("//build/config/sanitizers/sanitizers.gni") |
6 import("//build/toolchain/toolchain.gni") | 6 import("//build/toolchain/toolchain.gni") |
7 | 7 |
8 # Sanitizer builds need to override operator new, operator delete, and | 8 # Sanitizer builds need to override operator new, operator delete, and |
9 # some exception handling symbols, so libc++ must be a shared library | 9 # some exception handling symbols, so libc++ must be a shared library |
10 # to prevent duplicate symbol errors when linking. | 10 # to prevent duplicate symbol errors when linking. |
11 libcpp_is_static = !is_component_build && !using_sanitizer | 11 libcpp_is_static = !is_component_build && !using_sanitizer |
12 | 12 |
13 # Used by libc++ and libc++abi. | 13 # Used by libc++ and libc++abi. |
14 config("config") { | 14 config("config") { |
15 defines = [ "LIBCXX_BUILDING_LIBCXXABI" ] | 15 defines = [ "LIBCXX_BUILDING_LIBCXXABI" ] |
16 if (libcpp_is_static) { | 16 if (libcpp_is_static) { |
17 # Don't leak any symbols on a static build. | 17 # Don't leak any symbols on a static build. |
18 defines += [ | 18 defines += [ |
19 "_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS", | 19 "_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS", |
20 "_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS", | 20 "_LIBCXXABI_DISABLE_VISIBILITY_ANNOTATIONS", |
21 | |
22 # This resets the visibility to default only for the various | |
23 # flavors of operator new and operator delete. These symbols | |
24 # are weak and get overriden by Chromium-provided ones, but if | |
25 # these symbols had hidden visibility, this would make the | |
26 # Chromium symbols hidden too. | |
27 "_LIBCPP_OVERRIDABLE_FUNC_VIS=__attribute__((__visibility__(\"default\"))) ", | |
Nico
2017/06/19 19:22:41
Can you add a comment here along the lines of "
el
Tom Anderson
2017/06/19 19:27:40
Done.
| |
21 ] | 28 ] |
22 } | 29 } |
23 cflags = [ | 30 cflags = [ |
24 "-fPIC", | 31 "-fPIC", |
25 "-fstrict-aliasing", | 32 "-fstrict-aliasing", |
26 ] | 33 ] |
27 cflags_cc = [ | 34 cflags_cc = [ |
28 "-nostdinc++", | 35 "-nostdinc++", |
29 "-isystem" + rebase_path("trunk/include", root_build_dir), | 36 "-isystem" + rebase_path("trunk/include", root_build_dir), |
30 "-isystem" + rebase_path("../libc++abi/trunk/include", root_build_dir), | 37 "-isystem" + rebase_path("../libc++abi/trunk/include", root_build_dir), |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
135 # Normally the generator takes care of RPATH. Our case is special because | 142 # Normally the generator takes care of RPATH. Our case is special because |
136 # the generator is unaware of the libc++.so dependency. Note that setting | 143 # the generator is unaware of the libc++.so dependency. Note that setting |
137 # RPATH here is a potential security issue. See the following for another | 144 # RPATH here is a potential security issue. See the following for another |
138 # example of this issue: https://code.google.com/p/gyp/issues/detail?id=31 5 | 145 # example of this issue: https://code.google.com/p/gyp/issues/detail?id=31 5 |
139 "-Wl,-rpath,\$ORIGIN/", | 146 "-Wl,-rpath,\$ORIGIN/", |
140 ] | 147 ] |
141 } | 148 } |
142 | 149 |
143 lib_dirs = [ root_build_dir ] | 150 lib_dirs = [ root_build_dir ] |
144 } | 151 } |
OLD | NEW |