| OLD | NEW |
| 1 # Copyright (c) 2014 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2014 The Native Client 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/sysroot.gni") | 5 import("//build/config/sysroot.gni") |
| 6 import("//build/toolchain/nacl_toolchain.gni") | 6 import("//build/toolchain/nacl_toolchain.gni") |
| 7 | 7 |
| 8 nacl_toolchain_dir = rebase_path("//native_client/toolchain", root_build_dir) | 8 nacl_toolchain_dir = rebase_path("//native_client/toolchain", root_build_dir) |
| 9 os_toolchain_dir = "${nacl_toolchain_dir}/${current_os}_x86" | 9 os_toolchain_dir = "${nacl_toolchain_dir}/${current_os}_x86" |
| 10 | 10 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 toolchain_cpu = "x64" | 132 toolchain_cpu = "x64" |
| 133 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" | 133 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" |
| 134 is_clang = true | 134 is_clang = true |
| 135 | 135 |
| 136 cc = toolprefix + "clang" | 136 cc = toolprefix + "clang" |
| 137 cxx = toolprefix + "clang++" | 137 cxx = toolprefix + "clang++" |
| 138 ar = toolprefix + "ar" | 138 ar = toolprefix + "ar" |
| 139 ld = cxx | 139 ld = cxx |
| 140 } | 140 } |
| 141 | 141 |
| 142 link_irt = rebase_path("//native_client/build/link_irt.py", root_build_dir) | 142 template("nacl_irt_toolchain") { |
| 143 toolchain_cpu = target_name |
| 144 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") |
| 143 | 145 |
| 144 nacl_toolchain("irt_x86") { | |
| 145 toolchain_package = "pnacl_newlib" | 146 toolchain_package = "pnacl_newlib" |
| 146 toolchain_revision = pnacl_newlib_rev | 147 toolchain_revision = pnacl_newlib_rev |
| 147 toolchain_cpu = "x86" | 148 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/" + |
| 148 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" | 149 invoker.toolchain_tuple + "-" |
| 149 is_clang = true | |
| 150 | 150 |
| 151 cc = toolprefix + "clang" | 151 link_irt = rebase_path("//native_client/build/link_irt.py", root_build_dir) |
| 152 cxx = toolprefix + "clang++" | |
| 153 ar = toolprefix + "ar" | |
| 154 readelf = toolprefix + "readelf" | |
| 155 | 152 |
| 156 tls_edit_label = | 153 tls_edit_label = |
| 157 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)" | 154 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)" |
| 158 host_toolchain_out_dir = | 155 host_toolchain_out_dir = |
| 159 rebase_path(get_label_info(tls_edit_label, "root_out_dir"), | 156 rebase_path(get_label_info(tls_edit_label, "root_out_dir"), |
| 160 root_build_dir) | 157 root_build_dir) |
| 158 tls_edit = "${host_toolchain_out_dir}/tls_edit" |
| 161 | 159 |
| 162 # Some IRT implementations (notably, Chromium's) contain C++ code, | 160 nacl_toolchain("irt_" + toolchain_cpu) { |
| 163 # so we need to link w/ the C++ linker. | 161 is_clang = true |
| 164 ld = "${python_path} ${link_irt} --tls-edit=${host_toolchain_out_dir}/tls_edit
--link-cmd=${cxx} --readelf-cmd=${readelf}" | 162 cc = toolprefix + "clang" |
| 163 cxx = toolprefix + "clang++" |
| 164 ar = toolprefix + "ar" |
| 165 readelf = toolprefix + "readelf" |
| 165 | 166 |
| 166 # TODO(ncbray): depend on link script | 167 # Some IRT implementations (notably, Chromium's) contain C++ code, |
| 167 deps = [ | 168 # so we need to link w/ the C++ linker. |
| 168 tls_edit_label, | 169 ld = "${python_path} ${link_irt} --tls-edit=${tls_edit} --link-cmd=${cxx} --
readelf-cmd=${readelf}" |
| 169 ] | 170 |
| 171 # TODO(ncbray): depend on link script |
| 172 deps = [ |
| 173 tls_edit_label, |
| 174 ] |
| 175 } |
| 170 } | 176 } |
| 171 | 177 |
| 172 nacl_toolchain("irt_x64") { | 178 nacl_irt_toolchain("x86") { |
| 173 toolchain_package = "pnacl_newlib" | 179 toolchain_tuple = "i686-nacl" |
| 174 toolchain_revision = pnacl_newlib_rev | |
| 175 toolchain_cpu = "x64" | |
| 176 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" | |
| 177 is_clang = true | |
| 178 | |
| 179 cc = toolprefix + "clang" | |
| 180 cxx = toolprefix + "clang++" | |
| 181 ar = toolprefix + "ar" | |
| 182 readelf = toolprefix + "readelf" | |
| 183 | |
| 184 # Some IRT implementations (notably, Chromium's) contain C++ code, | |
| 185 # so we need to link w/ the C++ linker. | |
| 186 ld = "${python_path} ${link_irt} --tls-edit=tls_edit --link-cmd=${cxx} --reade
lf-cmd=${readelf}" | |
| 187 | |
| 188 # TODO(ncbray): depend on link script | |
| 189 deps = [ | |
| 190 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)", | |
| 191 ] | |
| 192 } | 180 } |
| 193 | 181 |
| 194 # Uses newlib to match the Chrome build. | 182 nacl_irt_toolchain("x64") { |
| 195 nacl_toolchain("irt_arm") { | 183 toolchain_tuple = "x86_64-nacl" |
| 196 toolchain_package = "nacl_arm_newlib" | 184 } |
| 197 toolchain_revision = nacl_arm_newlib_rev | |
| 198 toolchain_cpu = "arm" | |
| 199 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/arm-nacl-" | |
| 200 is_clang = false | |
| 201 | 185 |
| 202 cc = toolprefix + "gcc" | 186 nacl_irt_toolchain("arm") { |
| 203 cxx = toolprefix + "g++" | 187 toolchain_tuple = "arm-nacl" |
| 204 ar = toolprefix + "ar" | |
| 205 readelf = toolprefix + "readelf" | |
| 206 | |
| 207 # Some IRT implementations (notably, Chromium's) contain C++ code, | |
| 208 # so we need to link w/ the C++ linker. | |
| 209 ld = "${python_path} ${link_irt} --tls-edit=tls_edit --link-cmd=${cxx} --reade
lf-cmd=${readelf}" | |
| 210 | |
| 211 # TODO(ncbray): depend on link script | |
| 212 deps = [ | |
| 213 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)", | |
| 214 ] | |
| 215 } | 188 } |
| OLD | NEW |