| OLD | NEW |
| 1 # Copyright 2015 The Chromium Authors. All rights reserved. | 1 # Copyright 2015 The Chromium 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 # Trusted code | 5 # Trusted code |
| 6 if (!is_nacl) { | 6 if (!is_nacl) { |
| 7 # A simple shell for running untrusted binaries that talk to the Mojo | 7 # A simple shell for running untrusted binaries that talk to the Mojo |
| 8 # embedder. (No services.) | 8 # embedder. (No services.) |
| 9 if (current_cpu == "x86" || current_cpu == "arm") { | 9 if (current_cpu == "x86" || current_cpu == "arm") { |
| 10 # Non-SFI NaCl currently supports x86-32 and ARMv7, but not anything 64-bit. | 10 # Non-SFI NaCl currently supports x86-32 and ARMv7, but not anything 64-bit. |
| 11 # Additionally, PNaCl pexes assume 32-bit pointers. | 11 # Additionally, PNaCl pexes assume 32-bit pointers. |
| 12 executable("monacl_shell_nonsfi") { | 12 executable("monacl_shell_nonsfi") { |
| 13 testonly = true | 13 testonly = true |
| 14 sources = [ | 14 sources = [ |
| 15 "monacl_shell_nonsfi.cc", | 15 "monacl_shell_nonsfi.cc", |
| 16 ] | 16 ] |
| 17 deps = [ | 17 deps = [ |
| 18 ":irt_mojo_nonsfi", | 18 ":irt_mojo_nonsfi", |
| 19 "//mojo/public/cpp/environment:standalone", |
| 19 "//mojo/edk/system", | 20 "//mojo/edk/system", |
| 20 "//native_client/src/nonsfi/loader:elf_loader", | 21 "//native_client/src/nonsfi/loader:elf_loader", |
| 21 ] | 22 ] |
| 22 } | 23 } |
| 23 } | 24 } |
| 24 } | 25 } |
| 25 | 26 |
| 26 group("monacl_shell_nonsfi_x86") { | 27 group("monacl_shell_nonsfi_x86") { |
| 27 testonly = true | 28 testonly = true |
| 28 deps = [] | 29 deps = [] |
| 29 if ((target_cpu == "x64" || target_cpu == "x86") && is_linux) { | 30 if ((target_cpu == "x64" || target_cpu == "x86") && is_linux) { |
| 30 # Even when Mojo is built for x86-64 by default, we want to use x86-32 | 31 # Even when Mojo is built for x86-64 by default, we want to use x86-32 |
| 31 # for running programs under Non-SFI NaCl. | 32 # for running programs under Non-SFI NaCl. |
| 32 # The toolchain is hardcoded as 32-bit clang here -- although it must | 33 # The toolchain is hardcoded as 32-bit clang here -- although it must |
| 33 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would | 34 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would |
| 34 # be defined as the 32 bit variant of whatever is being used (be it clang, | 35 # be defined as the 32 bit variant of whatever is being used (be it clang, |
| 35 # gcc, or something else). | 36 # gcc, or something else). |
| 36 deps += [ ":monacl_shell_nonsfi(//build/toolchain/linux:clang_x86)" ] | 37 deps += [ ":monacl_shell_nonsfi(//build/toolchain/linux:clang_x86)" ] |
| 37 } | 38 } |
| 38 } | 39 } |
| 39 | 40 |
| 40 static_library("irt_mojo_nonsfi") { | 41 static_library("irt_mojo_nonsfi") { |
| 41 sources = [ | 42 sources = [ |
| 42 "irt_mojo_nonsfi.cc", | 43 "irt_mojo_nonsfi.cc", |
| 43 "irt_mojo_nonsfi.h", | 44 "irt_mojo_nonsfi.h", |
| 45 "irt_pnacl_translator_compile.cc", |
| 46 "irt_pnacl_translator_link.cc", |
| 47 "irt_resource_open.cc", |
| 44 "nexe_launcher_nonsfi.cc", | 48 "nexe_launcher_nonsfi.cc", |
| 45 ] | 49 ] |
| 46 | 50 |
| 47 deps = [ | 51 deps = [ |
| 48 "//base", | 52 "//base", |
| 49 "//mojo/public/c/system", | 53 "//mojo/public/c/system", |
| 54 "//mojo/public/cpp/bindings", |
| 50 "//mojo/public/platform/nacl:mojo_irt_header", | 55 "//mojo/public/platform/nacl:mojo_irt_header", |
| 51 "//native_client/src/nonsfi/irt:irt_interfaces", | 56 "//native_client/src/nonsfi/irt:irt_interfaces", |
| 52 ] | 57 ] |
| 53 } | 58 } |
| 54 | 59 |
| 55 group("mojo_nacl_nonsfi") { | 60 group("mojo_nacl_nonsfi") { |
| 56 deps = [ | 61 deps = [ |
| 57 "//services/nacl:nacl_content_handler_nonsfi", | 62 "//services/nacl:nacl_content_handler_nonsfi", |
| 58 ] | 63 ] |
| 59 } | 64 } |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 nexe_path = "$root_out_dir/monacl_test_nonsfi" | 114 nexe_path = "$root_out_dir/monacl_test_nonsfi" |
| 110 input = "${nexe_path}.nexe" | 115 input = "${nexe_path}.nexe" |
| 111 inputs = [ | 116 inputs = [ |
| 112 input, | 117 input, |
| 113 ] | 118 ] |
| 114 output = "${nexe_path}.mojo" | 119 output = "${nexe_path}.mojo" |
| 115 outputs = [ | 120 outputs = [ |
| 116 output, | 121 output, |
| 117 ] | 122 ] |
| 118 | 123 |
| 119 line = "#!mojo mojo:nacl_content_handler_nonsfi" | 124 line = "#!mojo mojo:nacl_content_handler_nonsfi_nexe" |
| 120 args = [ | 125 args = [ |
| 121 "--input=" + rebase_path(input, root_build_dir), | 126 "--input=" + rebase_path(input, root_build_dir), |
| 122 "--output=" + rebase_path(output, root_build_dir), | 127 "--output=" + rebase_path(output, root_build_dir), |
| 123 "--line=$line", | 128 "--line=$line", |
| 124 ] | 129 ] |
| 125 deps = [ | 130 deps = [ |
| 126 ":translate_mojo_pnacl_tests_to_native", | 131 ":translate_mojo_pnacl_tests_to_native", |
| 127 ] | 132 ] |
| 128 } | 133 } |
| 129 | 134 |
| 130 group("monacl_test_nonsfi_nexes") { | 135 group("monacl_test_nonsfi_nexes") { |
| 131 testonly = true | 136 testonly = true |
| 132 deps = [ | 137 deps = [ |
| 133 ":translate_mojo_pnacl_tests_to_native", | 138 ":translate_mojo_pnacl_tests_to_native", |
| 134 ":prepend_shebang_to_nexe", | 139 ":prepend_shebang_to_nexe", |
| 135 ] | 140 ] |
| 136 } | 141 } |
| 137 | 142 |
| 138 group("mojo_nacl_tests_nonsfi") { | 143 group("mojo_nacl_tests_nonsfi") { |
| 139 testonly = true | 144 testonly = true |
| 140 deps = [ | 145 deps = [ |
| 141 ":monacl_shell_nonsfi_x86", | 146 ":monacl_shell_nonsfi_x86", |
| 142 ":monacl_test_nonsfi_nexes", | 147 ":monacl_test_nonsfi_nexes", |
| 143 ] | 148 ] |
| 144 } | 149 } |
| OLD | NEW |