summaryrefslogtreecommitdiffstats
path: root/chromium/build/config/gcc/BUILD.gn
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/build/config/gcc/BUILD.gn')
-rw-r--r--chromium/build/config/gcc/BUILD.gn41
1 files changed, 41 insertions, 0 deletions
diff --git a/chromium/build/config/gcc/BUILD.gn b/chromium/build/config/gcc/BUILD.gn
new file mode 100644
index 00000000000..d5b9ddb4579
--- /dev/null
+++ b/chromium/build/config/gcc/BUILD.gn
@@ -0,0 +1,41 @@
+# Copyright 2014 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+
+# This config causes functions not to be automatically exported from shared
+# libraries. By default, all symbols are exported but this means there are
+# lots of exports that slow everything down. In general we explicitly mark
+# which functiosn we want to export from components.
+#
+# Some third_party code assumes all functions are exported so this is separated
+# into its own config so such libraries can remove this config to make symbols
+# public again.
+#
+# See http://gcc.gnu.org/wiki/Visibility
+config("symbol_visibility_hidden") {
+ # Note that -fvisibility-inlines-hidden is set globally in the compiler
+ # config since that can almost always be applied.
+ cflags = [ "-fvisibility=hidden" ]
+}
+
+# Settings for executables and shared libraries.
+config("executable_ldconfig") {
+ ldflags = [
+ # Want to pass "\$". Need to escape both '\' and '$'. GN will re-escape as
+ # required for ninja.
+ "-Wl,-rpath=\\\$ORIGIN/lib/",
+
+ "-Wl,-rpath-link=lib/",
+ ]
+
+ if (is_android) {
+ ldflags += [
+ "-Bdynamic",
+ "-Wl,-z,nocopyreloc",
+ ]
+ }
+}
+
+config("no_exceptions") {
+ cflags_cc = [ "-fno-exceptions" ]
+}