aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-03-26 20:11:48 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-03-27 12:50:16 +0000
commiteec23d113149569414e325ac6fd5a9253945628b (patch)
tree318baf68f5ca5262b81c4516e069e683b2502b07
parent1af55b9a99af275c225be55c975f8d8dbb697d27 (diff)
focus hidden-visibility flags
This makes things like dladdr and backtrace_symbols not totally useless on Linux. Change-Id: I26666a76c5b50fbf88aaf9709c869de0a697bb02 Reviewed-on: https://skia-review.googlesource.com/10176 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
-rw-r--r--gn/BUILD.gn9
1 files changed, 7 insertions, 2 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 0ee9d39321..3573740f99 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -147,14 +147,19 @@ config("default") {
cflags += [
"-fstrict-aliasing",
"-fPIC",
- "-fvisibility=hidden",
"-Werror",
]
cflags_cc += [
"-std=c++11",
"-fno-threadsafe-statics",
- "-fvisibility-inlines-hidden",
]
+
+ # The main idea is to slim the exported API, but these flags also improve link time on Mac.
+ # These would make stack traces worse on Linux, so we don't just set them willy-nilly.
+ if (is_component_build || is_mac) {
+ cflags += [ "-fvisibility=hidden" ]
+ cflags_cc += [ "-fvisibility-inlines-hidden" ]
+ }
}
if (current_cpu == "arm") {