OLD | NEW |
---|---|
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 if (cpu_arch == "arm") { | 6 if (cpu_arch == "arm") { |
7 import("//build/config/arm.gni") | 7 import("//build/config/arm.gni") |
8 } | 8 } |
9 if (is_posix) { | 9 if (is_posix) { |
10 import("//build/config/gcc/gcc_version.gni") | 10 import("//build/config/gcc/gcc_version.gni") |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
139 ] | 139 ] |
140 if (arm_tune != "") { | 140 if (arm_tune != "") { |
141 cflags += [ "-mtune=$arm_tune" ] | 141 cflags += [ "-mtune=$arm_tune" ] |
142 } | 142 } |
143 if (arm_use_thumb) { | 143 if (arm_use_thumb) { |
144 cflags += [ "-mthumb" ] | 144 cflags += [ "-mthumb" ] |
145 if (is_android && !is_clang) { # Clang doesn't support this option. | 145 if (is_android && !is_clang) { # Clang doesn't support this option. |
146 cflags += [ "-mthumb-interwork" ] | 146 cflags += [ "-mthumb-interwork" ] |
147 } | 147 } |
148 } | 148 } |
149 if (!is_clang) { | |
150 # Clang doesn't support these flags. | |
151 cflags += [ | |
152 # The tree-sra optimization (scalar replacement for | |
153 # aggregates enabling subsequent optimizations) leads to | |
154 # invalid code generation when using the Android NDK's | |
155 # compiler (r5-r7). This can be verified using | |
156 # webkit_unit_tests' WTF.Checked_int8_t test. | |
157 "-fno-tree-sra", | |
158 # The following option is disabled to improve binary | |
159 # size and performance in gcc 4.9. | |
160 # TODO(fdegans) Reevaluate when we upgrade GCC. | |
pasko
2014/07/28 13:14:30
Repeating yourself is boring. Let's have only one
Fabrice (no longer in Chrome)
2014/07/28 13:40:43
I removed the TODO (as per previous comment).
AFAI
brettw
2014/07/28 17:56:14
Yes, please duplicate the comment.
pasko
2014/07/28 18:22:27
I was wrong: I thought this section is only about
| |
161 "-fno-caller-saves", | |
162 ] | |
163 } | |
149 } | 164 } |
150 } | 165 } |
151 | 166 |
152 defines += [ "_FILE_OFFSET_BITS=64" ] | 167 defines += [ "_FILE_OFFSET_BITS=64" ] |
153 | 168 |
154 # Omit unwind support in official builds to save space. We can use breakpad | 169 # Omit unwind support in official builds to save space. We can use breakpad |
155 # for these builds. | 170 # for these builds. |
156 if (is_chrome_branded && is_official_build) { | 171 if (is_chrome_branded && is_official_build) { |
157 cflags += [ | 172 cflags += [ |
158 "-fno-unwind-tables", | 173 "-fno-unwind-tables", |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
232 if (is_android) { | 247 if (is_android) { |
233 cflags += [ | 248 cflags += [ |
234 "-ffunction-sections", | 249 "-ffunction-sections", |
235 "-funwind-tables", | 250 "-funwind-tables", |
236 "-fno-short-enums", | 251 "-fno-short-enums", |
237 ] | 252 ] |
238 if (!is_clang) { | 253 if (!is_clang) { |
239 # Clang doesn't support these flags. | 254 # Clang doesn't support these flags. |
240 cflags += [ | 255 cflags += [ |
241 "-finline-limit=64", | 256 "-finline-limit=64", |
242 # The following 6 options are disabled to save on | |
243 # binary size in gcc 4.8. | |
244 # TODO(fdegans) Reevaluate when we upgrade GCC. | |
245 "-fno-partial-inlining", | |
246 "-fno-early-inlining", | |
247 "-fno-tree-copy-prop", | |
248 "-fno-tree-loop-optimize", | |
249 "-fno-move-loop-invariants", | |
250 "-fno-caller-saves", | |
251 ] | 257 ] |
252 } | 258 } |
253 if (is_android_webview_build) { | 259 if (is_android_webview_build) { |
254 # Android predefines this as 1; undefine it here so Chromium can redefine | 260 # Android predefines this as 1; undefine it here so Chromium can redefine |
255 # it later to be 2 for chromium code and unset for third party code. This | 261 # it later to be 2 for chromium code and unset for third party code. This |
256 # works because cflags are added before defines. | 262 # works because cflags are added before defines. |
257 # TODO(brettw) the above comment seems incorrect. We specify defines | 263 # TODO(brettw) the above comment seems incorrect. We specify defines |
258 # before cflags on our compiler command lines. | 264 # before cflags on our compiler command lines. |
259 cflags += [ "-U_FORTIFY_SOURCE" ] | 265 cflags += [ "-U_FORTIFY_SOURCE" ] |
260 } | 266 } |
(...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
846 } else { | 852 } else { |
847 cflags = [ "-g1" ] | 853 cflags = [ "-g1" ] |
848 } | 854 } |
849 } | 855 } |
850 | 856 |
851 config("no_symbols") { | 857 config("no_symbols") { |
852 if (!is_win) { | 858 if (!is_win) { |
853 cflags = [ "-g0" ] | 859 cflags = [ "-g0" ] |
854 } | 860 } |
855 } | 861 } |
OLD | NEW |