| 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/config/sanitizers/sanitizers.gni") |
| 6 import("//build/toolchain/toolchain.gni") | 6 import("//build/toolchain/toolchain.gni") |
| 7 | 7 |
| 8 # This config causes functions not to be automatically exported from shared | 8 # This config causes functions not to be automatically exported from shared |
| 9 # 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 |
| 10 # 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 |
| 11 # which functiosn we want to export from components. | 11 # which functiosn we want to export from components. |
| 12 # | 12 # |
| 13 # 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 |
| 14 # 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 |
| 15 # public again. | 15 # public again. |
| 16 # | 16 # |
| 17 # See http://gcc.gnu.org/wiki/Visibility | 17 # See http://gcc.gnu.org/wiki/Visibility |
| 18 config("symbol_visibility_hidden") { | 18 config("symbol_visibility_hidden") { |
| 19 # Note that -fvisibility-inlines-hidden is set globally in the compiler | 19 # Note that -fvisibility-inlines-hidden is set globally in the compiler |
| 20 # config since that can almost always be applied. | 20 # config since that can almost always be applied. |
| 21 cflags = [ "-fvisibility=hidden" ] | 21 cflags = [ "-fvisibility=hidden" ] |
| 22 } | 22 } |
| 23 | 23 |
| 24 # This config is usually set when :symbol_visibility_hidden is removed. |
| 25 # It's often a good idea to set visibility explicitly, as there're flags |
| 26 # which would error out otherwise (e.g. -fsanitize=cfi-unrelated-cast) |
| 27 config("symbol_visibility_default") { |
| 28 cflags = [ "-fvisibility=default" ] |
| 29 } |
| 30 |
| 24 # The rpath is the dynamic library search path. Setting this config on a link | 31 # The rpath is the dynamic library search path. Setting this config on a link |
| 25 # step will put the directory where the build generates shared libraries into | 32 # step will put the directory where the build generates shared libraries into |
| 26 # the rpath. | 33 # the rpath. |
| 27 # | 34 # |
| 28 # It's important that this *not* be used for release builds we push out. | 35 # It's important that this *not* be used for release builds we push out. |
| 29 # Chrome uses some setuid binaries, and hard links preserve setuid bits. An | 36 # Chrome uses some setuid binaries, and hard links preserve setuid bits. An |
| 30 # unprivileged user could gain root privileges by hardlinking a setuid | 37 # unprivileged user could gain root privileges by hardlinking a setuid |
| 31 # executable and then adding in whatever binaries they want to run into the lib | 38 # executable and then adding in whatever binaries they want to run into the lib |
| 32 # directory. | 39 # directory. |
| 33 # | 40 # |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 if (current_cpu == "mipsel") { | 103 if (current_cpu == "mipsel") { |
| 97 ldflags += [ "-pie" ] | 104 ldflags += [ "-pie" ] |
| 98 } | 105 } |
| 99 } | 106 } |
| 100 } | 107 } |
| 101 | 108 |
| 102 config("no_exceptions") { | 109 config("no_exceptions") { |
| 103 cflags_cc = [ "-fno-exceptions" ] | 110 cflags_cc = [ "-fno-exceptions" ] |
| 104 cflags_objcc = cflags_cc | 111 cflags_objcc = cflags_cc |
| 105 } | 112 } |
| OLD | NEW |