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

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

Issue 568613002: gn: use bundled binutils via -B (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@gn-various-matching
Patch Set: match condition in gyp Created 6 years, 3 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 | tools/gn/bin/gyp_flag_compare.py » ('j') | 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 declare_args() { 13 declare_args() {
14 # Normally, Android builds are lightly optimized, even for debug builds, to 14 # Normally, Android builds are lightly optimized, even for debug builds, to
15 # keep binary size down. Setting this flag to true disables such optimization 15 # keep binary size down. Setting this flag to true disables such optimization
16 android_full_debug = false 16 android_full_debug = false
17
18 # Whether to use the binary binutils checked into third_party/binutils.
19 # These are not multi-arch so cannot be used except on x86 and x86-64 (the
20 # only two architectures that are currently checked in). Turn this off when
21 # you are using a custom toolchain and need to control -B in cflags.
22 linux_use_bundled_binutils = is_linux && cpu_arch == "x64"
17 } 23 }
18 24
19 use_gold = is_linux && cpu_arch == "x64" 25 use_gold = is_linux && cpu_arch == "x64"
20 26
21 if (!is_win) { 27 if (!is_win) {
22 # linux_use_debug_fission: whether to use split DWARF debug info 28 # linux_use_debug_fission: whether to use split DWARF debug info
23 # files. This can reduce link time significantly, but is incompatible 29 # files. This can reduce link time significantly, but is incompatible
24 # with some utilities such as icecc and ccache. Requires gold and 30 # with some utilities such as icecc and ccache. Requires gold and
25 # gcc >= 4.8 or clang. 31 # gcc >= 4.8 or clang.
26 # http://gcc.gnu.org/wiki/DebugFission 32 # http://gcc.gnu.org/wiki/DebugFission
27 # 33 use_debug_fission = use_gold && linux_use_bundled_binutils
28 # TODO(GYP) enable this. Currently this gives errors from objcopy, presumably
29 # because some other symbol or toolchain setting isn't correct.
30 #use_debug_fission = use_gold
31 use_debug_fission = false
32 } 34 }
33 35
34 # default_include_dirs --------------------------------------------------------- 36 # default_include_dirs ---------------------------------------------------------
35 # 37 #
36 # This is a separate config so that third_party code (which would not use the 38 # This is a separate config so that third_party code (which would not use the
37 # source root and might have conflicting versions of some headers) can remove 39 # source root and might have conflicting versions of some headers) can remove
38 # this and specify their own include paths. 40 # this and specify their own include paths.
39 config("default_include_dirs") { 41 config("default_include_dirs") {
40 include_dirs = [ 42 include_dirs = [
41 "//", 43 "//",
(...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_threa d/thread/281527606915bb36 262 # https://groups.google.com/a/chromium.org/group/chromium-dev/browse_threa d/thread/281527606915bb36
261 # Only apply this to the target linker, since the host 263 # Only apply this to the target linker, since the host
262 # linker might not be gold, but isn't used much anyway. 264 # linker might not be gold, but isn't used much anyway.
263 # TODO(raymes): Disable threading because gold is frequently 265 # TODO(raymes): Disable threading because gold is frequently
264 # crashing on the bots: crbug.com/161942. 266 # crashing on the bots: crbug.com/161942.
265 #"-Wl,--threads", 267 #"-Wl,--threads",
266 #"-Wl,--thread-count=4", 268 #"-Wl,--thread-count=4",
267 ] 269 ]
268 } 270 }
269 271
272 if (linux_use_bundled_binutils) {
273 binutils_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin",
274 root_build_dir)
275 cflags += [ "-B$binutils_path" ]
276 }
277
270 # Clang-specific compiler flags setup. 278 # Clang-specific compiler flags setup.
271 # ------------------------------------ 279 # ------------------------------------
272 if (is_clang) { 280 if (is_clang) {
273 cflags += [ 281 cflags += [
274 "-fcolor-diagnostics", 282 "-fcolor-diagnostics",
275 ] 283 ]
276 cflags_cc += [ 284 cflags_cc += [
277 "-std=gnu++11", 285 "-std=gnu++11",
278 ] 286 ]
279 } 287 }
(...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after
923 cflags += [ "-gsplit-dwarf" ] 931 cflags += [ "-gsplit-dwarf" ]
924 } 932 }
925 } 933 }
926 } 934 }
927 935
928 config("no_symbols") { 936 config("no_symbols") {
929 if (!is_win) { 937 if (!is_win) {
930 cflags = [ "-g0" ] 938 cflags = [ "-g0" ]
931 } 939 }
932 } 940 }
OLDNEW
« no previous file with comments | « no previous file | tools/gn/bin/gyp_flag_compare.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698