OLD | NEW |
---|---|
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 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/compiler/compiler.gni") | 5 import("//build/config/compiler/compiler.gni") |
6 import("//build/config/sysroot.gni") | 6 import("//build/config/sysroot.gni") |
7 import("//build/toolchain/gcc_toolchain.gni") | 7 import("//build/toolchain/gcc_toolchain.gni") |
8 import("//build/toolchain/cros_toolchain.gni") | 8 import("//build/toolchain/cros_toolchain.gni") |
9 | 9 |
10 # TODO(dpranke): Delete this after we get rid of the reference to | 10 # TODO(dpranke): Delete this after we get rid of the reference to |
11 # build/toolchain/cros:clang_target in BUILDCONFIG.gn | 11 # build/toolchain/cros:clang_target in BUILDCONFIG.gn |
12 clang_toolchain("clang_target") { | 12 clang_toolchain("clang_target") { |
13 toolchain_cpu = target_cpu | 13 toolchain_cpu = target_cpu |
14 toolchain_os = "linux" | 14 toolchain_os = "linux" |
15 } | 15 } |
16 | 16 |
17 template("cros_target_toolchain") { | 17 # This is the normal toolchain for most targets. |
18 if (defined(invoker.use_debug_fission)) { | 18 gcc_toolchain("target") { |
19 use_debug_fission = invoker.use_debug_fission | 19 ar = cros_target_ar |
20 cc = cros_target_cc | |
21 cxx = cros_target_cxx | |
22 ld = cxx | |
23 if (cros_target_ld != "") { | |
24 ld = cros_target_ld | |
20 } | 25 } |
21 if (defined(invoker.use_gold)) { | 26 if (cros_target_nm != "") { |
22 use_gold = invoker.use_gold | 27 nm = cros_target_nm |
23 } | 28 } |
24 if (defined(invoker.use_sysroot)) { | 29 if (cros_target_readelf != "") { |
25 use_sysroot = invoker.use_sysroot | 30 readelf = cros_target_readelf |
26 } | 31 } |
32 extra_cflags = cros_target_extra_cflags | |
33 extra_cppflags = cros_target_extra_cppflags | |
34 extra_cxxflags = cros_target_extra_cxxflags | |
35 extra_ldflags = cros_target_extra_ldflags | |
27 | 36 |
28 gcc_toolchain(target_name) { | 37 # These are passed through as toolchain_args. |
29 # These are args for the template. | 38 cc_wrapper = "" |
30 ar = cros_target_ar | 39 is_clang = is_clang |
31 cc = cros_target_cc | 40 toolchain_cpu = target_cpu |
32 cxx = cros_target_cxx | 41 toolchain_os = "chromeos" |
33 ld = cxx | 42 use_debug_fission = use_debug_fission |
34 if (cros_target_ld != "") { | 43 use_gold = use_gold |
35 ld = cros_target_ld | 44 use_sysroot = use_sysroot |
36 } | |
37 if (cros_target_nm != "") { | |
38 nm = cros_target_nm | |
39 } | |
40 if (cros_target_readelf != "") { | |
41 readelf = cros_target_readelf | |
42 } | |
43 extra_cflags = cros_target_extra_cflags | |
44 extra_cppflags = cros_target_extra_cppflags | |
45 extra_cxxflags = cros_target_extra_cxxflags | |
46 extra_ldflags = cros_target_extra_ldflags | |
47 | |
48 # These are passed through as toolchain_args. | |
49 cc_wrapper = "" | |
50 is_clang = is_clang | |
51 toolchain_cpu = target_cpu | |
52 toolchain_os = "chromeos" | |
53 | |
54 use_debug_fission = use_debug_fission | |
55 use_gold = use_gold | |
56 use_sysroot = use_sysroot | |
57 } | |
58 } | |
59 | |
60 # This is the normal toolchain for most targets. | |
61 cros_target_toolchain("target") { | |
62 } | 45 } |
63 | 46 |
64 # This is a special toolchain needed just for the nacl_bootstrap target in | 47 # This is a special toolchain needed just for the nacl_bootstrap target in |
65 # //native_client/src/trusted/service_runtime/linux. It is identical | 48 # //native_client/src/trusted/service_runtime/linux. It is identical |
66 # to ":target" except that it forces use_debug_fission, use_gold, and | 49 # to ":target" except that it forces use_debug_fission, use_gold, and |
67 # use_sysroot off. | 50 # use_sysroot off. |
68 cros_target_toolchain("nacl_bootstrap") { | 51 gcc_toolchain("nacl_bootstrap") { |
llozano1
2016/07/28 17:20:56
why the name change? does this mean this will not
Dirk Pranke
2016/07/28 17:23:53
No, it's fine. All I did was get rid of the templa
Dirk Pranke
2016/08/01 20:53:09
Actually, the clang_toolchain() template does two
| |
52 ar = cros_target_ar | |
53 cc = cros_target_cc | |
54 cxx = cros_target_cxx | |
55 ld = cxx | |
56 if (cros_target_ld != "") { | |
57 ld = cros_target_ld | |
58 } | |
59 if (cros_target_nm != "") { | |
60 nm = cros_target_nm | |
61 } | |
62 if (cros_target_readelf != "") { | |
63 readelf = cros_target_readelf | |
64 } | |
65 extra_cflags = cros_nacl_bootstrap_extra_cflags | |
66 extra_cppflags = cros_nacl_bootstrap_extra_cppflags | |
67 extra_cxxflags = cros_nacl_bootstrap_extra_cxxflags | |
68 extra_ldflags = cros_nacl_bootstrap_extra_ldflags | |
69 | |
70 # These are passed through as toolchain_args. | |
71 cc_wrapper = "" | |
72 is_clang = is_clang | |
73 toolchain_cpu = target_cpu | |
74 toolchain_os = "chromeos" | |
69 use_debug_fission = false | 75 use_debug_fission = false |
70 use_gold = false | 76 use_gold = false |
71 use_sysroot = false | 77 use_sysroot = false |
72 } | 78 } |
73 | 79 |
74 gcc_toolchain("host") { | 80 gcc_toolchain("host") { |
75 # These are args for the template. | 81 # These are args for the template. |
76 ar = cros_host_ar | 82 ar = cros_host_ar |
77 cc = cros_host_cc | 83 cc = cros_host_cc |
78 cxx = cros_host_cxx | 84 cxx = cros_host_cxx |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
124 is_clang = cros_v8_snapshot_is_clang | 130 is_clang = cros_v8_snapshot_is_clang |
125 if (target_cpu == "x86" || target_cpu == "arm" || target_cpu == "mipsel") { | 131 if (target_cpu == "x86" || target_cpu == "arm" || target_cpu == "mipsel") { |
126 toolchain_cpu = "x86" | 132 toolchain_cpu = "x86" |
127 } else { | 133 } else { |
128 toolchain_cpu = "x64" | 134 toolchain_cpu = "x64" |
129 } | 135 } |
130 v8_toolchain_cpu = v8_target_cpu | 136 v8_toolchain_cpu = v8_target_cpu |
131 toolchain_os = "linux" | 137 toolchain_os = "linux" |
132 use_sysroot = false | 138 use_sysroot = false |
133 } | 139 } |
OLD | NEW |