Chromium Code Reviews| Index: services/nacl/BUILD.gn |
| diff --git a/services/nacl/BUILD.gn b/services/nacl/BUILD.gn |
| index 37f2515b7321959933eff0fd298ece9796977d34..c8ed5192a3be9f914648ba3fc6b9b408dbcb4d7c 100644 |
| --- a/services/nacl/BUILD.gn |
| +++ b/services/nacl/BUILD.gn |
| @@ -26,20 +26,52 @@ if (!is_nacl) { |
| data_deps = [ "//nacl_bindings:irt_mojo(//native_client/build/toolchain/nacl:irt_${target_cpu})" ] |
| } |
| - mojo_native_application("nacl_content_handler_nonsfi") { |
| - sources = [ |
| - "content_handler_main_nonsfi.cc", |
| - ] |
| + if (current_cpu == "x86") { |
| + # Nonsfi nacl can only be executed by a 32-bit process, so our |
|
Petr Hosek
2015/09/14 19:13:51
Nit: "Non-SFI NaCl" instead of "Nonsfi nacl".
Sean Klein
2015/09/15 18:37:50
Done.
|
| + # content handler must be built and launched as a 32-bit process as well. |
| + mojo_native_application("nacl_content_handler_nonsfi") { |
| + sources = [ |
| + "content_handler_main_nonsfi.cc", |
| + ] |
| - deps = [ |
| - "//base", |
| - "//mojo/application:application", |
| - "//mojo/application:content_handler", |
| - "//mojo/data_pipe_utils", |
| - "//mojo/message_pump", |
| - "//mojo/nacl:irt_mojo_nonsfi", |
| - "//mojo/public/cpp/application:application", |
| - "//native_client/src/nonsfi/loader:elf_loader", |
| - ] |
| + deps = [ |
| + "//base", |
| + "//mojo/application:application", |
| + "//mojo/application:content_handler", |
| + "//mojo/data_pipe_utils", |
| + "//mojo/message_pump", |
| + "//mojo/nacl:irt_mojo_nonsfi", |
| + "//mojo/public/cpp/application:application", |
| + "//native_client/src/nonsfi/loader:elf_loader", |
| + ] |
| + } |
| + |
| + # Copy to the root build directory so our content handler prefixed line |
|
Mark Seaborn
2015/09/14 18:38:58
How about: "so that the '#!' prefix line for invok
Sean Klein
2015/09/15 18:37:50
Done.
|
| + # can simply be "mojo:nacl_content_handler_nonsfi". |
| + if ("${root_out_dir}" != "${root_build_dir}") { |
|
Petr Hosek
2015/09/14 19:13:51
Do you really need this? To check that you're not
Sean Klein
2015/09/15 18:37:50
I updated things to use a different naming convent
|
| + copy("nacl_content_handler_nonsfi_copy") { |
| + sources = [ |
| + "${root_out_dir}/nacl_content_handler_nonsfi.mojo", |
| + ] |
| + outputs = [ |
| + "${root_build_dir}/{{source_file_part}}", |
| + ] |
| + deps = [ |
| + ":nacl_content_handler_nonsfi", |
| + ] |
| + } |
| + } |
| + } |
| +} |
| + |
| +# This group serves as a 64 to 32 bit transformation for Linux. If we are |
| +# using a 64 bit toolchain, build the nonsfi nacl content handler as 32 bit. |
| +group("nacl_content_handler_nonsfi_x86") { |
|
Petr Hosek
2015/09/14 19:13:51
I'd suggest naming the group `nacl_content_handler
Sean Klein
2015/09/15 18:37:50
Done.
|
| + deps = [] |
| + if (target_cpu == "x64" && is_linux) { |
| + deps += [ ":nacl_content_handler_nonsfi_copy(//build/toolchain/linux:clang_x86)" ] |
|
Mark Seaborn
2015/09/14 18:38:58
See other comment -- comment to warn about assumin
Sean Klein
2015/09/15 18:37:50
Done.
|
| + } else if (target_cpu == "x86" && is_linux) { |
| + deps += |
| + [ ":nacl_content_handler_nonsfi(//build/toolchain/linux:clang_x86)" ] |
|
Petr Hosek
2015/09/14 19:13:51
What if the default toolchain is glibc_x86? Then t
Sean Klein
2015/09/15 18:37:50
Although this is untested, the new dependency on t
|
| } |
| } |