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") |
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 } | 17 } |
18 | 18 |
19 use_gold = is_linux | 19 use_gold = is_linux && cpu_arch == "x64" |
20 | 20 |
21 # linux_use_debug_fission: whether to use split DWARF debug info | 21 # linux_use_debug_fission: whether to use split DWARF debug info |
22 # files. This can reduce link time significantly, but is incompatible | 22 # files. This can reduce link time significantly, but is incompatible |
23 # with some utilities such as icecc and ccache. Requires gold and | 23 # with some utilities such as icecc and ccache. Requires gold and |
24 # gcc >= 4.8 or clang. | 24 # gcc >= 4.8 or clang. |
25 # http://gcc.gnu.org/wiki/DebugFission | 25 # http://gcc.gnu.org/wiki/DebugFission |
26 # | 26 # |
27 # TODO(GYP) enable this. Currently this gives errors from objcopy, presumably | 27 # TODO(GYP) enable this. Currently this gives errors from objcopy, presumably |
28 # because some other symbol or toolchain setting isn't correct. | 28 # because some other symbol or toolchain setting isn't correct. |
29 #use_debug_fission = use_gold | 29 #use_debug_fission = use_gold |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 | 193 |
194 # Linux-specific compiler flags setup. | 194 # Linux-specific compiler flags setup. |
195 # ------------------------------------ | 195 # ------------------------------------ |
196 if (is_linux) { | 196 if (is_linux) { |
197 cflags += [ "-pthread" ] | 197 cflags += [ "-pthread" ] |
198 ldflags += [ | 198 ldflags += [ |
199 "-pthread", | 199 "-pthread", |
200 ] | 200 ] |
201 } | 201 } |
202 if (use_gold) { | 202 if (use_gold) { |
203 # 32-bit hosts have to be 32-bit userland with a 64-bit kernel, so that | 203 # Use gold for linking on 64-bit Linux only (on 32-bit it runs out of |
204 # 64-bit gold gets used. 32-bit gold will run out of address space. | 204 # address space, and it doesn't support cross-compiling). |
205 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", | 205 gold_path = rebase_path("//third_party/binutils/Linux_x64/Release/bin", |
206 root_build_dir) | 206 root_build_dir) |
207 ldflags += [ | 207 ldflags += [ |
208 "-B$gold_path", | 208 "-B$gold_path", |
209 | 209 |
210 # Newer gccs and clangs support -fuse-ld, use the flag to force gold | 210 # Newer gccs and clangs support -fuse-ld, use the flag to force gold |
211 # selection. | 211 # selection. |
212 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html | 212 # gcc -- http://gcc.gnu.org/onlinedocs/gcc-4.8.0/gcc/Optimize-Options.html |
213 "-fuse-ld=gold", | 213 "-fuse-ld=gold", |
214 | 214 |
(...skipping 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 cflags += [ "-gsplit-dwarf" ] | 908 cflags += [ "-gsplit-dwarf" ] |
909 } | 909 } |
910 } | 910 } |
911 } | 911 } |
912 | 912 |
913 config("no_symbols") { | 913 config("no_symbols") { |
914 if (!is_win) { | 914 if (!is_win) { |
915 cflags = [ "-g0" ] | 915 cflags = [ "-g0" ] |
916 } | 916 } |
917 } | 917 } |
OLD | NEW |