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
3 # found in the LICENSE file.
5 import("//build/toolchain/toolchain.gni")
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
9 # lots of exports that slow everything down. In general we explicitly mark
10 # which functiosn we want to export from components.
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
16 # See http://gcc.gnu.org/wiki/Visibility
17 config("symbol_visibility_hidden") {
18 # Note that -fvisibility-inlines-hidden is set globally in the compiler
19 # config since that can almost always be applied.
20 cflags = [ "-fvisibility=hidden" ]
23 # Settings for executables and shared libraries.
24 config("executable_ldconfig") {
31 # Note: Android doesn't support rpath.
33 if (shlib_subdir != ".") {
34 rpath_link = "${shlib_subdir}/"
37 # Want to pass "\$". GN will re-escape as required for ninja.
38 "-Wl,-rpath=\$ORIGIN/${rpath_link}",
39 "-Wl,-rpath-link=${rpath_link}",
41 # Newer binutils don't set DT_RPATH unless you disable "new" dtags
42 # and the new DT_RUNPATH doesn't work without --no-as-needed flag.
43 "-Wl,--disable-new-dtags",
48 config("no_exceptions") {
49 cflags_cc = [ "-fno-exceptions" ]
50 cflags_objcc = cflags_cc