Index: build/toolchain/nacl/BUILD.gn |
diff --git a/build/toolchain/nacl/BUILD.gn b/build/toolchain/nacl/BUILD.gn |
index 3896e1964d4a55492ca41791acc66887282048f0..5cbfc008fe55562a82e5c74f1d69e230f84ac1ef 100644 |
--- a/build/toolchain/nacl/BUILD.gn |
+++ b/build/toolchain/nacl/BUILD.gn |
@@ -106,6 +106,7 @@ pnacl_toolchain("newlib_pnacl_nonsfi") { |
template("nacl_glibc_toolchain") { |
toolchain_cpu = target_name |
+ toolchain_cc_args = "" |
assert(defined(invoker.toolchain_tuple), "Must define toolchain_tuple") |
assert(defined(invoker.toolchain_package), "Must define toolchain_package") |
assert(defined(invoker.toolchain_revision), "Must define toolchain_revision") |
@@ -113,6 +114,7 @@ template("nacl_glibc_toolchain") { |
[ |
"toolchain_package", |
"toolchain_revision", |
+ "toolchain_cc_args", |
]) |
toolprefix = rebase_path("${nacl_toolchain_dir}/${toolchain_package}/bin/" + |
@@ -131,8 +133,8 @@ template("nacl_glibc_toolchain") { |
is_clang = false |
is_nacl_glibc = true |
- cc = toolprefix + "gcc" + toolsuffix |
- cxx = toolprefix + "g++" + toolsuffix |
+ cc = toolprefix + "gcc" + toolsuffix + toolchain_cc_args |
+ cxx = toolprefix + "g++" + toolsuffix + toolchain_cc_args |
ar = toolprefix + "ar" + toolsuffix |
ld = cxx |
readelf = toolprefix + "readelf" + toolsuffix |
@@ -144,7 +146,11 @@ template("nacl_glibc_toolchain") { |
nacl_glibc_toolchain("x86") { |
toolchain_package = "nacl_x86_glibc" |
toolchain_revision = nacl_x86_glibc_rev |
- toolchain_tuple = "i686-nacl" |
+ |
+ # i686-nacl-gcc is not in goma (adding it would be tricky) so we use |
+ # x86_64-nacl compiler with the -m32 flags. |
+ toolchain_tuple = "x86_64-nacl" |
+ toolchain_cc_args = " -m32" |
} |
nacl_glibc_toolchain("x64") { |