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 import("//build/config/chrome_build.gni") | 6 import("//build/config/chrome_build.gni") |
7 if (current_cpu == "arm") { | 7 if (current_cpu == "arm") { |
8 import("//build/config/arm.gni") | 8 import("//build/config/arm.gni") |
9 } | 9 } |
10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { | 10 if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
(...skipping 12 matching lines...) Expand all Loading... |
23 declare_args() { | 23 declare_args() { |
24 # Normally, Android builds are lightly optimized, even for debug builds, to | 24 # Normally, Android builds are lightly optimized, even for debug builds, to |
25 # keep binary size down. Setting this flag to true disables such optimization | 25 # keep binary size down. Setting this flag to true disables such optimization |
26 android_full_debug = false | 26 android_full_debug = false |
27 | 27 |
28 # Whether to use the binary binutils checked into third_party/binutils. | 28 # Whether to use the binary binutils checked into third_party/binutils. |
29 # These are not multi-arch so cannot be used except on x86 and x86-64 (the | 29 # These are not multi-arch so cannot be used except on x86 and x86-64 (the |
30 # only two architectures that are currently checked in). Turn this off when | 30 # only two architectures that are currently checked in). Turn this off when |
31 # you are using a custom toolchain and need to control -B in cflags. | 31 # you are using a custom toolchain and need to control -B in cflags. |
32 linux_use_bundled_binutils = is_linux && current_cpu == "x64" | 32 linux_use_bundled_binutils = is_linux && current_cpu == "x64" |
| 33 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
| 34 root_build_dir) |
33 | 35 |
34 # Compile in such a way as to enable profiling of the generated code. For | 36 # Compile in such a way as to enable profiling of the generated code. For |
35 # example, don't omit the frame pointer and leave in symbols. | 37 # example, don't omit the frame pointer and leave in symbols. |
36 enable_profiling = false | 38 enable_profiling = false |
37 | 39 |
38 # Compile in such a way as to make it possible for the profiler to unwind full | 40 # Compile in such a way as to make it possible for the profiler to unwind full |
39 # stack frames. Setting this flag has a large effect on the performance of the | 41 # stack frames. Setting this flag has a large effect on the performance of the |
40 # generated code than just setting profiling, but gives the profiler more | 42 # generated code than just setting profiling, but gives the profiler more |
41 # information to analyze. | 43 # information to analyze. |
42 # Requires profiling to be set to true. | 44 # Requires profiling to be set to true. |
43 enable_full_stack_frames_for_profiling = false | 45 enable_full_stack_frames_for_profiling = false |
44 | 46 |
45 # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of | 47 # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of |
46 # address space, and it doesn't support cross-compiling). | 48 # address space, and it doesn't support cross-compiling). |
47 use_gold = is_linux && current_cpu == "x64" | 49 use_gold = is_linux && current_cpu == "x64" |
48 | 50 |
| 51 # When we are going to use gold we need to find it. |
| 52 if (use_gold) { |
| 53 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
| 54 root_build_dir) |
| 55 } else { |
| 56 gold_path = "" |
| 57 } |
| 58 |
49 # use_debug_fission: whether to use split DWARF debug info | 59 # use_debug_fission: whether to use split DWARF debug info |
50 # files. This can reduce link time significantly, but is incompatible | 60 # files. This can reduce link time significantly, but is incompatible |
51 # with some utilities such as icecc and ccache. Requires gold and | 61 # with some utilities such as icecc and ccache. Requires gold and |
52 # gcc >= 4.8 or clang. | 62 # gcc >= 4.8 or clang. |
53 # http://gcc.gnu.org/wiki/DebugFission | 63 # http://gcc.gnu.org/wiki/DebugFission |
54 use_debug_fission = is_debug && !is_win && use_gold && | 64 use_debug_fission = is_debug && !is_win && use_gold && |
55 linux_use_bundled_binutils && !use_ccache | 65 linux_use_bundled_binutils && !use_ccache |
56 | 66 |
57 if (is_win) { | 67 if (is_win) { |
58 # Whether the VS xtree header has been patched to disable warning 4702. If | 68 # Whether the VS xtree header has been patched to disable warning 4702. If |
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 } | 459 } |
450 } | 460 } |
451 | 461 |
452 # Linux-specific compiler flags setup. | 462 # Linux-specific compiler flags setup. |
453 # ------------------------------------ | 463 # ------------------------------------ |
454 if (is_linux) { | 464 if (is_linux) { |
455 cflags += [ "-pthread" ] | 465 cflags += [ "-pthread" ] |
456 ldflags += [ "-pthread" ] | 466 ldflags += [ "-pthread" ] |
457 } | 467 } |
458 if (use_gold) { | 468 if (use_gold) { |
459 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | |
460 root_build_dir) | |
461 ldflags += [ | 469 ldflags += [ |
462 "-B$gold_path", | 470 "-B$gold_path", |
463 | 471 |
464 # Newer gccs and clangs support -fuse-ld, use the flag to force gold | 472 # Newer gccs and clangs support -fuse-ld, use the flag to force gold |
465 # selection. | 473 # selection. |
466 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html | 474 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html |
467 "-fuse-ld=gold", | 475 "-fuse-ld=gold", |
468 | 476 |
469 # Experimentation found that using four linking threads | 477 # Experimentation found that using four linking threads |
470 # saved ~20% of link time. | 478 # saved ~20% of link time. |
(...skipping 13 matching lines...) Expand all Loading... |
484 | 492 |
485 # TODO(thestig): Make this flag work with GN. | 493 # TODO(thestig): Make this flag work with GN. |
486 #if (!is_official_build && !is_chromeos && !(is_asan || is_lsan || is_tsan |
| is_msan)) { | 494 #if (!is_official_build && !is_chromeos && !(is_asan || is_lsan || is_tsan |
| is_msan)) { |
487 # ldflags += [ | 495 # ldflags += [ |
488 # "-Wl,--detect-odr-violations", | 496 # "-Wl,--detect-odr-violations", |
489 # ] | 497 # ] |
490 #} | 498 #} |
491 } | 499 } |
492 | 500 |
493 if (linux_use_bundled_binutils) { | 501 if (linux_use_bundled_binutils) { |
494 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | |
495 root_build_dir) | |
496 cflags += [ "-B$binutils_path" ] | 502 cflags += [ "-B$binutils_path" ] |
497 } | 503 } |
498 | 504 |
499 # Clang-specific compiler flags setup. | 505 # Clang-specific compiler flags setup. |
500 # ------------------------------------ | 506 # ------------------------------------ |
501 if (is_clang) { | 507 if (is_clang) { |
502 cflags += [ "-fcolor-diagnostics" ] | 508 cflags += [ "-fcolor-diagnostics" ] |
503 } | 509 } |
504 | 510 |
505 # C++11 compiler flags setup. | 511 # C++11 compiler flags setup. |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1281 cflags += [ "-gsplit-dwarf" ] | 1287 cflags += [ "-gsplit-dwarf" ] |
1282 } | 1288 } |
1283 } | 1289 } |
1284 } | 1290 } |
1285 | 1291 |
1286 config("no_symbols") { | 1292 config("no_symbols") { |
1287 if (!is_win) { | 1293 if (!is_win) { |
1288 cflags = [ "-g0" ] | 1294 cflags = [ "-g0" ] |
1289 } | 1295 } |
1290 } | 1296 } |
OLD | NEW |