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

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

Issue 843563002: Add compiler and linker flags for MIPS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Support mips_arch_variant. Remove unneeded flags. Created 5 years, 11 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 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")
11 } 11 }
12 12
13 import("//build/toolchain/ccache.gni") 13 import("//build/toolchain/ccache.gni")
14 14
15 # Default arch variants for MIPS platforms.
16 if (cpu_arch == "mipsel") {
17 mips_arch_variant_default = "r1"
18 } else if (cpu_arch == "mips64el") {
19 if (is_android) {
20 mips_arch_variant_default = "r6"
21 } else {
22 mips_arch_variant_default = "r2"
23 }
24 } else {
25 mips_arch_variant_default = ""
26 }
27
15 declare_args() { 28 declare_args() {
16 # Normally, Android builds are lightly optimized, even for debug builds, to 29 # Normally, Android builds are lightly optimized, even for debug builds, to
17 # keep binary size down. Setting this flag to true disables such optimization 30 # keep binary size down. Setting this flag to true disables such optimization
18 android_full_debug = false 31 android_full_debug = false
19 32
20 # Whether to use the binary binutils checked into third_party/binutils. 33 # Whether to use the binary binutils checked into third_party/binutils.
21 # These are not multi-arch so cannot be used except on x86 and x86-64 (the 34 # These are not multi-arch so cannot be used except on x86 and x86-64 (the
22 # only two architectures that are currently checked in). Turn this off when 35 # only two architectures that are currently checked in). Turn this off when
23 # you are using a custom toolchain and need to control -B in cflags. 36 # you are using a custom toolchain and need to control -B in cflags.
24 linux_use_bundled_binutils = is_linux && cpu_arch == "x64" 37 linux_use_bundled_binutils = is_linux && cpu_arch == "x64"
25 38
39 # MIPS arch variant.
40 mips_arch_variant = mips_arch_variant_default
wtc 2015/01/07 23:00:22 Is there a better way to provide a platform-depend
41
26 # Compile in such a way as to enable profiling of the generated code. For 42 # Compile in such a way as to enable profiling of the generated code. For
27 # example, don't omit the frame pointer and leave in symbols. 43 # example, don't omit the frame pointer and leave in symbols.
28 enable_profiling = false 44 enable_profiling = false
29 45
30 # Compile in such a way as to make it possible for the profiler to unwind full 46 # Compile in such a way as to make it possible for the profiler to unwind full
31 # stack frames. Setting this flag has a large effect on the performance of the 47 # stack frames. Setting this flag has a large effect on the performance of the
32 # generated code than just setting profiling, but gives the profiler more 48 # generated code than just setting profiling, but gives the profiler more
33 # information to analyze. 49 # information to analyze.
34 # Requires profiling to be set to true. 50 # Requires profiling to be set to true.
35 enable_full_stack_frames_for_profiling = false 51 enable_full_stack_frames_for_profiling = false
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
264 # compiler (r5-r7). This can be verified using 280 # compiler (r5-r7). This can be verified using
265 # webkit_unit_tests' WTF.Checked_int8_t test. 281 # webkit_unit_tests' WTF.Checked_int8_t test.
266 "-fno-tree-sra", 282 "-fno-tree-sra",
267 283
268 # The following option is disabled to improve binary 284 # The following option is disabled to improve binary
269 # size and performance in gcc 4.9. 285 # size and performance in gcc 4.9.
270 "-fno-caller-saves", 286 "-fno-caller-saves",
271 ] 287 ]
272 } 288 }
273 } 289 }
290 } else if (cpu_arch == "mipsel") {
291 # Don't set the compiler flags for the WebView build. These will come
292 # from the Android build system.
293 if (!is_android_webview_build) {
294 if (mips_arch_variant == "r6") {
295 cflags += [
296 "-mips32r6",
297 "-Wa,-mips32r6",
298 ]
299 if (is_android) {
300 ldflags += [
301 "-mips32r6",
302 "-Wl,-melf32ltsmip",
wtc 2015/01/07 23:00:22 I don't know what this flag is for. I copied it fr
303 ]
304 }
305 } else if (mips_arch_variant == "r2") {
306 cflags += [
307 "-mips32r2",
308 "-Wa,-mips32r2",
309 ]
310 } else if (mips_arch_variant == "r1") {
311 cflags += [
312 "-mips32",
313 "-Wa,-mips32",
314 ]
315 }
316 }
317 } else if (cpu_arch == "mips64el") {
318 # Don't set the compiler flags for the WebView build. These will come
319 # from the Android build system.
320 if (!is_android_webview_build) {
321 if (mips_arch_variant == "r6") {
322 cflags += [
323 "-mips64r6",
324 "-Wa,-mips64r6",
325 ]
326 ldflags += [ "-mips64r6" ]
327 } else if (mips_arch_variant == "r2") {
328 cflags += [
329 "-mips64r2",
330 "-Wa,-mips64r2",
331 ]
332 ldflags += [ "-mips64r2" ]
333 }
334 }
274 } 335 }
275 336
276 defines += [ "_FILE_OFFSET_BITS=64" ] 337 defines += [ "_FILE_OFFSET_BITS=64" ]
277 338
278 # Omit unwind support in official builds to save space. We can use breakpad 339 # Omit unwind support in official builds to save space. We can use breakpad
279 # for these builds. 340 # for these builds.
280 if (is_chrome_branded && is_official_build) { 341 if (is_chrome_branded && is_official_build) {
281 cflags += [ 342 cflags += [
282 "-fno-unwind-tables", 343 "-fno-unwind-tables",
283 "-fno-asynchronous-unwind-tables", 344 "-fno-asynchronous-unwind-tables",
(...skipping 703 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 cflags += [ "-gsplit-dwarf" ] 1048 cflags += [ "-gsplit-dwarf" ]
988 } 1049 }
989 } 1050 }
990 } 1051 }
991 1052
992 config("no_symbols") { 1053 config("no_symbols") {
993 if (!is_win) { 1054 if (!is_win) {
994 cflags = [ "-g0" ] 1055 cflags = [ "-g0" ]
995 } 1056 }
996 } 1057 }
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