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 "//mojo/gles2:mgl", | 21 "//mojo/gles2:mgl", |
21 "//mojo/public/cpp/environment:standalone", | 22 "//mojo/public/cpp/environment:standalone", |
22 "//native_client/src/nonsfi/loader:elf_loader", | 23 "//native_client/src/nonsfi/loader:elf_loader", |
23 ] | 24 ] |
24 } | 25 } |
25 } | 26 } |
26 } | 27 } |
27 | 28 |
28 group("monacl_shell_nonsfi_x86") { | 29 group("monacl_shell_nonsfi_x86") { |
29 testonly = true | 30 testonly = true |
30 deps = [] | 31 deps = [] |
31 if ((target_cpu == "x64" || target_cpu == "x86") && is_linux) { | 32 if ((target_cpu == "x64" || target_cpu == "x86") && is_linux) { |
32 # Even when Mojo is built for x86-64 by default, we want to use x86-32 | 33 # Even when Mojo is built for x86-64 by default, we want to use x86-32 |
33 # for running programs under Non-SFI NaCl. | 34 # for running programs under Non-SFI NaCl. |
34 # The toolchain is hardcoded as 32-bit clang here -- although it must | 35 # The toolchain is hardcoded as 32-bit clang here -- although it must |
35 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would | 36 # be 32 bit (for nonsfi), it assumes clang. Ideally, the toolchain would |
36 # be defined as the 32 bit variant of whatever is being used (be it clang, | 37 # be defined as the 32 bit variant of whatever is being used (be it clang, |
37 # gcc, or something else). | 38 # gcc, or something else). |
38 deps += [ ":monacl_shell_nonsfi(//build/toolchain/linux:clang_x86)" ] | 39 deps += [ ":monacl_shell_nonsfi(//build/toolchain/linux:clang_x86)" ] |
39 } | 40 } |
40 } | 41 } |
41 | 42 |
42 static_library("irt_mojo_nonsfi") { | 43 static_library("irt_mojo_nonsfi") { |
43 sources = [ | 44 sources = [ |
44 "irt_mojo_nonsfi.cc", | 45 "irt_mojo_nonsfi.cc", |
45 "irt_mojo_nonsfi.h", | 46 "irt_mojo_nonsfi.h", |
| 47 "irt_pnacl_translator_compile.cc", |
| 48 "irt_pnacl_translator_link.cc", |
| 49 "irt_resource_open.cc", |
46 "nexe_launcher_nonsfi.cc", | 50 "nexe_launcher_nonsfi.cc", |
47 ] | 51 ] |
48 | 52 |
49 deps = [ | 53 deps = [ |
50 "//base", | 54 "//base", |
51 "//mojo/public/c/gpu:MGL", | 55 "//mojo/public/c/gpu:MGL", |
52 "//mojo/public/c/gpu:MGL_onscreen", | 56 "//mojo/public/c/gpu:MGL_onscreen", |
53 "//mojo/public/c/gpu:MGL_signal_sync_point", | 57 "//mojo/public/c/gpu:MGL_signal_sync_point", |
54 "//mojo/public/c/system", | 58 "//mojo/public/c/system", |
| 59 "//mojo/public/cpp/utility", |
55 "//mojo/public/platform/nacl:mojo_irt_header", | 60 "//mojo/public/platform/nacl:mojo_irt_header", |
56 "//native_client/src/nonsfi/irt:irt_interfaces", | 61 "//native_client/src/nonsfi/irt:irt_interfaces", |
| 62 "//services/nacl:pnacl_translator_bindings", |
57 ] | 63 ] |
58 } | 64 } |
59 | 65 |
60 group("mojo_nacl_nonsfi") { | 66 group("mojo_nacl_nonsfi") { |
61 deps = [ | 67 deps = [ |
62 "//services/nacl:nacl_content_handler_nonsfi", | 68 "//services/nacl:nacl_content_handler_nonsfi", |
63 ] | 69 ] |
64 } | 70 } |
65 | 71 |
66 group("mojo_pnacl_tests") { | 72 group("mojo_pnacl_tests") { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 nexe_path = "$root_out_dir/monacl_test_nonsfi" | 120 nexe_path = "$root_out_dir/monacl_test_nonsfi" |
115 input = "${nexe_path}.nexe" | 121 input = "${nexe_path}.nexe" |
116 inputs = [ | 122 inputs = [ |
117 input, | 123 input, |
118 ] | 124 ] |
119 output = "${nexe_path}.mojo" | 125 output = "${nexe_path}.mojo" |
120 outputs = [ | 126 outputs = [ |
121 output, | 127 output, |
122 ] | 128 ] |
123 | 129 |
124 line = "#!mojo mojo:nacl_content_handler_nonsfi" | 130 line = "#!mojo mojo:nacl_content_handler_nonsfi_nexe" |
125 args = [ | 131 args = [ |
126 "--input=" + rebase_path(input, root_build_dir), | 132 "--input=" + rebase_path(input, root_build_dir), |
127 "--output=" + rebase_path(output, root_build_dir), | 133 "--output=" + rebase_path(output, root_build_dir), |
128 "--line=$line", | 134 "--line=$line", |
129 ] | 135 ] |
130 deps = [ | 136 deps = [ |
131 ":translate_mojo_pnacl_tests_to_native", | 137 ":translate_mojo_pnacl_tests_to_native", |
132 ] | 138 ] |
133 } | 139 } |
134 | 140 |
135 group("monacl_test_nonsfi_nexes") { | 141 group("monacl_test_nonsfi_nexes") { |
136 testonly = true | 142 testonly = true |
137 deps = [ | 143 deps = [ |
138 ":translate_mojo_pnacl_tests_to_native", | 144 ":translate_mojo_pnacl_tests_to_native", |
139 ":prepend_shebang_to_nexe", | 145 ":prepend_shebang_to_nexe", |
140 ] | 146 ] |
141 } | 147 } |
142 | 148 |
143 group("mojo_nacl_tests_nonsfi") { | 149 group("mojo_nacl_tests_nonsfi") { |
144 testonly = true | 150 testonly = true |
145 deps = [ | 151 deps = [ |
146 ":monacl_shell_nonsfi_x86", | 152 ":monacl_shell_nonsfi_x86", |
147 ":monacl_test_nonsfi_nexes", | 153 ":monacl_test_nonsfi_nexes", |
148 ] | 154 ] |
149 } | 155 } |
OLD | NEW |