| 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/compiler/compiler.gni") | 5 import("//build/config/compiler/compiler.gni") |
| 6 import("//build/config/sanitizers/sanitizers.gni") | 6 import("//build/config/sanitizers/sanitizers.gni") |
| 7 import("//build/config/sysroot.gni") | 7 import("//build/config/sysroot.gni") |
| 8 import("//build/toolchain/toolchain.gni") | 8 import("//build/toolchain/toolchain.gni") |
| 9 | 9 |
| 10 declare_args() { | 10 declare_args() { |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 # | 25 # |
| 26 # Some third_party code assumes all functions are exported so this is separated | 26 # Some third_party code assumes all functions are exported so this is separated |
| 27 # into its own config so such libraries can remove this config to make symbols | 27 # into its own config so such libraries can remove this config to make symbols |
| 28 # public again. | 28 # public again. |
| 29 # | 29 # |
| 30 # See http://gcc.gnu.org/wiki/Visibility | 30 # See http://gcc.gnu.org/wiki/Visibility |
| 31 config("symbol_visibility_hidden") { | 31 config("symbol_visibility_hidden") { |
| 32 # Note that -fvisibility-inlines-hidden is set globally in the compiler | 32 # Note that -fvisibility-inlines-hidden is set globally in the compiler |
| 33 # config since that can almost always be applied. | 33 # config since that can almost always be applied. |
| 34 cflags = [ "-fvisibility=hidden" ] | 34 cflags = [ "-fvisibility=hidden" ] |
| 35 |
| 36 # Visibility attribute is not supported on AIX. |
| 37 if (current_os != "aix") { |
| 38 cflags_cc = [ |
| 39 # Not exporting C++ inline functions can generally be applied anywhere |
| 40 # so we do so here. Normal function visibility is controlled by |
| 41 # //build/config/gcc:symbol_visibility_hidden. |
| 42 "-fvisibility-inlines-hidden", |
| 43 ] |
| 44 } |
| 35 } | 45 } |
| 36 | 46 |
| 37 # This config is usually set when :symbol_visibility_hidden is removed. | 47 # This config is usually set when :symbol_visibility_hidden is removed. |
| 38 # It's often a good idea to set visibility explicitly, as there're flags | 48 # It's often a good idea to set visibility explicitly, as there're flags |
| 39 # which would error out otherwise (e.g. -fsanitize=cfi-unrelated-cast) | 49 # which would error out otherwise (e.g. -fsanitize=cfi-unrelated-cast) |
| 40 config("symbol_visibility_default") { | 50 config("symbol_visibility_default") { |
| 41 cflags = [ "-fvisibility=default" ] | 51 cflags = [ "-fvisibility=default" ] |
| 42 } | 52 } |
| 43 | 53 |
| 44 # The rpath is the dynamic library search path. Setting this config on a link | 54 # The rpath is the dynamic library search path. Setting this config on a link |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 # and the new DT_RUNPATH doesn't work without --no-as-needed flag. | 142 # and the new DT_RUNPATH doesn't work without --no-as-needed flag. |
| 133 "-Wl,--disable-new-dtags", | 143 "-Wl,--disable-new-dtags", |
| 134 ] | 144 ] |
| 135 } | 145 } |
| 136 } | 146 } |
| 137 | 147 |
| 138 config("no_exceptions") { | 148 config("no_exceptions") { |
| 139 cflags_cc = [ "-fno-exceptions" ] | 149 cflags_cc = [ "-fno-exceptions" ] |
| 140 cflags_objcc = cflags_cc | 150 cflags_objcc = cflags_cc |
| 141 } | 151 } |
| OLD | NEW |