| 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 executable("monacl_shell") { | |
| 10 testonly = true | |
| 11 sources = [ | |
| 12 "monacl_shell.cc", | |
| 13 ] | |
| 14 deps = [ | |
| 15 "//base:base", | |
| 16 "//mojo/edk/system:system", | |
| 17 "//nacl_bindings:monacl_sel", | |
| 18 ] | |
| 19 | |
| 20 data_deps = | |
| 21 [ "//nacl_bindings:irt_mojo(//build/toolchain/nacl:irt_${target_cpu})" ] | |
| 22 } | |
| 23 | |
| 24 if (current_cpu == "x86" || current_cpu == "arm") { | 9 if (current_cpu == "x86" || current_cpu == "arm") { |
| 25 # 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. |
| 26 # Additionally, PNaCl pexes assume 32-bit pointers. | 11 # Additionally, PNaCl pexes assume 32-bit pointers. |
| 27 executable("monacl_shell_nonsfi") { | 12 executable("monacl_shell_nonsfi") { |
| 28 testonly = true | 13 testonly = true |
| 29 sources = [ | 14 sources = [ |
| 30 "monacl_shell_nonsfi.cc", | 15 "monacl_shell_nonsfi.cc", |
| 31 ] | 16 ] |
| 32 deps = [ | 17 deps = [ |
| 33 ":irt_mojo_nonsfi", | 18 ":irt_mojo_nonsfi", |
| (...skipping 11 matching lines...) Expand all Loading... |
| 45 # Even when Mojo is built for x86-64 by default, we want to use x86-32 | 30 # Even when Mojo is built for x86-64 by default, we want to use x86-32 |
| 46 # for running programs under Non-SFI NaCl. | 31 # for running programs under Non-SFI NaCl. |
| 47 # The toolchain is hardcoded as 32-bit clang here -- although it must | 32 # The toolchain is hardcoded as 32-bit clang here -- although it must |
| 48 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would | 33 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would |
| 49 # be defined as the 32 bit variant of whatever is being used (be it clang, | 34 # be defined as the 32 bit variant of whatever is being used (be it clang, |
| 50 # gcc, or something else). | 35 # gcc, or something else). |
| 51 deps += [ ":monacl_shell_nonsfi(//build/toolchain/linux:clang_x86)" ] | 36 deps += [ ":monacl_shell_nonsfi(//build/toolchain/linux:clang_x86)" ] |
| 52 } | 37 } |
| 53 } | 38 } |
| 54 | 39 |
| 55 # Untrusted code | |
| 56 if (is_nacl) { | |
| 57 # Unit test for the Mojo public API. | |
| 58 executable("monacl_test") { | |
| 59 testonly = true | |
| 60 sources = [ | |
| 61 "//mojo/public/cpp/system/tests/core_unittest.cc", | |
| 62 "//mojo/public/cpp/system/tests/macros_unittest.cc", | |
| 63 ] | |
| 64 deps = [ | |
| 65 "//mojo/public/c/system/tests:tests", | |
| 66 "//mojo/public/cpp/system:system", | |
| 67 "//mojo/public/platform/nacl:mojo", | |
| 68 "//testing/gtest:gtest", | |
| 69 "//testing/gtest:gtest_main", | |
| 70 ] | |
| 71 } | |
| 72 | |
| 73 group("mojo_nacl_tests_untrusted") { | |
| 74 testonly = true | |
| 75 deps = [ | |
| 76 ":monacl_test", | |
| 77 "//examples/apptest", | |
| 78 "//examples/wget", | |
| 79 "//services/clipboard", | |
| 80 "//services/clipboard:apptests", | |
| 81 "//services/files:apptests", | |
| 82 "//services/http_server", | |
| 83 "//services/http_server:apptests", | |
| 84 "//services/view_manager:mojo_view_manager_client_apptests", | |
| 85 "//services/view_manager:view_manager_service_apptests", | |
| 86 "//services/window_manager:window_manager_apptests", | |
| 87 "//shell:apptests", | |
| 88 ] | |
| 89 } | |
| 90 } | |
| 91 | |
| 92 static_library("irt_mojo_nonsfi") { | 40 static_library("irt_mojo_nonsfi") { |
| 93 sources = [ | 41 sources = [ |
| 94 "irt_mojo_nonsfi.cc", | 42 "irt_mojo_nonsfi.cc", |
| 95 "irt_mojo_nonsfi.h", | 43 "irt_mojo_nonsfi.h", |
| 96 "nexe_launcher_nonsfi.cc", | 44 "nexe_launcher_nonsfi.cc", |
| 97 ] | 45 ] |
| 98 | 46 |
| 99 deps = [ | 47 deps = [ |
| 100 "//base", | 48 "//base", |
| 101 "//mojo/public/c/system", | 49 "//mojo/public/c/system", |
| 102 "//mojo/public/platform/nacl:mojo_irt_header", | 50 "//mojo/public/platform/nacl:mojo_irt_header", |
| 103 "//native_client/src/nonsfi/irt:irt_interfaces", | 51 "//native_client/src/nonsfi/irt:irt_interfaces", |
| 104 ] | 52 ] |
| 105 } | 53 } |
| 106 | 54 |
| 107 group("mojo_nacl") { | |
| 108 deps = [ | |
| 109 "//services/nacl:nacl_content_handler", | |
| 110 ] | |
| 111 } | |
| 112 | |
| 113 group("mojo_nacl_nonsfi") { | 55 group("mojo_nacl_nonsfi") { |
| 114 deps = [ | 56 deps = [ |
| 115 "//services/nacl:nacl_content_handler_nonsfi", | 57 "//services/nacl:nacl_content_handler_nonsfi", |
| 116 ] | 58 ] |
| 117 } | 59 } |
| 118 | 60 |
| 119 group("mojo_pnacl_tests") { | 61 group("mojo_pnacl_tests") { |
| 120 testonly = true | 62 testonly = true |
| 121 deps = [ | 63 deps = [ |
| 122 ":monacl_test(//build/toolchain/nacl:newlib_pnacl)", | 64 "//mojo/nacl:monacl_test(//build/toolchain/nacl:newlib_pnacl)", |
| 123 ] | 65 ] |
| 124 } | 66 } |
| 125 | 67 |
| 126 action("translate_mojo_pnacl_tests_to_native") { | 68 action("translate_mojo_pnacl_tests_to_native") { |
| 127 testonly = true | 69 testonly = true |
| 128 | 70 |
| 129 # Leaving default as linux for OSes which are similar to linux, but do | 71 # Leaving default as linux for OSes which are similar to linux, but do |
| 130 # not self-identify as linux through host_os. | 72 # not self-identify as linux through host_os. |
| 131 nacl_toolchain_host_os = "linux" | 73 nacl_toolchain_host_os = "linux" |
| 132 if (host_os == "mac") { | 74 if (host_os == "mac") { |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } | 128 } |
| 187 | 129 |
| 188 group("monacl_test_nonsfi_nexes") { | 130 group("monacl_test_nonsfi_nexes") { |
| 189 testonly = true | 131 testonly = true |
| 190 deps = [ | 132 deps = [ |
| 191 ":translate_mojo_pnacl_tests_to_native", | 133 ":translate_mojo_pnacl_tests_to_native", |
| 192 ":prepend_shebang_to_nexe", | 134 ":prepend_shebang_to_nexe", |
| 193 ] | 135 ] |
| 194 } | 136 } |
| 195 | 137 |
| 196 group("mojo_nacl_tests") { | |
| 197 testonly = true | |
| 198 deps = [ | |
| 199 ":mojo_nacl_tests_untrusted(//build/toolchain/nacl:clang_newlib_${current_cp
u})", | |
| 200 ":monacl_shell", | |
| 201 ] | |
| 202 } | |
| 203 | |
| 204 group("mojo_nacl_tests_nonsfi") { | 138 group("mojo_nacl_tests_nonsfi") { |
| 205 testonly = true | 139 testonly = true |
| 206 deps = [ | 140 deps = [ |
| 207 ":monacl_shell_nonsfi_x86", | 141 ":monacl_shell_nonsfi_x86", |
| 208 ":monacl_test_nonsfi_nexes", | 142 ":monacl_test_nonsfi_nexes", |
| 209 ] | 143 ] |
| 210 } | 144 } |
| OLD | NEW |