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. |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 "trunk/src/stdexcept.cpp", | 91 "trunk/src/stdexcept.cpp", |
92 "trunk/src/string.cpp", | 92 "trunk/src/string.cpp", |
93 "trunk/src/strstream.cpp", | 93 "trunk/src/strstream.cpp", |
94 "trunk/src/system_error.cpp", | 94 "trunk/src/system_error.cpp", |
95 "trunk/src/thread.cpp", | 95 "trunk/src/thread.cpp", |
96 "trunk/src/typeinfo.cpp", | 96 "trunk/src/typeinfo.cpp", |
97 "trunk/src/utility.cpp", | 97 "trunk/src/utility.cpp", |
98 "trunk/src/valarray.cpp", | 98 "trunk/src/valarray.cpp", |
99 "trunk/src/variant.cpp", | 99 "trunk/src/variant.cpp", |
100 ] | 100 ] |
| 101 if (libcpp_is_static) { |
| 102 # Current gcc and clang do not allow declaring several allocation |
| 103 # operators with hidden visibility [1] [2], however we don't want |
| 104 # these symbols exported on static builds. This is a workaround |
| 105 # that takes advantage of an ELF visibility merging rule that |
| 106 # picks the "most hidden" visibility of all versions of a symbol, |
| 107 # even if the symbol is undefined. |
| 108 # |
| 109 # [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81107 |
| 110 # [2] https://bugs.llvm.org/show_bug.cgi?id=33473 |
| 111 sources += [ "alloc_visibility_overrides.S" ] |
| 112 } |
101 configs -= [ | 113 configs -= [ |
102 "//build/config/compiler:chromium_code", | 114 "//build/config/compiler:chromium_code", |
103 "//build/config/compiler:no_rtti", | 115 "//build/config/compiler:no_rtti", |
104 "//build/config/gcc:no_exceptions", | 116 "//build/config/gcc:no_exceptions", |
105 ] | 117 ] |
106 configs += [ | 118 configs += [ |
107 ":config", | 119 ":config", |
108 ":no_libstdcpp", | 120 ":no_libstdcpp", |
109 "//build/config/compiler:no_chromium_code", | 121 "//build/config/compiler:no_chromium_code", |
110 "//build/config/compiler:rtti", | 122 "//build/config/compiler:rtti", |
(...skipping 24 matching lines...) Expand all Loading... |
135 # Normally the generator takes care of RPATH. Our case is special because | 147 # 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 | 148 # 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 | 149 # 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 | 150 # example of this issue: https://code.google.com/p/gyp/issues/detail?id=31
5 |
139 "-Wl,-rpath,\$ORIGIN/", | 151 "-Wl,-rpath,\$ORIGIN/", |
140 ] | 152 ] |
141 } | 153 } |
142 | 154 |
143 lib_dirs = [ root_build_dir ] | 155 lib_dirs = [ root_build_dir ] |
144 } | 156 } |
OLD | NEW |