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