OLD | NEW |
1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2016 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/toolchain/gcc_toolchain.gni") | |
6 | |
7 # CrOS builds must cross-compile on a Linux host for the actual CrOS | 5 # CrOS builds must cross-compile on a Linux host for the actual CrOS |
8 # device target. There are many different CrOS devices so the build | 6 # device target. There are many different CrOS devices so the build |
9 # system provides configuration variables that permit a CrOS build to | 7 # system provides configuration variables that permit a CrOS build to |
10 # control the cross-compilation tool chain. However, requiring such | 8 # control the cross-compilation tool chain. However, requiring such |
11 # fine-grain specification is tedious for build-bots and developers. | 9 # fine-grain specification is tedious for build-bots and developers. |
12 # Consequently, the CrOS build system defaults to a convenience | 10 # Consequently, the CrOS build system defaults to a convenience |
13 # compilation mode where the compilation host is also the build target. | 11 # compilation mode where the compilation host is also the build target. |
14 # | 12 # |
15 # Chrome can be compiled in this way with the gn variable: | 13 # Chrome can be compiled in this way with the gn variable: |
16 # | 14 # |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 cros_v8_snapshot_cxx = "g++" | 67 cros_v8_snapshot_cxx = "g++" |
70 cros_v8_snapshot_ld = "" | 68 cros_v8_snapshot_ld = "" |
71 cros_v8_snapshot_nm = "" | 69 cros_v8_snapshot_nm = "" |
72 cros_v8_snapshot_readelf = "" | 70 cros_v8_snapshot_readelf = "" |
73 cros_v8_snapshot_extra_cflags = "" | 71 cros_v8_snapshot_extra_cflags = "" |
74 cros_v8_snapshot_extra_cppflags = "" | 72 cros_v8_snapshot_extra_cppflags = "" |
75 cros_v8_snapshot_extra_cxxflags = "" | 73 cros_v8_snapshot_extra_cxxflags = "" |
76 cros_v8_snapshot_extra_ldflags = "" | 74 cros_v8_snapshot_extra_ldflags = "" |
77 cros_v8_snapshot_is_clang = false | 75 cros_v8_snapshot_is_clang = false |
78 } | 76 } |
79 | |
80 # TODO(dpranke): Delete this after we get rid of the reference to | |
81 # build/toolchain/cros:clang_target in BUILDCONFIG.gn | |
82 clang_toolchain("clang_target") { | |
83 toolchain_cpu = target_cpu | |
84 toolchain_os = "linux" | |
85 } | |
86 | |
87 gcc_toolchain("target") { | |
88 # These are args for the template. | |
89 ar = cros_target_ar | |
90 cc = cros_target_cc | |
91 cxx = cros_target_cxx | |
92 ld = cxx | |
93 if (cros_target_ld != "") { | |
94 ld = cros_target_ld | |
95 } | |
96 if (cros_target_nm != "") { | |
97 nm = cros_target_nm | |
98 } | |
99 if (cros_target_readelf != "") { | |
100 readelf = cros_target_readelf | |
101 } | |
102 extra_cflags = cros_target_extra_cflags | |
103 extra_cppflags = cros_target_extra_cppflags | |
104 extra_cxxflags = cros_target_extra_cxxflags | |
105 extra_ldflags = cros_target_extra_ldflags | |
106 | |
107 # These are passed through as toolchain_args. | |
108 cc_wrapper = "" | |
109 is_clang = is_clang | |
110 toolchain_cpu = target_cpu | |
111 toolchain_os = "linux" | |
112 } | |
113 | |
114 gcc_toolchain("host") { | |
115 # These are args for the template. | |
116 ar = cros_host_ar | |
117 cc = cros_host_cc | |
118 cxx = cros_host_cxx | |
119 ld = cxx | |
120 if (cros_host_ld != "") { | |
121 ld = cros_host_ld | |
122 } | |
123 if (cros_host_nm != "") { | |
124 nm = cros_host_nm | |
125 } | |
126 if (cros_host_readelf != "") { | |
127 readelf = cros_host_readelf | |
128 } | |
129 extra_cflags = cros_host_extra_cflags | |
130 extra_cppflags = cros_host_extra_cppflags | |
131 extra_cxxflags = cros_host_extra_cxxflags | |
132 extra_ldflags = cros_host_extra_ldflags | |
133 | |
134 # These are passed through as toolchain_args. | |
135 cc_wrapper = "" | |
136 is_clang = cros_host_is_clang | |
137 toolchain_cpu = host_cpu | |
138 toolchain_os = "linux" | |
139 use_sysroot = false | |
140 } | |
141 | |
142 gcc_toolchain("v8_snapshot") { | |
143 # These are args for the template. | |
144 ar = cros_v8_snapshot_ar | |
145 cc = cros_v8_snapshot_cc | |
146 cxx = cros_v8_snapshot_cxx | |
147 ld = cxx | |
148 if (cros_v8_snapshot_ld != "") { | |
149 ld = cros_v8_snapshot_ld | |
150 } | |
151 if (cros_v8_snapshot_nm != "") { | |
152 nm = cros_v8_snapshot_nm | |
153 } | |
154 if (cros_v8_snapshot_readelf != "") { | |
155 readelf = cros_v8_snapshot_readelf | |
156 } | |
157 extra_cflags = cros_v8_snapshot_extra_cflags | |
158 extra_cppflags = cros_v8_snapshot_extra_cppflags | |
159 extra_cxxflags = cros_v8_snapshot_extra_cxxflags | |
160 extra_ldflags = cros_v8_snapshot_extra_ldflags | |
161 | |
162 # These are passed through as toolchain_args. | |
163 cc_wrapper = "" | |
164 is_clang = cros_v8_snapshot_is_clang | |
165 if (target_cpu == "x86" || target_cpu == "arm" || target_cpu == "mipsel") { | |
166 toolchain_cpu = "x86" | |
167 } else { | |
168 toolchain_cpu = "x64" | |
169 } | |
170 toolchain_os = "linux" | |
171 use_sysroot = false | |
172 } | |
OLD | NEW |