Chromium Code Reviews| 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 11 matching lines...) Expand all Loading... | |
| 22 ], | 22 ], |
| 23 "trim list lines") | 23 "trim list lines") |
| 24 nacl_x86_glibc_rev = revisions[0] | 24 nacl_x86_glibc_rev = revisions[0] |
| 25 pnacl_newlib_rev = revisions[1] | 25 pnacl_newlib_rev = revisions[1] |
| 26 | 26 |
| 27 nacl_toolchain("newlib_pnacl") { | 27 nacl_toolchain("newlib_pnacl") { |
| 28 toolchain_package = "pnacl_newlib" | 28 toolchain_package = "pnacl_newlib" |
| 29 toolchain_revision = pnacl_newlib_rev | 29 toolchain_revision = pnacl_newlib_rev |
| 30 toolchain_cpu = "pnacl" | 30 toolchain_cpu = "pnacl" |
| 31 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/pnacl-" | 31 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/pnacl-" |
| 32 is_nacl_glibc = false | |
| 32 | 33 |
| 33 cc = toolprefix + "clang" | 34 cc = toolprefix + "clang" |
| 34 cxx = toolprefix + "clang++" | 35 cxx = toolprefix + "clang++" |
| 35 ar = toolprefix + "ar" | 36 ar = toolprefix + "ar" |
| 36 ld = cxx | 37 ld = cxx |
| 37 executable_extension = ".pexe.debug" | 38 executable_extension = ".pexe.debug" |
| 38 | 39 |
| 39 finalize = toolprefix + "finalize" | 40 finalize = toolprefix + "finalize" |
| 40 nonfinal_file = | 41 nonfinal_file = |
| 41 "{{root_out_dir}}/{{target_output_name}}${executable_extension}" | 42 "{{root_out_dir}}/{{target_output_name}}${executable_extension}" |
| 42 finalized_file = "{{root_out_dir}}/{{target_output_name}}.pexe" | 43 finalized_file = "{{root_out_dir}}/{{target_output_name}}.pexe" |
| 43 postlink = "$finalize $nonfinal_file -o $finalized_file" | 44 postlink = "$finalize $nonfinal_file -o $finalized_file" |
| 44 link_outputs = [ finalized_file ] | 45 link_outputs = [ finalized_file ] |
| 45 } | 46 } |
| 46 | 47 |
| 47 nacl_toolchain("glibc_x86") { | 48 nacl_toolchain("glibc_x86") { |
| 48 toolchain_package = "nacl_x86_glibc" | 49 toolchain_package = "nacl_x86_glibc" |
| 49 toolchain_revision = nacl_x86_glibc_rev | 50 toolchain_revision = nacl_x86_glibc_rev |
| 50 toolchain_cpu = "x86" | 51 toolchain_cpu = "x86" |
| 51 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" | 52 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" |
| 52 is_clang = false | 53 is_clang = false |
| 54 is_nacl_glibc = true | |
| 53 | 55 |
| 54 cc = toolprefix + "gcc" | 56 cc = toolprefix + "gcc" |
| 55 cxx = toolprefix + "g++" | 57 cxx = toolprefix + "g++" |
| 56 ar = toolprefix + "ar" | 58 ar = toolprefix + "ar" |
| 57 ld = cxx | 59 ld = cxx |
| 58 } | 60 } |
| 59 | 61 |
| 60 nacl_toolchain("glibc_x64") { | 62 nacl_toolchain("glibc_x64") { |
| 61 toolchain_package = "nacl_x86_glibc" | 63 toolchain_package = "nacl_x86_glibc" |
| 62 toolchain_revision = nacl_x86_glibc_rev | 64 toolchain_revision = nacl_x86_glibc_rev |
| 63 toolchain_cpu = "x64" | 65 toolchain_cpu = "x64" |
| 64 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" | 66 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" |
| 65 is_clang = false | 67 is_clang = false |
| 68 is_nacl_glibc = true | |
| 66 | 69 |
| 67 cc = toolprefix + "gcc" | 70 cc = toolprefix + "gcc" |
| 68 cxx = toolprefix + "g++" | 71 cxx = toolprefix + "g++" |
| 69 ar = toolprefix + "ar" | 72 ar = toolprefix + "ar" |
| 70 ld = cxx | 73 ld = cxx |
| 71 } | 74 } |
| 72 | 75 |
| 73 template("nacl_clang_toolchain") { | 76 template("nacl_clang_toolchain") { |
| 74 toolchain_cpu = target_name | 77 toolchain_cpu = target_name |
| 75 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") | 78 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 101 | 104 |
| 102 tls_edit_label = | 105 tls_edit_label = |
| 103 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)" | 106 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)" |
| 104 host_toolchain_out_dir = | 107 host_toolchain_out_dir = |
| 105 rebase_path(get_label_info(tls_edit_label, "root_out_dir"), | 108 rebase_path(get_label_info(tls_edit_label, "root_out_dir"), |
| 106 root_build_dir) | 109 root_build_dir) |
| 107 tls_edit = "${host_toolchain_out_dir}/tls_edit" | 110 tls_edit = "${host_toolchain_out_dir}/tls_edit" |
| 108 | 111 |
| 109 nacl_toolchain("irt_" + toolchain_cpu) { | 112 nacl_toolchain("irt_" + toolchain_cpu) { |
| 110 is_clang = true | 113 is_clang = true |
| 114 is_nacl_glibc = false | |
|
Roland McGrath
2015/09/23 18:33:36
This is superfluous, right? The default is false.
Petr Hosek
2015/09/23 18:37:28
Removed.
| |
| 111 cc = toolprefix + "clang" | 115 cc = toolprefix + "clang" |
| 112 cxx = toolprefix + "clang++" | 116 cxx = toolprefix + "clang++" |
| 113 ar = toolprefix + "ar" | 117 ar = toolprefix + "ar" |
| 114 readelf = toolprefix + "readelf" | 118 readelf = toolprefix + "readelf" |
| 115 | 119 |
| 116 # Some IRT implementations (notably, Chromium's) contain C++ code, | 120 # Some IRT implementations (notably, Chromium's) contain C++ code, |
| 117 # so we need to link w/ the C++ linker. | 121 # so we need to link w/ the C++ linker. |
| 118 ld = "${python_path} ${link_irt} --tls-edit=${tls_edit} --link-cmd=${cxx} -- readelf-cmd=${readelf}" | 122 ld = "${python_path} ${link_irt} --tls-edit=${tls_edit} --link-cmd=${cxx} -- readelf-cmd=${readelf}" |
| 119 | 123 |
| 120 # TODO(ncbray): depend on link script | 124 # TODO(ncbray): depend on link script |
| (...skipping 17 matching lines...) Expand all Loading... | |
| 138 toolchain_tuple = "i686-nacl" | 142 toolchain_tuple = "i686-nacl" |
| 139 } | 143 } |
| 140 | 144 |
| 141 nacl_clang_toolchains("x64") { | 145 nacl_clang_toolchains("x64") { |
| 142 toolchain_tuple = "x86_64-nacl" | 146 toolchain_tuple = "x86_64-nacl" |
| 143 } | 147 } |
| 144 | 148 |
| 145 nacl_clang_toolchains("arm") { | 149 nacl_clang_toolchains("arm") { |
| 146 toolchain_tuple = "arm-nacl" | 150 toolchain_tuple = "arm-nacl" |
| 147 } | 151 } |
| OLD | NEW |