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/toolchain/toolchain.gni") | 5 import("//build/toolchain/toolchain.gni") |
6 | 6 |
7 # This config causes functions not to be automatically exported from shared | 7 # This config causes functions not to be automatically exported from shared |
8 # libraries. By default, all symbols are exported but this means there are | 8 # 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 | 9 # lots of exports that slow everything down. In general we explicitly mark |
10 # which functiosn we want to export from components. | 10 # which functiosn we want to export from components. |
sdefresne
2016/01/07 11:12:03
nit: s/functiosn/functions/
| |
11 # | 11 # |
12 # Some third_party code assumes all functions are exported so this is separated | 12 # 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 | 13 # into its own config so such libraries can remove this config to make symbols |
14 # public again. | 14 # public again. |
15 # | 15 # |
16 # See http://gcc.gnu.org/wiki/Visibility | 16 # See http://gcc.gnu.org/wiki/Visibility |
17 config("symbol_visibility_hidden") { | 17 config("symbol_visibility_hidden") { |
18 # Note that -fvisibility-inlines-hidden is set globally in the compiler | 18 # Note that -fvisibility-inlines-hidden is set globally in the compiler |
19 # config since that can almost always be applied. | 19 # config since that can almost always be applied. |
20 cflags = [ "-fvisibility=hidden" ] | 20 cflags = [ "-fvisibility=hidden" ] |
21 } | 21 } |
22 | 22 |
23 # Set the appropriate default symbol visibility based on existing | |
24 # configurations. | |
25 config("default_symbol_visibility") { | |
26 # XCTests inject a dynamic library into an iOS application. If fvisibility | |
27 # is set to hidden, then some symbols from the application needed by XCTests | |
28 # are not available. Make sure all symbols are exported for Debug | |
29 # configuration on iOS so XCTests will work. | |
30 if (!is_ios || is_release) { | |
31 configs = [ ":symbol_visibility_hidden" ] | |
32 } | |
33 } | |
34 | |
23 # The rpath is the dynamic library search path. Setting this config on a link | 35 # The rpath is the dynamic library search path. Setting this config on a link |
24 # step will put the directory where the build generates shared libraries into | 36 # step will put the directory where the build generates shared libraries into |
25 # the rpath. | 37 # the rpath. |
26 # | 38 # |
27 # It's important that this *not* be used for release builds we push out. | 39 # It's important that this *not* be used for release builds we push out. |
28 # Chrome uses some setuid binaries, and hard links preserve setuid bits. An | 40 # Chrome uses some setuid binaries, and hard links preserve setuid bits. An |
29 # unprivileged user could gain root privileges by hardlinking a setuid | 41 # unprivileged user could gain root privileges by hardlinking a setuid |
30 # executable and then adding in whatever binaries they want to run into the lib | 42 # executable and then adding in whatever binaries they want to run into the lib |
31 # directory. | 43 # directory. |
32 # | 44 # |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
78 # and the new DT_RUNPATH doesn't work without --no-as-needed flag. | 90 # and the new DT_RUNPATH doesn't work without --no-as-needed flag. |
79 "-Wl,--disable-new-dtags", | 91 "-Wl,--disable-new-dtags", |
80 ] | 92 ] |
81 } | 93 } |
82 } | 94 } |
83 | 95 |
84 config("no_exceptions") { | 96 config("no_exceptions") { |
85 cflags_cc = [ "-fno-exceptions" ] | 97 cflags_cc = [ "-fno-exceptions" ] |
86 cflags_objcc = cflags_cc | 98 cflags_objcc = cflags_cc |
87 } | 99 } |
OLD | NEW |