| 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 16 matching lines...) Expand all Loading... |
| 27 nacl_x86_newlib_rev = revisions[1] | 27 nacl_x86_newlib_rev = revisions[1] |
| 28 nacl_x86_glibc_rev = revisions[2] | 28 nacl_x86_glibc_rev = revisions[2] |
| 29 pnacl_newlib_rev = revisions[3] | 29 pnacl_newlib_rev = revisions[3] |
| 30 | 30 |
| 31 nacl_toolchain("newlib_arm") { | 31 nacl_toolchain("newlib_arm") { |
| 32 toolchain_package = "nacl_arm_newlib" | 32 toolchain_package = "nacl_arm_newlib" |
| 33 toolchain_revision = nacl_arm_newlib_rev | 33 toolchain_revision = nacl_arm_newlib_rev |
| 34 toolchain_cpu = "arm" | 34 toolchain_cpu = "arm" |
| 35 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/arm-nacl-" | 35 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/arm-nacl-" |
| 36 is_clang = false | 36 is_clang = false |
| 37 is_nacl_glibc = false |
| 37 | 38 |
| 38 cc = toolprefix + "gcc" | 39 cc = toolprefix + "gcc" |
| 39 cxx = toolprefix + "g++" | 40 cxx = toolprefix + "g++" |
| 40 ar = toolprefix + "ar" | 41 ar = toolprefix + "ar" |
| 41 ld = cxx | 42 ld = cxx |
| 42 } | 43 } |
| 43 | 44 |
| 44 nacl_toolchain("newlib_x86") { | 45 nacl_toolchain("newlib_x86") { |
| 45 toolchain_package = "nacl_x86_newlib" | 46 toolchain_package = "nacl_x86_newlib" |
| 46 toolchain_revision = nacl_x86_newlib_rev | 47 toolchain_revision = nacl_x86_newlib_rev |
| 47 toolchain_cpu = "x86" | 48 toolchain_cpu = "x86" |
| 48 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" | 49 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" |
| 49 is_clang = false | 50 is_clang = false |
| 51 is_nacl_glibc = false |
| 50 | 52 |
| 51 cc = toolprefix + "gcc" | 53 cc = toolprefix + "gcc" |
| 52 cxx = toolprefix + "g++" | 54 cxx = toolprefix + "g++" |
| 53 ar = toolprefix + "ar" | 55 ar = toolprefix + "ar" |
| 54 ld = cxx | 56 ld = cxx |
| 55 } | 57 } |
| 56 | 58 |
| 57 nacl_toolchain("newlib_x64") { | 59 nacl_toolchain("newlib_x64") { |
| 58 toolchain_package = "nacl_x86_newlib" | 60 toolchain_package = "nacl_x86_newlib" |
| 59 toolchain_revision = nacl_x86_newlib_rev | 61 toolchain_revision = nacl_x86_newlib_rev |
| 60 toolchain_cpu = "x64" | 62 toolchain_cpu = "x64" |
| 61 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" | 63 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" |
| 62 is_clang = false | 64 is_clang = false |
| 65 is_nacl_glibc = false |
| 63 | 66 |
| 64 cc = toolprefix + "gcc" | 67 cc = toolprefix + "gcc" |
| 65 cxx = toolprefix + "g++" | 68 cxx = toolprefix + "g++" |
| 66 ar = toolprefix + "ar" | 69 ar = toolprefix + "ar" |
| 67 ld = cxx | 70 ld = cxx |
| 68 } | 71 } |
| 69 | 72 |
| 70 nacl_toolchain("newlib_pnacl") { | 73 nacl_toolchain("newlib_pnacl") { |
| 71 toolchain_package = "pnacl_newlib" | 74 toolchain_package = "pnacl_newlib" |
| 72 toolchain_revision = pnacl_newlib_rev | 75 toolchain_revision = pnacl_newlib_rev |
| 73 toolchain_cpu = "pnacl" | 76 toolchain_cpu = "pnacl" |
| 74 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/pnacl-" | 77 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/pnacl-" |
| 78 is_nacl_glibc = false |
| 75 | 79 |
| 76 cc = toolprefix + "clang" | 80 cc = toolprefix + "clang" |
| 77 cxx = toolprefix + "clang++" | 81 cxx = toolprefix + "clang++" |
| 78 ar = toolprefix + "ar" | 82 ar = toolprefix + "ar" |
| 79 ld = cxx | 83 ld = cxx |
| 80 executable_extension = ".pexe.debug" | 84 executable_extension = ".pexe.debug" |
| 81 | 85 |
| 82 finalize = toolprefix + "finalize" | 86 finalize = toolprefix + "finalize" |
| 83 nonfinal_file = | 87 nonfinal_file = |
| 84 "{{root_out_dir}}/{{target_output_name}}${executable_extension}" | 88 "{{root_out_dir}}/{{target_output_name}}${executable_extension}" |
| 85 finalized_file = "{{root_out_dir}}/{{target_output_name}}.pexe" | 89 finalized_file = "{{root_out_dir}}/{{target_output_name}}.pexe" |
| 86 postlink = "$finalize $nonfinal_file -o $finalized_file" | 90 postlink = "$finalize $nonfinal_file -o $finalized_file" |
| 87 link_outputs = [ finalized_file ] | 91 link_outputs = [ finalized_file ] |
| 88 } | 92 } |
| 89 | 93 |
| 90 nacl_toolchain("glibc_x86") { | 94 nacl_toolchain("glibc_x86") { |
| 91 toolchain_package = "nacl_x86_glibc" | 95 toolchain_package = "nacl_x86_glibc" |
| 92 toolchain_revision = nacl_x86_glibc_rev | 96 toolchain_revision = nacl_x86_glibc_rev |
| 93 toolchain_cpu = "x86" | 97 toolchain_cpu = "x86" |
| 94 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" | 98 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" |
| 95 is_clang = false | 99 is_clang = false |
| 100 is_nacl_glibc = true |
| 96 | 101 |
| 97 cc = toolprefix + "gcc" | 102 cc = toolprefix + "gcc" |
| 98 cxx = toolprefix + "g++" | 103 cxx = toolprefix + "g++" |
| 99 ar = toolprefix + "ar" | 104 ar = toolprefix + "ar" |
| 100 ld = cxx | 105 ld = cxx |
| 101 } | 106 } |
| 102 | 107 |
| 103 nacl_toolchain("glibc_x64") { | 108 nacl_toolchain("glibc_x64") { |
| 104 toolchain_package = "nacl_x86_glibc" | 109 toolchain_package = "nacl_x86_glibc" |
| 105 toolchain_revision = nacl_x86_glibc_rev | 110 toolchain_revision = nacl_x86_glibc_rev |
| 106 toolchain_cpu = "x64" | 111 toolchain_cpu = "x64" |
| 107 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" | 112 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" |
| 108 is_clang = false | 113 is_clang = false |
| 114 is_nacl_glibc = true |
| 109 | 115 |
| 110 cc = toolprefix + "gcc" | 116 cc = toolprefix + "gcc" |
| 111 cxx = toolprefix + "g++" | 117 cxx = toolprefix + "g++" |
| 112 ar = toolprefix + "ar" | 118 ar = toolprefix + "ar" |
| 113 ld = cxx | 119 ld = cxx |
| 114 } | 120 } |
| 115 | 121 |
| 116 nacl_toolchain("clang_newlib_x86") { | 122 nacl_toolchain("clang_newlib_x86") { |
| 117 toolchain_package = "pnacl_newlib" | 123 toolchain_package = "pnacl_newlib" |
| 118 toolchain_revision = pnacl_newlib_rev | 124 toolchain_revision = pnacl_newlib_rev |
| 119 toolchain_cpu = "x86" | 125 toolchain_cpu = "x86" |
| 120 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" | 126 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" |
| 121 is_clang = true | 127 is_clang = true |
| 128 is_nacl_glibc = false |
| 122 | 129 |
| 123 cc = toolprefix + "clang" | 130 cc = toolprefix + "clang" |
| 124 cxx = toolprefix + "clang++" | 131 cxx = toolprefix + "clang++" |
| 125 ar = toolprefix + "ar" | 132 ar = toolprefix + "ar" |
| 126 ld = cxx | 133 ld = cxx |
| 127 } | 134 } |
| 128 | 135 |
| 129 nacl_toolchain("clang_newlib_x64") { | 136 nacl_toolchain("clang_newlib_x64") { |
| 130 toolchain_package = "pnacl_newlib" | 137 toolchain_package = "pnacl_newlib" |
| 131 toolchain_revision = pnacl_newlib_rev | 138 toolchain_revision = pnacl_newlib_rev |
| 132 toolchain_cpu = "x64" | 139 toolchain_cpu = "x64" |
| 133 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" | 140 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" |
| 134 is_clang = true | 141 is_clang = true |
| 142 is_nacl_glibc = false |
| 135 | 143 |
| 136 cc = toolprefix + "clang" | 144 cc = toolprefix + "clang" |
| 137 cxx = toolprefix + "clang++" | 145 cxx = toolprefix + "clang++" |
| 138 ar = toolprefix + "ar" | 146 ar = toolprefix + "ar" |
| 139 ld = cxx | 147 ld = cxx |
| 140 } | 148 } |
| 141 | 149 |
| 142 link_irt = rebase_path("//native_client/build/link_irt.py", root_build_dir) | 150 link_irt = rebase_path("//native_client/build/link_irt.py", root_build_dir) |
| 143 | 151 |
| 144 nacl_toolchain("irt_x86") { | 152 nacl_toolchain("irt_x86") { |
| 145 toolchain_package = "pnacl_newlib" | 153 toolchain_package = "pnacl_newlib" |
| 146 toolchain_revision = pnacl_newlib_rev | 154 toolchain_revision = pnacl_newlib_rev |
| 147 toolchain_cpu = "x86" | 155 toolchain_cpu = "x86" |
| 148 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" | 156 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" |
| 149 is_clang = true | 157 is_clang = true |
| 158 is_nacl_glibc = false |
| 150 | 159 |
| 151 cc = toolprefix + "clang" | 160 cc = toolprefix + "clang" |
| 152 cxx = toolprefix + "clang++" | 161 cxx = toolprefix + "clang++" |
| 153 ar = toolprefix + "ar" | 162 ar = toolprefix + "ar" |
| 154 readelf = toolprefix + "readelf" | 163 readelf = toolprefix + "readelf" |
| 155 | 164 |
| 156 # Some IRT implementations (notably, Chromium's) contain C++ code, | 165 # Some IRT implementations (notably, Chromium's) contain C++ code, |
| 157 # so we need to link w/ the C++ linker. | 166 # so we need to link w/ the C++ linker. |
| 158 ld = "${python_path} ${link_irt} --tls-edit=tls_edit --link-cmd=${cxx} --reade
lf-cmd=${readelf}" | 167 ld = "${python_path} ${link_irt} --tls-edit=tls_edit --link-cmd=${cxx} --reade
lf-cmd=${readelf}" |
| 159 | 168 |
| 160 # TODO(ncbray): depend on link script | 169 # TODO(ncbray): depend on link script |
| 161 deps = [ | 170 deps = [ |
| 162 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)", | 171 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)", |
| 163 ] | 172 ] |
| 164 } | 173 } |
| 165 | 174 |
| 166 nacl_toolchain("irt_x64") { | 175 nacl_toolchain("irt_x64") { |
| 167 toolchain_package = "pnacl_newlib" | 176 toolchain_package = "pnacl_newlib" |
| 168 toolchain_revision = pnacl_newlib_rev | 177 toolchain_revision = pnacl_newlib_rev |
| 169 toolchain_cpu = "x64" | 178 toolchain_cpu = "x64" |
| 170 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" | 179 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" |
| 171 is_clang = true | 180 is_clang = true |
| 181 is_nacl_glibc = false |
| 172 | 182 |
| 173 cc = toolprefix + "clang" | 183 cc = toolprefix + "clang" |
| 174 cxx = toolprefix + "clang++" | 184 cxx = toolprefix + "clang++" |
| 175 ar = toolprefix + "ar" | 185 ar = toolprefix + "ar" |
| 176 readelf = toolprefix + "readelf" | 186 readelf = toolprefix + "readelf" |
| 177 | 187 |
| 178 # Some IRT implementations (notably, Chromium's) contain C++ code, | 188 # Some IRT implementations (notably, Chromium's) contain C++ code, |
| 179 # so we need to link w/ the C++ linker. | 189 # so we need to link w/ the C++ linker. |
| 180 ld = "${python_path} ${link_irt} --tls-edit=tls_edit --link-cmd=${cxx} --reade
lf-cmd=${readelf}" | 190 ld = "${python_path} ${link_irt} --tls-edit=tls_edit --link-cmd=${cxx} --reade
lf-cmd=${readelf}" |
| 181 | 191 |
| 182 # TODO(ncbray): depend on link script | 192 # TODO(ncbray): depend on link script |
| 183 deps = [ | 193 deps = [ |
| 184 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)", | 194 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)", |
| 185 ] | 195 ] |
| 186 } | 196 } |
| 187 | 197 |
| 188 # Uses newlib to match the Chrome build. | 198 # Uses newlib to match the Chrome build. |
| 189 nacl_toolchain("irt_arm") { | 199 nacl_toolchain("irt_arm") { |
| 190 toolchain_package = "nacl_arm_newlib" | 200 toolchain_package = "nacl_arm_newlib" |
| 191 toolchain_revision = nacl_arm_newlib_rev | 201 toolchain_revision = nacl_arm_newlib_rev |
| 192 toolchain_cpu = "arm" | 202 toolchain_cpu = "arm" |
| 193 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/arm-nacl-" | 203 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/arm-nacl-" |
| 194 is_clang = false | 204 is_clang = false |
| 205 is_nacl_glibc = false |
| 195 | 206 |
| 196 cc = toolprefix + "gcc" | 207 cc = toolprefix + "gcc" |
| 197 cxx = toolprefix + "g++" | 208 cxx = toolprefix + "g++" |
| 198 ar = toolprefix + "ar" | 209 ar = toolprefix + "ar" |
| 199 readelf = toolprefix + "readelf" | 210 readelf = toolprefix + "readelf" |
| 200 | 211 |
| 201 # Some IRT implementations (notably, Chromium's) contain C++ code, | 212 # Some IRT implementations (notably, Chromium's) contain C++ code, |
| 202 # so we need to link w/ the C++ linker. | 213 # so we need to link w/ the C++ linker. |
| 203 ld = "${python_path} ${link_irt} --tls-edit=tls_edit --link-cmd=${cxx} --reade
lf-cmd=${readelf}" | 214 ld = "${python_path} ${link_irt} --tls-edit=tls_edit --link-cmd=${cxx} --reade
lf-cmd=${readelf}" |
| 204 | 215 |
| 205 # TODO(ncbray): depend on link script | 216 # TODO(ncbray): depend on link script |
| 206 deps = [ | 217 deps = [ |
| 207 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)", | 218 "//native_client/src/tools/tls_edit:tls_edit($host_toolchain)", |
| 208 ] | 219 ] |
| 209 } | 220 } |
| OLD | NEW |