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

Side by Side Diff: build/config/compiler/BUILD.gn

Issue 2865573002: build: Fix optimize_for_size build on Linux by adding an is_nacl guard. (Closed)
Patch Set: Add TODO to fix NaCl compiler 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/android/config.gni") 5 import("//build/config/android/config.gni")
6 import("//build/config/chrome_build.gni") 6 import("//build/config/chrome_build.gni")
7 import("//build/config/chromecast_build.gni") 7 import("//build/config/chromecast_build.gni")
8 import("//build/config/compiler/compiler.gni") 8 import("//build/config/compiler/compiler.gni")
9 import("//build/toolchain/cc_wrapper.gni") 9 import("//build/toolchain/cc_wrapper.gni")
10 import("//build/toolchain/toolchain.gni") 10 import("//build/toolchain/toolchain.gni")
(...skipping 1431 matching lines...) Expand 10 before | Expand all | Expand 10 after
1442 # Probably anything that this would catch that wouldn't be caught in a 1442 # Probably anything that this would catch that wouldn't be caught in a
1443 # normal build isn't going to actually be a bug, so the incremental 1443 # normal build isn't going to actually be a bug, so the incremental
1444 # value of C4702 for PGO builds is likely very small. 1444 # value of C4702 for PGO builds is likely very small.
1445 "/wd4702", 1445 "/wd4702",
1446 ] 1446 ]
1447 } 1447 }
1448 1448
1449 # Favor size over speed, /O1 must be before the common flags. The GYP 1449 # Favor size over speed, /O1 must be before the common flags. The GYP
1450 # build also specifies /Os and /GF but these are implied by /O1. 1450 # build also specifies /Os and /GF but these are implied by /O1.
1451 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] 1451 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ]
1452 } else if (optimize_for_size) { 1452 } else if (optimize_for_size && !is_nacl) {
1453 # Favor size over speed. 1453 # Favor size over speed.
1454 # TODO(crbug.com/718650): Fix -Os in PNaCl compiler and remove the is_nacl
1455 # guard above.
1454 cflags = [ "-Os" ] + common_optimize_on_cflags 1456 cflags = [ "-Os" ] + common_optimize_on_cflags
1455 } else { 1457 } else {
1456 cflags = [ "-O2" ] + common_optimize_on_cflags 1458 cflags = [ "-O2" ] + common_optimize_on_cflags
1457 } 1459 }
1458 ldflags = common_optimize_on_ldflags 1460 ldflags = common_optimize_on_ldflags
1459 } 1461 }
1460 1462
1461 # Same config as 'optimize' but without the WPO flag. 1463 # Same config as 'optimize' but without the WPO flag.
1462 config("optimize_no_wpo") { 1464 config("optimize_no_wpo") {
1463 if (is_win) { 1465 if (is_win) {
1464 # Favor size over speed, /O1 must be before the common flags. The GYP 1466 # Favor size over speed, /O1 must be before the common flags. The GYP
1465 # build also specifies /Os and /GF but these are implied by /O1. 1467 # build also specifies /Os and /GF but these are implied by /O1.
1466 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ] 1468 cflags = [ "/O1" ] + common_optimize_on_cflags + [ "/Oi" ]
1467 } else if (optimize_for_size) { 1469 } else if (optimize_for_size && !is_nacl) {
1468 # Favor size over speed. 1470 # Favor size over speed.
1471 # TODO(crbug.com/718650): Fix -Os in PNaCl compiler and remove the is_nacl
1472 # guard above.
1469 cflags = [ "-Os" ] + common_optimize_on_cflags 1473 cflags = [ "-Os" ] + common_optimize_on_cflags
1470 } else if (optimize_for_fuzzing) { 1474 } else if (optimize_for_fuzzing) {
1471 cflags = [ "-O1" ] + common_optimize_on_cflags 1475 cflags = [ "-O1" ] + common_optimize_on_cflags
1472 } else { 1476 } else {
1473 cflags = [ "-O2" ] + common_optimize_on_cflags 1477 cflags = [ "-O2" ] + common_optimize_on_cflags
1474 } 1478 }
1475 ldflags = common_optimize_on_ldflags 1479 ldflags = common_optimize_on_ldflags
1476 } 1480 }
1477 1481
1478 # Turn off optimizations. 1482 # Turn off optimizations.
(...skipping 269 matching lines...) Expand 10 before | Expand all | Expand 10 after
1748 1752
1749 if (is_ios || is_mac) { 1753 if (is_ios || is_mac) {
1750 # On Mac and iOS, this enables support for ARC (automatic ref-counting). 1754 # On Mac and iOS, this enables support for ARC (automatic ref-counting).
1751 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html. 1755 # See http://clang.llvm.org/docs/AutomaticReferenceCounting.html.
1752 config("enable_arc") { 1756 config("enable_arc") {
1753 common_flags = [ "-fobjc-arc" ] 1757 common_flags = [ "-fobjc-arc" ]
1754 cflags_objc = common_flags 1758 cflags_objc = common_flags
1755 cflags_objcc = common_flags 1759 cflags_objcc = common_flags
1756 } 1760 }
1757 } 1761 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698