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/config/nacl/config.gni") | 6 import("//build/config/nacl/config.gni") |
7 import("//build/toolchain/nacl_toolchain.gni") | 7 import("//build/toolchain/nacl_toolchain.gni") |
8 | 8 |
9 # Add the toolchain revision as a preprocessor define so that sources are | 9 # Add the toolchain revision as a preprocessor define so that sources are |
10 # rebuilt when a toolchain is updated. | 10 # rebuilt when a toolchain is updated. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 strip = "finalize" | 99 strip = "finalize" |
100 } | 100 } |
101 | 101 |
102 pnacl_toolchain("newlib_pnacl_nonsfi") { | 102 pnacl_toolchain("newlib_pnacl_nonsfi") { |
103 executable_extension = "" | 103 executable_extension = "" |
104 strip = "strip" | 104 strip = "strip" |
105 } | 105 } |
106 | 106 |
107 template("nacl_glibc_toolchain") { | 107 template("nacl_glibc_toolchain") { |
108 toolchain_cpu = target_name | 108 toolchain_cpu = target_name |
| 109 toolchain_cc_args = "" |
109 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") | 110 assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") |
110 assert(defined(invoker.toolchain_package), "Must define toolchain_package") | 111 assert(defined(invoker.toolchain_package), "Must define toolchain_package") |
111 assert(defined(invoker.toolchain_revision), "Must define toolchain_revision") | 112 assert(defined(invoker.toolchain_revision), "Must define toolchain_revision") |
112 forward_variables_from(invoker, | 113 forward_variables_from(invoker, |
113 [ | 114 [ |
114 "toolchain_package", | 115 "toolchain_package", |
115 "toolchain_revision", | 116 "toolchain_revision", |
| 117 "toolchain_cc_args", |
116 ]) | 118 ]) |
117 | 119 |
118 toolprefix = rebase_path("${nacl_toolchain_dir}/${toolchain_package}/bin/" + | 120 toolprefix = rebase_path("${nacl_toolchain_dir}/${toolchain_package}/bin/" + |
119 invoker.toolchain_tuple + "-", | 121 invoker.toolchain_tuple + "-", |
120 root_build_dir) | 122 root_build_dir) |
121 | 123 |
122 # TODO(mcgrathr): Hoist this to top level when | 124 # TODO(mcgrathr): Hoist this to top level when |
123 # https://code.google.com/p/chromium/issues/detail?id=395883 is fixed. | 125 # https://code.google.com/p/chromium/issues/detail?id=395883 is fixed. |
124 if (host_os == "win") { | 126 if (host_os == "win") { |
125 toolsuffix = ".exe" | 127 toolsuffix = ".exe" |
126 } else { | 128 } else { |
127 toolsuffix = "" | 129 toolsuffix = "" |
128 } | 130 } |
129 | 131 |
130 nacl_toolchain("glibc_" + toolchain_cpu) { | 132 nacl_toolchain("glibc_" + toolchain_cpu) { |
131 is_clang = false | 133 is_clang = false |
132 is_nacl_glibc = true | 134 is_nacl_glibc = true |
133 | 135 |
134 cc = toolprefix + "gcc" + toolsuffix | 136 cc = toolprefix + "gcc" + toolsuffix + toolchain_cc_args |
135 cxx = toolprefix + "g++" + toolsuffix | 137 cxx = toolprefix + "g++" + toolsuffix + toolchain_cc_args |
136 ar = toolprefix + "ar" + toolsuffix | 138 ar = toolprefix + "ar" + toolsuffix |
137 ld = cxx | 139 ld = cxx |
138 readelf = toolprefix + "readelf" + toolsuffix | 140 readelf = toolprefix + "readelf" + toolsuffix |
139 nm = toolprefix + "nm" + toolsuffix | 141 nm = toolprefix + "nm" + toolsuffix |
140 strip = toolprefix + "strip" + toolsuffix | 142 strip = toolprefix + "strip" + toolsuffix |
141 } | 143 } |
142 } | 144 } |
143 | 145 |
144 nacl_glibc_toolchain("x86") { | 146 nacl_glibc_toolchain("x86") { |
145 toolchain_package = "nacl_x86_glibc" | 147 toolchain_package = "nacl_x86_glibc" |
146 toolchain_revision = nacl_x86_glibc_rev | 148 toolchain_revision = nacl_x86_glibc_rev |
147 toolchain_tuple = "i686-nacl" | 149 |
| 150 # i686-nacl-gcc is not in goma (adding it would be tricky) so we use |
| 151 # x86_64-nacl compiler with the -m32 flags. |
| 152 toolchain_tuple = "x86_64-nacl" |
| 153 toolchain_cc_args = " -m32" |
148 } | 154 } |
149 | 155 |
150 nacl_glibc_toolchain("x64") { | 156 nacl_glibc_toolchain("x64") { |
151 toolchain_package = "nacl_x86_glibc" | 157 toolchain_package = "nacl_x86_glibc" |
152 toolchain_revision = nacl_x86_glibc_rev | 158 toolchain_revision = nacl_x86_glibc_rev |
153 toolchain_tuple = "x86_64-nacl" | 159 toolchain_tuple = "x86_64-nacl" |
154 } | 160 } |
155 | 161 |
156 nacl_glibc_toolchain("arm") { | 162 nacl_glibc_toolchain("arm") { |
157 toolchain_package = "nacl_arm_glibc" | 163 toolchain_package = "nacl_arm_glibc" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 toolchain_tuple = "i686-nacl" | 266 toolchain_tuple = "i686-nacl" |
261 } | 267 } |
262 | 268 |
263 nacl_clang_toolchains("x64") { | 269 nacl_clang_toolchains("x64") { |
264 toolchain_tuple = "x86_64-nacl" | 270 toolchain_tuple = "x86_64-nacl" |
265 } | 271 } |
266 | 272 |
267 nacl_clang_toolchains("arm") { | 273 nacl_clang_toolchains("arm") { |
268 toolchain_tuple = "arm-nacl" | 274 toolchain_tuple = "arm-nacl" |
269 } | 275 } |
OLD | NEW |