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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 toolchain_cpu = "x64" | 63 toolchain_cpu = "x64" |
64 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" | 64 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" |
65 is_clang = false | 65 is_clang = false |
66 | 66 |
67 cc = toolprefix + "gcc" | 67 cc = toolprefix + "gcc" |
68 cxx = toolprefix + "g++" | 68 cxx = toolprefix + "g++" |
69 ar = toolprefix + "ar" | 69 ar = toolprefix + "ar" |
70 ld = cxx | 70 ld = cxx |
71 } | 71 } |
72 | 72 |
73 nacl_toolchain("clang_newlib_x86") { | 73 template("nacl_clang_toolchain") { |
| 74 toolchain_cpu = target_name |
| 75 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") |
| 76 |
74 toolchain_package = "pnacl_newlib" | 77 toolchain_package = "pnacl_newlib" |
75 toolchain_revision = pnacl_newlib_rev | 78 toolchain_revision = pnacl_newlib_rev |
76 toolchain_cpu = "x86" | 79 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/" + |
77 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/i686-nacl-" | 80 invoker.toolchain_tuple + "-" |
78 is_clang = true | |
79 | 81 |
80 cc = toolprefix + "clang" | 82 nacl_toolchain("clang_newlib_" + toolchain_cpu) { |
81 cxx = toolprefix + "clang++" | 83 is_clang = true |
82 ar = toolprefix + "ar" | 84 cc = toolprefix + "clang" |
83 ld = cxx | 85 cxx = toolprefix + "clang++" |
84 } | 86 ar = toolprefix + "ar" |
85 | 87 ld = cxx |
86 nacl_toolchain("clang_newlib_x64") { | 88 } |
87 toolchain_package = "pnacl_newlib" | |
88 toolchain_revision = pnacl_newlib_rev | |
89 toolchain_cpu = "x64" | |
90 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/x86_64-nacl-" | |
91 is_clang = true | |
92 | |
93 cc = toolprefix + "clang" | |
94 cxx = toolprefix + "clang++" | |
95 ar = toolprefix + "ar" | |
96 ld = cxx | |
97 } | 89 } |
98 | 90 |
99 template("nacl_irt_toolchain") { | 91 template("nacl_irt_toolchain") { |
100 toolchain_cpu = target_name | 92 toolchain_cpu = target_name |
101 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") | 93 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") |
102 | 94 |
103 toolchain_package = "pnacl_newlib" | 95 toolchain_package = "pnacl_newlib" |
104 toolchain_revision = pnacl_newlib_rev | 96 toolchain_revision = pnacl_newlib_rev |
105 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/" + | 97 toolprefix = "${os_toolchain_dir}/${toolchain_package}/bin/" + |
106 invoker.toolchain_tuple + "-" | 98 invoker.toolchain_tuple + "-" |
(...skipping 18 matching lines...) Expand all Loading... |
125 # so we need to link w/ the C++ linker. | 117 # so we need to link w/ the C++ linker. |
126 ld = "${python_path} ${link_irt} --tls-edit=${tls_edit} --link-cmd=${cxx} --
readelf-cmd=${readelf}" | 118 ld = "${python_path} ${link_irt} --tls-edit=${tls_edit} --link-cmd=${cxx} --
readelf-cmd=${readelf}" |
127 | 119 |
128 # TODO(ncbray): depend on link script | 120 # TODO(ncbray): depend on link script |
129 deps = [ | 121 deps = [ |
130 tls_edit_label, | 122 tls_edit_label, |
131 ] | 123 ] |
132 } | 124 } |
133 } | 125 } |
134 | 126 |
135 nacl_irt_toolchain("x86") { | 127 template("nacl_clang_toolchains") { |
| 128 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") |
| 129 nacl_clang_toolchain(target_name) { |
| 130 toolchain_tuple = invoker.toolchain_tuple |
| 131 } |
| 132 nacl_irt_toolchain(target_name) { |
| 133 toolchain_tuple = invoker.toolchain_tuple |
| 134 } |
| 135 } |
| 136 |
| 137 nacl_clang_toolchains("x86") { |
136 toolchain_tuple = "i686-nacl" | 138 toolchain_tuple = "i686-nacl" |
137 } | 139 } |
138 | 140 |
139 nacl_irt_toolchain("x64") { | 141 nacl_clang_toolchains("x64") { |
140 toolchain_tuple = "x86_64-nacl" | 142 toolchain_tuple = "x86_64-nacl" |
141 } | 143 } |
142 | 144 |
143 nacl_irt_toolchain("arm") { | 145 nacl_clang_toolchains("arm") { |
144 toolchain_tuple = "arm-nacl" | 146 toolchain_tuple = "arm-nacl" |
145 } | 147 } |
OLD | NEW |