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/sanitizers/sanitizers.gni") |
5 import("//build/toolchain/toolchain.gni") | 6 import("//build/toolchain/toolchain.gni") |
6 | 7 |
7 # This config causes functions not to be automatically exported from shared | 8 # This config causes functions not to be automatically exported from shared |
8 # libraries. By default, all symbols are exported but this means there are | 9 # libraries. By default, all symbols are exported but this means there are |
9 # lots of exports that slow everything down. In general we explicitly mark | 10 # lots of exports that slow everything down. In general we explicitly mark |
10 # which functiosn we want to export from components. | 11 # which functiosn we want to export from components. |
11 # | 12 # |
12 # Some third_party code assumes all functions are exported so this is separated | 13 # Some third_party code assumes all functions are exported so this is separated |
13 # into its own config so such libraries can remove this config to make symbols | 14 # into its own config so such libraries can remove this config to make symbols |
14 # public again. | 15 # public again. |
(...skipping 45 matching lines...) Loading... |
60 } | 61 } |
61 | 62 |
62 # Settings for executables and shared libraries. | 63 # Settings for executables and shared libraries. |
63 config("executable_ldconfig") { | 64 config("executable_ldconfig") { |
64 if (is_android) { | 65 if (is_android) { |
65 ldflags = [ | 66 ldflags = [ |
66 "-Bdynamic", | 67 "-Bdynamic", |
67 "-Wl,-z,nocopyreloc", | 68 "-Wl,-z,nocopyreloc", |
68 ] | 69 ] |
69 } else { | 70 } else { |
70 if (is_component_build) { | 71 # See the rpath_for... config above for why this is necessary for component |
| 72 # builds. Sanitizers use a custom libc++ where this is also necessary. |
| 73 if (is_component_build || using_sanitizer) { |
71 configs = [ ":rpath_for_built_shared_libraries" ] | 74 configs = [ ":rpath_for_built_shared_libraries" ] |
72 } | 75 } |
73 | 76 |
74 ldflags = [ | 77 ldflags = [ |
75 # TODO(GYP): Do we need a check on the binutils version here? | 78 # TODO(GYP): Do we need a check on the binutils version here? |
76 # | 79 # |
77 # Newer binutils don't set DT_RPATH unless you disable "new" dtags | 80 # Newer binutils don't set DT_RPATH unless you disable "new" dtags |
78 # and the new DT_RUNPATH doesn't work without --no-as-needed flag. | 81 # and the new DT_RUNPATH doesn't work without --no-as-needed flag. |
79 "-Wl,--disable-new-dtags", | 82 "-Wl,--disable-new-dtags", |
80 ] | 83 ] |
81 } | 84 } |
82 } | 85 } |
83 | 86 |
84 config("no_exceptions") { | 87 config("no_exceptions") { |
85 cflags_cc = [ "-fno-exceptions" ] | 88 cflags_cc = [ "-fno-exceptions" ] |
86 cflags_objcc = cflags_cc | 89 cflags_objcc = cflags_cc |
87 } | 90 } |
OLD | NEW |