| 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 15 matching lines...) Expand all Loading... |
| 26 # Compile in such a way as to enable profiling of the generated code. For | 26 # 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. | 27 # example, don't omit the frame pointer and leave in symbols. |
| 28 enable_profiling = false | 28 enable_profiling = false |
| 29 | 29 |
| 30 # Compile in such a way as to make it possible for the profiler to unwind full | 30 # 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 | 31 # 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 | 32 # generated code than just setting profiling, but gives the profiler more |
| 33 # information to analyze. | 33 # information to analyze. |
| 34 # Requires profiling to be set to true. | 34 # Requires profiling to be set to true. |
| 35 enable_full_stack_frames_for_profiling = false | 35 enable_full_stack_frames_for_profiling = false |
| 36 } | |
| 37 | 36 |
| 38 use_gold = is_linux && cpu_arch == "x64" | 37 # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of |
| 38 # address space, and it doesn't support cross-compiling). |
| 39 use_gold = is_linux && cpu_arch == "x64" |
| 39 | 40 |
| 40 if (!is_win) { | 41 # use_debug_fission: whether to use split DWARF debug info |
| 41 # linux_use_debug_fission: whether to use split DWARF debug info | |
| 42 # files. This can reduce link time significantly, but is incompatible | 42 # files. This can reduce link time significantly, but is incompatible |
| 43 # with some utilities such as icecc and ccache. Requires gold and | 43 # with some utilities such as icecc and ccache. Requires gold and |
| 44 # gcc >= 4.8 or clang. | 44 # gcc >= 4.8 or clang. |
| 45 # http://gcc.gnu.org/wiki/DebugFission | 45 # http://gcc.gnu.org/wiki/DebugFission |
| 46 use_debug_fission = use_gold && linux_use_bundled_binutils && !use_ccache | 46 use_debug_fission = |
| 47 !is_win && use_gold && linux_use_bundled_binutils && !use_ccache |
| 47 } | 48 } |
| 48 | 49 |
| 49 # default_include_dirs --------------------------------------------------------- | 50 # default_include_dirs --------------------------------------------------------- |
| 50 # | 51 # |
| 51 # This is a separate config so that third_party code (which would not use the | 52 # This is a separate config so that third_party code (which would not use the |
| 52 # source root and might have conflicting versions of some headers) can remove | 53 # source root and might have conflicting versions of some headers) can remove |
| 53 # this and specify their own include paths. | 54 # this and specify their own include paths. |
| 54 config("default_include_dirs") { | 55 config("default_include_dirs") { |
| 55 include_dirs = [ | 56 include_dirs = [ |
| 56 "//", | 57 "//", |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 ] | 304 ] |
| 304 } | 305 } |
| 305 | 306 |
| 306 # Linux-specific compiler flags setup. | 307 # Linux-specific compiler flags setup. |
| 307 # ------------------------------------ | 308 # ------------------------------------ |
| 308 if (is_linux) { | 309 if (is_linux) { |
| 309 cflags += [ "-pthread" ] | 310 cflags += [ "-pthread" ] |
| 310 ldflags += [ "-pthread" ] | 311 ldflags += [ "-pthread" ] |
| 311 } | 312 } |
| 312 if (use_gold) { | 313 if (use_gold) { |
| 313 # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of | |
| 314 # address space, and it doesn't support cross-compiling). | |
| 315 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | 314 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
| 316 root_build_dir) | 315 root_build_dir) |
| 317 ldflags += [ | 316 ldflags += [ |
| 318 "-B$gold_path", | 317 "-B$gold_path", |
| 319 | 318 |
| 320 # Newer gccs and clangs support -fuse-ld, use the flag to force gold | 319 # Newer gccs and clangs support -fuse-ld, use the flag to force gold |
| 321 # selection. | 320 # selection. |
| 322 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html | 321 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html |
| 323 "-fuse-ld=gold", | 322 "-fuse-ld=gold", |
| 324 | 323 |
| (...skipping 662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 987 cflags += [ "-gsplit-dwarf" ] | 986 cflags += [ "-gsplit-dwarf" ] |
| 988 } | 987 } |
| 989 } | 988 } |
| 990 } | 989 } |
| 991 | 990 |
| 992 config("no_symbols") { | 991 config("no_symbols") { |
| 993 if (!is_win) { | 992 if (!is_win) { |
| 994 cflags = [ "-g0" ] | 993 cflags = [ "-g0" ] |
| 995 } | 994 } |
| 996 } | 995 } |
| OLD | NEW |