Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1378)

Unified Diff: build/config/compiler/BUILD.gn

Issue 2897283002: Pass -Oz flag to Clang when targeting Android. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/expat/BUILD.gn » ('j') | third_party/expat/BUILD.gn » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/compiler/BUILD.gn
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn
index 1c50195f048741211470d94b49c45a08202d0cee..64e82671449f64c3b6210de32c4334bc73e1a231 100644
--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -1441,7 +1441,11 @@ config("optimize") {
# Favor size over speed.
# TODO(crbug.com/718650): Fix -Os in PNaCl compiler and remove the is_nacl
# guard above.
- cflags = [ "-Os" ] + common_optimize_on_cflags
+ if (is_clang) {
+ cflags = [ "-Oz" ] + common_optimize_on_cflags
+ } else {
+ cflags = [ "-Os" ] + common_optimize_on_cflags
+ }
} else {
cflags = [ "-O2" ] + common_optimize_on_cflags
}
@@ -1458,7 +1462,11 @@ config("optimize_no_wpo") {
# Favor size over speed.
# TODO(crbug.com/718650): Fix -Os in PNaCl compiler and remove the is_nacl
# guard above.
- cflags = [ "-Os" ] + common_optimize_on_cflags
+ if (is_clang) {
+ cflags = [ "-Oz" ] + common_optimize_on_cflags
+ } else {
+ cflags = [ "-Os" ] + common_optimize_on_cflags
+ }
} else if (optimize_for_fuzzing) {
cflags = [ "-O1" ] + common_optimize_on_cflags
} else {
@@ -1478,7 +1486,11 @@ config("no_optimize") {
} else if (is_android && !android_full_debug) {
# On Android we kind of optimize some things that don't affect debugging
# much even when optimization is disabled to get the binary size down.
- cflags = [ "-Os" ]
+ if (is_clang) {
+ cflags = [ "-Oz" ] + common_optimize_on_cflags
+ } else {
+ cflags = [ "-Os" ] + common_optimize_on_cflags
+ }
} else {
cflags = [ "-O0" ]
ldflags = []
« no previous file with comments | « no previous file | third_party/expat/BUILD.gn » ('j') | third_party/expat/BUILD.gn » ('J')

Powered by Google App Engine
This is Rietveld 408576698