aboutsummaryrefslogtreecommitdiffhomepage
path: root/gn/BUILD.gn
diff options
context:
space:
mode:
authorGravatar Mike Klein <mtklein@chromium.org>2017-02-10 07:59:39 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2017-02-10 15:32:48 +0000
commitbd9be4dec9eec2f3ff00348e907a377670ab12f3 (patch)
tree9111743d163b55e80b2da4c7287b2c2ca7f3dddb /gn/BUILD.gn
parent57bfa0209e3379385b7ef6217cafb22ca83836c8 (diff)
Strip dead code on all Release builds.
Today we do this only on Windows (/OPT:REF). This extends to Mac-likes (-dead_strip) and non-Macs (-ffunction-sections, -fdata-sections, -Wl,--gc-sections). Should be no harm passing -ffunction-sections and -fdata-sections on Mac too. CQ_INCLUDE_TRYBOTS=skia.primary:Build-Ubuntu-Clang-x86_64-Release-Mini Change-Id: I3a1b41be1d258ff509b0355215cb25dab47db57b Reviewed-on: https://skia-review.googlesource.com/8307 Reviewed-by: Ben Wagner <bungeman@google.com> Commit-Queue: Mike Klein <mtklein@chromium.org>
Diffstat (limited to 'gn/BUILD.gn')
-rw-r--r--gn/BUILD.gn7
1 files changed, 7 insertions, 0 deletions
diff --git a/gn/BUILD.gn b/gn/BUILD.gn
index 43c5928730..37852251cb 100644
--- a/gn/BUILD.gn
+++ b/gn/BUILD.gn
@@ -394,8 +394,15 @@ config("release") {
} else {
cflags = [
"-O3",
+ "-fdata-sections",
+ "-ffunction-sections",
"-momit-leaf-frame-pointer",
]
+ if (is_mac || is_ios) {
+ ldflags = [ "-dead_strip" ]
+ } else {
+ ldflags = [ "-Wl,--gc-sections" ]
+ }
}
defines = [ "NDEBUG" ]
}