cc: Rework how signals are issued from tile manager.
[chromium-blink-merge.git] / components / nacl_nonsfi.gyp
blob8ae540fde93d0c9a672532e873a9c138e9a29038
1 # Copyright 2014 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
6   'variables': {
7     'chromium_code': 1,
8   },
9   'includes': [
10     '../build/common_untrusted.gypi',
11   ],
12   'conditions': [
13     ['disable_nacl==0 and disable_nacl_untrusted==0', {
14       'targets': [
15         {
16           # nacl_helper_nonsfi is similar to nacl_helper (built in nacl.gyp)
17           # but for the NaCl plugin in Non-SFI mode.
18           # This binary is built using the PNaCl toolchain, but it is native
19           # linux binary and will run on Linux directly.
20           # Most library code can be shared with the one for untrusted build
21           # (i.e. the one for irt.nexe built by the NaCl/PNaCl toolchain), but
22           # as nacl_helper_nonsfi runs on Linux, there are some differences,
23           # such as MessageLoopForIO (which is based on libevent in Non-SFI
24           # mode) or ipc_channel implementation.
25           # Because of the toolchain, in both builds, OS_NACL macro (derived
26           # from __native_client__ macro) is defined. Code can test whether
27           # __native_client_nonsfi__ is #defined in order to determine
28           # whether it is being compiled for SFI mode or Non-SFI mode.
29           #
30           # Currently, nacl_helper_nonsfi is under development and the binary
31           # does nothing (i.e. it has only empty main(), now).
32           # TODO(crbug.com/358465): Implement it then switch nacl_helper in
33           # Non-SFI mode to nacl_helper_nonsfi.
34           'target_name': 'nacl_helper_nonsfi',
35           'type': 'none',
36           'variables': {
37             'nacl_untrusted_build': 1,
38             'nexe_target': 'nacl_helper_nonsfi',
39             # Rename the output binary file to nacl_helper_nonsfi and put it
40             # directly under out/{Debug,Release}/.
41             'out_newlib32_nonsfi': '<(PRODUCT_DIR)/nacl_helper_nonsfi',
42             'out_newlib_arm_nonsfi': '<(PRODUCT_DIR)/nacl_helper_nonsfi',
44             'build_glibc': 0,
45             'build_newlib': 0,
46             'build_irt': 0,
47             'build_pnacl_newlib': 0,
48             'build_nonsfi_helper': 1,
50             'sources': [
51               'nacl/common/nacl_messages.cc',
52               'nacl/common/nacl_switches.cc',
53               'nacl/common/nacl_types.cc',
54               'nacl/common/nacl_types_param_traits.cc',
55               'nacl/loader/nacl_helper_linux.cc',
56               'nacl/loader/nacl_trusted_listener.cc',
57               'nacl/loader/nonsfi/nonsfi_listener.cc',
58               'nacl/loader/nonsfi/nonsfi_main.cc',
59             ],
61             'link_flags': [
62               '-lbase_nacl_nonsfi',
63               '-lcommand_buffer_client_nacl',
64               '-lcommand_buffer_common_nacl',
65               '-lcontent_common_nacl_nonsfi',
66               '-lelf_loader',
67               '-levent_nacl_nonsfi',
68               '-lgio',
69               '-lgles2_cmd_helper_nacl',
70               '-lgles2_implementation_nacl',
71               '-lgles2_utils_nacl',
72               '-lgpu_ipc_nacl',
73               '-lipc_nacl_nonsfi',
74               '-llatency_info_nacl',
75               '-lnacl_helper_nonsfi_sandbox',
76               '-lplatform',
77               '-lppapi_ipc_nacl',
78               '-lppapi_proxy_nacl',
79               '-lppapi_shared_nacl',
80               '-lsandbox_linux_nacl_nonsfi',
81               '-lshared_memory_support_nacl',
82               '-ltracing_nacl',
83             ],
85             'conditions': [
86               ['target_arch=="ia32" or target_arch=="x64"', {
87                 'extra_deps_newlib32_nonsfi': [
88                   '>(tc_lib_dir_nonsfi_helper32)/libbase_nacl_nonsfi.a',
89                   '>(tc_lib_dir_nonsfi_helper32)/libcommand_buffer_client_nacl.a',
90                   '>(tc_lib_dir_nonsfi_helper32)/libcommand_buffer_common_nacl.a',
91                   '>(tc_lib_dir_nonsfi_helper32)/libcontent_common_nacl_nonsfi.a',
92                   '>(tc_lib_dir_nonsfi_helper32)/libelf_loader.a',
93                   '>(tc_lib_dir_nonsfi_helper32)/libevent_nacl_nonsfi.a',
94                   '>(tc_lib_dir_nonsfi_helper32)/libgio.a',
95                   '>(tc_lib_dir_nonsfi_helper32)/libgles2_cmd_helper_nacl.a',
96                   '>(tc_lib_dir_nonsfi_helper32)/libgles2_implementation_nacl.a',
97                   '>(tc_lib_dir_nonsfi_helper32)/libgles2_utils_nacl.a',
98                   '>(tc_lib_dir_nonsfi_helper32)/libgpu_ipc_nacl.a',
99                   '>(tc_lib_dir_nonsfi_helper32)/libipc_nacl_nonsfi.a',
100                   '>(tc_lib_dir_nonsfi_helper32)/liblatency_info_nacl.a',
101                   '>(tc_lib_dir_nonsfi_helper32)/libnacl_helper_nonsfi_sandbox.a',
102                   '>(tc_lib_dir_nonsfi_helper32)/libplatform.a',
103                   '>(tc_lib_dir_nonsfi_helper32)/libppapi_ipc_nacl.a',
104                   '>(tc_lib_dir_nonsfi_helper32)/libppapi_proxy_nacl.a',
105                   '>(tc_lib_dir_nonsfi_helper32)/libppapi_shared_nacl.a',
106                   '>(tc_lib_dir_nonsfi_helper32)/libsandbox_linux_nacl_nonsfi.a',
107                   '>(tc_lib_dir_nonsfi_helper32)/libshared_memory_support_nacl.a',
108                   '>(tc_lib_dir_nonsfi_helper32)/libtracing_nacl.a',
109                 ],
110               }],
111               ['target_arch=="arm"', {
112                 'extra_deps_newlib_arm_nonsfi': [
113                   '>(tc_lib_dir_nonsfi_helper_arm)/libbase_nacl_nonsfi.a',
114                   '>(tc_lib_dir_nonsfi_helper_arm)/libcommand_buffer_client_nacl.a',
115                   '>(tc_lib_dir_nonsfi_helper_arm)/libcommand_buffer_common_nacl.a',
116                   '>(tc_lib_dir_nonsfi_helper_arm)/libcontent_common_nacl_nonsfi.a',
117                   '>(tc_lib_dir_nonsfi_helper_arm)/libelf_loader.a',
118                   '>(tc_lib_dir_nonsfi_helper_arm)/libevent_nacl_nonsfi.a',
119                   '>(tc_lib_dir_nonsfi_helper_arm)/libgio.a',
120                   '>(tc_lib_dir_nonsfi_helper_arm)/libgles2_cmd_helper_nacl.a',
121                   '>(tc_lib_dir_nonsfi_helper_arm)/libgles2_implementation_nacl.a',
122                   '>(tc_lib_dir_nonsfi_helper_arm)/libgles2_utils_nacl.a',
123                   '>(tc_lib_dir_nonsfi_helper_arm)/libgpu_ipc_nacl.a',
124                   '>(tc_lib_dir_nonsfi_helper_arm)/libipc_nacl_nonsfi.a',
125                   '>(tc_lib_dir_nonsfi_helper_arm)/liblatency_info_nacl.a',
126                   '>(tc_lib_dir_nonsfi_helper_arm)/libnacl_helper_nonsfi_sandbox.a',
127                   '>(tc_lib_dir_nonsfi_helper_arm)/libplatform.a',
128                   '>(tc_lib_dir_nonsfi_helper_arm)/libppapi_ipc_nacl.a',
129                   '>(tc_lib_dir_nonsfi_helper_arm)/libppapi_proxy_nacl.a',
130                   '>(tc_lib_dir_nonsfi_helper_arm)/libppapi_shared_nacl.a',
131                   '>(tc_lib_dir_nonsfi_helper_arm)/libsandbox_linux_nacl_nonsfi.a',
132                   '>(tc_lib_dir_nonsfi_helper_arm)/libshared_memory_support_nacl.a',
133                   '>(tc_lib_dir_nonsfi_helper_arm)/libtracing_nacl.a',
134                 ],
135               }],
136             ],
137           },
138           'dependencies': [
139             '../base/base_nacl.gyp:base_nacl_nonsfi',
140             '../content/content_nacl_nonsfi.gyp:content_common_nacl_nonsfi',
141             '../ipc/ipc_nacl.gyp:ipc_nacl_nonsfi',
142             '../native_client/src/nonsfi/irt/irt.gyp:nacl_sys_private',
143             '../native_client/src/nonsfi/loader/loader.gyp:elf_loader',
144             '../native_client/src/untrusted/nacl/nacl.gyp:nacl_lib_newlib',
145             '../ppapi/ppapi_proxy_nacl.gyp:ppapi_proxy_nacl',
146             '../sandbox/linux/sandbox_linux_nacl_nonsfi.gyp:sandbox_linux_nacl_nonsfi',
147             'nacl_helper_nonsfi_sandbox',
148           ],
149         },
151         {
152           'target_name': 'nacl_helper_nonsfi_sandbox',
153           'type': 'none',
154           'variables': {
155             'nacl_untrusted_build': 1,
156             'nlib_target': 'libnacl_helper_nonsfi_sandbox.a',
158             'build_glibc': 0,
159             'build_newlib': 0,
160             'build_irt': 0,
161             'build_pnacl_newlib': 0,
162             'build_nonsfi_helper': 1,
164             'sources': [
165               'nacl/loader/nonsfi/nonsfi_sandbox.cc',
166               'nacl/loader/sandbox_linux/nacl_sandbox_linux.cc',
167             ],
168           },
169           'dependencies': [
170             '../base/base_nacl.gyp:base_nacl_nonsfi',
171             '../content/content_nacl_nonsfi.gyp:content_common_nacl_nonsfi',
172             '../sandbox/linux/sandbox_linux_nacl_nonsfi.gyp:sandbox_linux_nacl_nonsfi',
173           ],
174         },
175       ],
176     }],
178     ['disable_nacl==0 and disable_nacl_untrusted==0 and enable_nacl_nonsfi_test==1', {
179       'targets': [
180         {
181           'target_name': 'nacl_helper_nonsfi_unittests_main',
182           'type': 'none',
183           'variables': {
184             'nacl_untrusted_build': 1,
185             'nexe_target': 'nacl_helper_nonsfi_unittests_main',
186             # Rename the output binary file to
187             # nacl_helper_nonsfi_unittests_main and put it directly under
188             # out/{Debug,Release}/, so that this is in the standard location,
189             # for running on the buildbots.
190             'out_newlib32_nonsfi': '<(PRODUCT_DIR)/nacl_helper_nonsfi_unittests_main',
191             'out_newlib_arm_nonsfi': '<(PRODUCT_DIR)/nacl_helper_nonsfi_unittests_main',
193             'build_glibc': 0,
194             'build_newlib': 0,
195             'build_irt': 0,
196             'build_pnacl_newlib': 0,
197             'build_nonsfi_helper': 1,
199             'sources': [
200               'nacl/loader/nonsfi/nonsfi_sandbox_sigsys_unittest.cc',
201               'nacl/loader/nonsfi/nonsfi_sandbox_unittest.cc',
202               'nacl/loader/nonsfi/run_all_unittests.cc',
203             ],
205             'link_flags': [
206               '-lbase_nacl_nonsfi',
207               '-lcontent_common_nacl_nonsfi',
208               '-levent_nacl_nonsfi',
209               '-lgio',
210               '-lgtest_nacl',
211               '-lnacl_helper_nonsfi_sandbox',
212               '-lplatform',
213               '-lsandbox_linux_nacl_nonsfi',
214               '-lsandbox_linux_test_utils_nacl_nonsfi',
215               '-ltest_support_base_nacl_nonsfi',
216             ],
218             'conditions': [
219               ['target_arch=="ia32" or target_arch=="x64"', {
220                 'extra_deps_newlib32_nonsfi': [
221                   '>(tc_lib_dir_nonsfi_helper32)/libbase_nacl_nonsfi.a',
222                   '>(tc_lib_dir_nonsfi_helper32)/libcontent_common_nacl_nonsfi.a',
223                   '>(tc_lib_dir_nonsfi_helper32)/libevent_nacl_nonsfi.a',
224                   '>(tc_lib_dir_nonsfi_helper32)/libgio.a',
225                   '>(tc_lib_dir_nonsfi_helper32)/libgtest_nacl.a',
226                   '>(tc_lib_dir_nonsfi_helper32)/libnacl_helper_nonsfi_sandbox.a',
227                   '>(tc_lib_dir_nonsfi_helper32)/libplatform.a',
228                   '>(tc_lib_dir_nonsfi_helper32)/libsandbox_linux_nacl_nonsfi.a',
229                   '>(tc_lib_dir_nonsfi_helper32)/libsandbox_linux_test_utils_nacl_nonsfi.a',
230                   '>(tc_lib_dir_nonsfi_helper32)/libtest_support_base_nacl_nonsfi.a',
231                 ],
232               }],
233               ['target_arch=="arm"', {
234                 'extra_deps_newlib_arm_nonsfi': [
235                   '>(tc_lib_dir_nonsfi_helper_arm)/libbase_nacl_nonsfi.a',
236                   '>(tc_lib_dir_nonsfi_helper_arm)/libcontent_common_nacl_nonsfi.a',
237                   '>(tc_lib_dir_nonsfi_helper_arm)/libevent_nacl_nonsfi.a',
238                   '>(tc_lib_dir_nonsfi_helper_arm)/libgio.a',
239                   '>(tc_lib_dir_nonsfi_helper_arm)/libgtest_nacl.a',
240                   '>(tc_lib_dir_nonsfi_helper_arm)/libnacl_helper_nonsfi_sandbox.a',
241                   '>(tc_lib_dir_nonsfi_helper_arm)/libplatform.a',
242                   '>(tc_lib_dir_nonsfi_helper_arm)/libsandbox_linux_nacl_nonsfi.a',
243                   '>(tc_lib_dir_nonsfi_helper_arm)/libsandbox_linux_test_utils_nacl_nonsfi.a',
244                   '>(tc_lib_dir_nonsfi_helper_arm)/libtest_support_base_nacl_nonsfi.a',
245                 ],
246               }],
247             ],
248           },
250           'dependencies': [
251             '../base/base_nacl.gyp:base_nacl_nonsfi',
252             '../base/base_nacl.gyp:test_support_base_nacl_nonsfi',
253             '../content/content_nacl_nonsfi.gyp:content_common_nacl_nonsfi',
254             '../native_client/src/nonsfi/irt/irt.gyp:nacl_sys_private',
255             '../native_client/src/untrusted/nacl/nacl.gyp:nacl_lib_newlib',
256             '../sandbox/linux/sandbox_linux_nacl_nonsfi.gyp:sandbox_linux_nacl_nonsfi',
257             '../sandbox/linux/sandbox_linux_nacl_nonsfi.gyp:sandbox_linux_test_utils_nacl_nonsfi',
258             '../testing/gtest_nacl.gyp:gtest_nacl',
259             'nacl_helper_nonsfi_sandbox',
260           ],
261         },
262       ],
263     }],
265     ['disable_nacl==0 and disable_nacl_untrusted==0 and enable_nacl_nonsfi_test==1 and test_isolation_mode!="noop"', {
266       'targets': [
267         {
268           'target_name': 'nacl_helper_nonsfi_unittests_run',
269           'type': 'none',
270           'dependencies': [
271             'nacl.gyp:nacl_helper_nonsfi_unittests',
272             'nacl_helper_nonsfi_unittests_main',
273           ],
274           'includes': [
275             '../build/isolate.gypi',
276           ],
277           'sources': [
278             'nacl_helper_nonsfi_unittests.isolate',
279           ],
280         },
281       ],
282     }],
283   ],