[Beta Blocker] Fix heap use-after-free in Native Process Host
[chromium-blink-merge.git] / ppapi / native_client / native_client.gyp
blob91f081be6393959fb5881b9009311b6b9ceefe70
1 # Copyright (c) 2012 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   'includes': [
7     '../../build/common_untrusted.gypi',
8   ],
9   'conditions': [
10     ['disable_nacl==0 and disable_nacl_untrusted==0', {
11       'targets': [
12         {
13           'target_name': 'ppapi_lib',
14           'type': 'none',
15           'dependencies': [
16              '../../native_client/src/untrusted/pthread/pthread.gyp:pthread_lib',
17              'src/untrusted/irt_stub/irt_stub.gyp:ppapi_stub_lib',
18           ],
19           'include_dirs': [
20             '..',
21           ],
22           'copies': [
23             {
24               'destination': '>(tc_include_dir_newlib)/nacl',
25               'files': [
26                 'src/trusted/weak_ref/call_on_main_thread.h',
27                 'src/shared/ppapi_proxy/ppruntime.h',
28               ],
29             },
31             {
32               'destination': '>(tc_lib_dir_pnacl_newlib)',
33               'files': [
34                 'src/untrusted/irt_stub/libppapi.a',
35               ],
36             },
37           ],
38           'conditions': [
39             ['target_arch=="ia32" or target_arch=="x64"', {
40               'copies': [
41                 {
42                   'destination': '>(tc_include_dir_glibc)/include/nacl',
43                   'files': [
44                     'src/trusted/weak_ref/call_on_main_thread.h',
45                     'src/shared/ppapi_proxy/ppruntime.h',
46                   ],
47                 },
48               ],
49             }],
50             ['target_arch=="ia32"', {
51               'copies': [
52                 # Here we copy linker scripts out of the Native Client repo..
53                 # These are source, not build artifacts.
54                 {
55                   'destination': '>(tc_lib_dir_newlib32)',
56                   'files': [
57                     'src/untrusted/irt_stub/libppapi.a',
58                   ],
59                 },
60                 {
61                   'destination': '>(tc_lib_dir_glibc32)',
62                   'files': [
63                     'src/untrusted/irt_stub/libppapi.a',
64                     'src/untrusted/irt_stub/libppapi.so',
65                   ],
66                 },
67               ],
68             }],
69             ['target_arch=="x64" or (target_arch=="ia32" and OS=="win")', {
70               'copies': [
71                 {
72                   'destination': '>(tc_lib_dir_newlib64)',
73                   'files': [
74                     'src/untrusted/irt_stub/libppapi.a',
75                   ],
76                 },
77                 {
78                   'destination': '>(tc_lib_dir_glibc64)',
79                   'files': [
80                     'src/untrusted/irt_stub/libppapi.a',
81                     'src/untrusted/irt_stub/libppapi.so',
82                   ],
83                 },
84               ]
85             }],
86             ['target_arch=="arm"', {
87               'copies': [
88                 {
89                   'destination': '>(tc_lib_dir_newlib_arm)',
90                   'files': [
91                     'src/untrusted/irt_stub/libppapi.a',
92                   ],
93                 },
94               ]
95             }],
96             ['target_arch=="mipsel"', {
97               'copies': [
98                 {
99                   'destination': '>(tc_lib_dir_newlib_mips)',
100                   'files': [
101                     'src/untrusted/irt_stub/libppapi.a',
102                   ],
103                 },
104               ]
105             }]
106           ],
107         },
108         {
109           'target_name': 'nacl_irt',
110           'type': 'none',
111           'variables': {
112             'nexe_target': 'nacl_irt',
113             # These out_* fields override the default filenames, which
114             # include a "_newlib" suffix and places them in the target
115             # directory.
116             'out_newlib64': '<(PRODUCT_DIR)/nacl_irt_x86_64.nexe',
117             'out_newlib32': '<(PRODUCT_DIR)/nacl_irt_x86_32.nexe',
118             'out_newlib_arm': '<(PRODUCT_DIR)/nacl_irt_arm.nexe',
119             'out_newlib_mips': '<(PRODUCT_DIR)/nacl_irt_mips32.nexe',
120             'build_glibc': 0,
121             'build_newlib': 0,
122             'build_irt': 1,
123             'include_dirs': [
124               '..',
125             ],
126             'link_flags': [
127               '-Wl,--start-group',
128               '-lirt_browser',
129               '-llatency_info_nacl',
130               '-lpnacl_irt_shim_for_irt',
131               '-lppapi_proxy_nacl',
132               '-lppapi_ipc_nacl',
133               '-lppapi_shared_nacl',
134               '-lgles2_implementation_nacl',
135               '-lgles2_cmd_helper_nacl',
136               '-lgles2_utils_nacl',
137               '-lcommand_buffer_client_nacl',
138               '-lcommand_buffer_common_nacl',
139               '-ltracing_nacl',
140               '-lgpu_ipc_nacl',
141               '-lipc_nacl',
142               '-lbase_nacl',
143               '-lshared_memory_support_nacl',
144               '-lsrpc',
145               '-limc_syscalls',
146               '-lplatform',
147               '-lgio',
148               '-Wl,--end-group',
149               '-lm',
150             ],
151             'extra_args': [
152               '--strip-all',
153             ],
154             'conditions': [
155               # untrusted.gypi and build_nexe.py currently build
156               # both x86-32 and x86-64 whenever target_arch is some
157               # flavor of x86.  However, on non-windows platforms
158               # we only need one architecture.
159               ['OS!="win" and target_arch=="ia32"',
160                 {
161                   'enable_x86_64': 0
162                 }
163               ],
164               ['target_arch=="x64"',
165                 {
166                   'enable_x86_32': 0
167                 }
168               ],
169               ['target_arch=="ia32" or target_arch=="x64"', {
170                 'extra_deps_newlib64': [
171                   '>(tc_lib_dir_irt64)/libppapi_proxy_nacl.a',
172                   '>(tc_lib_dir_irt64)/libppapi_ipc_nacl.a',
173                   '>(tc_lib_dir_irt64)/libppapi_shared_nacl.a',
174                   '>(tc_lib_dir_irt64)/libgles2_implementation_nacl.a',
175                   '>(tc_lib_dir_irt64)/libcommand_buffer_client_nacl.a',
176                   '>(tc_lib_dir_irt64)/libcommand_buffer_common_nacl.a',
177                   '>(tc_lib_dir_irt64)/libgpu_ipc_nacl.a',
178                   '>(tc_lib_dir_irt64)/libtracing_nacl.a',
179                   '>(tc_lib_dir_irt64)/libgles2_cmd_helper_nacl.a',
180                   '>(tc_lib_dir_irt64)/libgles2_utils_nacl.a',
181                   '>(tc_lib_dir_irt64)/libipc_nacl.a',
182                   '>(tc_lib_dir_irt64)/libbase_nacl.a',
183                   '>(tc_lib_dir_irt64)/libirt_browser.a',
184                   '>(tc_lib_dir_irt64)/libpnacl_irt_shim_for_irt.a',
185                   '>(tc_lib_dir_irt64)/libshared_memory_support_nacl.a',
186                   '>(tc_lib_dir_irt64)/libsrpc.a',
187                   '>(tc_lib_dir_irt64)/libplatform.a',
188                   '>(tc_lib_dir_irt64)/libimc_syscalls.a',
189                   '>(tc_lib_dir_irt64)/libgio.a',
190                 ],
191                 'extra_deps_newlib32': [
192                   '>(tc_lib_dir_irt32)/libppapi_proxy_nacl.a',
193                   '>(tc_lib_dir_irt32)/libppapi_ipc_nacl.a',
194                   '>(tc_lib_dir_irt32)/libppapi_shared_nacl.a',
195                   '>(tc_lib_dir_irt32)/libgles2_implementation_nacl.a',
196                   '>(tc_lib_dir_irt32)/libcommand_buffer_client_nacl.a',
197                   '>(tc_lib_dir_irt32)/libcommand_buffer_common_nacl.a',
198                   '>(tc_lib_dir_irt32)/libgpu_ipc_nacl.a',
199                   '>(tc_lib_dir_irt32)/libtracing_nacl.a',
200                   '>(tc_lib_dir_irt32)/libgles2_cmd_helper_nacl.a',
201                   '>(tc_lib_dir_irt32)/libgles2_utils_nacl.a',
202                   '>(tc_lib_dir_irt32)/libipc_nacl.a',
203                   '>(tc_lib_dir_irt32)/libbase_nacl.a',
204                   '>(tc_lib_dir_irt32)/libirt_browser.a',
205                   '>(tc_lib_dir_irt32)/libpnacl_irt_shim_for_irt.a',
206                   '>(tc_lib_dir_irt32)/libshared_memory_support_nacl.a',
207                   '>(tc_lib_dir_irt32)/libsrpc.a',
208                   '>(tc_lib_dir_irt32)/libplatform.a',
209                   '>(tc_lib_dir_irt32)/libimc_syscalls.a',
210                   '>(tc_lib_dir_irt32)/libgio.a',
211                 ],
212               }],
213               ['target_arch=="arm"', {
214                 'extra_deps_arm': [
215                   '>(tc_lib_dir_irt_arm)/libppapi_proxy_nacl.a',
216                   '>(tc_lib_dir_irt_arm)/libppapi_ipc_nacl.a',
217                   '>(tc_lib_dir_irt_arm)/libppapi_shared_nacl.a',
218                   '>(tc_lib_dir_irt_arm)/libgles2_implementation_nacl.a',
219                   '>(tc_lib_dir_irt_arm)/libcommand_buffer_client_nacl.a',
220                   '>(tc_lib_dir_irt_arm)/libcommand_buffer_common_nacl.a',
221                   '>(tc_lib_dir_irt_arm)/libgpu_ipc_nacl.a',
222                   '>(tc_lib_dir_irt_arm)/libtracing_nacl.a',
223                   '>(tc_lib_dir_irt_arm)/libgles2_cmd_helper_nacl.a',
224                   '>(tc_lib_dir_irt_arm)/libgles2_utils_nacl.a',
225                   '>(tc_lib_dir_irt_arm)/libipc_nacl.a',
226                   '>(tc_lib_dir_irt_arm)/libbase_nacl.a',
227                   '>(tc_lib_dir_irt_arm)/libirt_browser.a',
228                   '>(tc_lib_dir_irt_arm)/libpnacl_irt_shim_for_irt.a',
229                   '>(tc_lib_dir_irt_arm)/libshared_memory_support_nacl.a',
230                   '>(tc_lib_dir_irt_arm)/libsrpc.a',
231                   '>(tc_lib_dir_irt_arm)/libplatform.a',
232                   '>(tc_lib_dir_irt_arm)/libimc_syscalls.a',
233                   '>(tc_lib_dir_irt_arm)/libgio.a',
234                 ],
235               }],
236               ['target_arch=="mipsel"', {
237                 'extra_deps_mips': [
238                   '>(tc_lib_dir_irt_mips)/libppapi_proxy_nacl.a',
239                   '>(tc_lib_dir_irt_mips)/libppapi_ipc_nacl.a',
240                   '>(tc_lib_dir_irt_mips)/libppapi_shared_nacl.a',
241                   '>(tc_lib_dir_irt_mips)/libgles2_implementation_nacl.a',
242                   '>(tc_lib_dir_irt_mips)/libcommand_buffer_client_nacl.a',
243                   '>(tc_lib_dir_irt_mips)/libcommand_buffer_common_nacl.a',
244                   '>(tc_lib_dir_irt_mips)/libgpu_ipc_nacl.a',
245                   '>(tc_lib_dir_irt_mips)/libtracing_nacl.a',
246                   '>(tc_lib_dir_irt_mips)/libgles2_cmd_helper_nacl.a',
247                   '>(tc_lib_dir_irt_mips)/libgles2_utils_nacl.a',
248                   '>(tc_lib_dir_irt_mips)/libipc_nacl.a',
249                   '>(tc_lib_dir_irt_mips)/libbase_nacl.a',
250                   '>(tc_lib_dir_irt_mips)/libirt_browser.a',
251                   '>(tc_lib_dir_irt_mips)/libpnacl_irt_shim_for_irt.a',
252                   '>(tc_lib_dir_irt_mips)/libshared_memory_support_nacl.a',
253                   '>(tc_lib_dir_irt_mips)/libsrpc.a',
254                   '>(tc_lib_dir_irt_mips)/libplatform.a',
255                   '>(tc_lib_dir_irt_mips)/libimc_syscalls.a',
256                   '>(tc_lib_dir_irt_mips)/libgio.a',
257                 ],
258               }],
259             ],
260           },
261           'dependencies': [
262             'src/untrusted/pnacl_irt_shim/pnacl_irt_shim.gyp:irt',
263             '../ppapi_proxy_nacl.gyp:ppapi_proxy_nacl',
264             '../ppapi_ipc_nacl.gyp:ppapi_ipc_nacl',
265             '../ppapi_shared_nacl.gyp:ppapi_shared_nacl',
266             '../../gpu/command_buffer/command_buffer_nacl.gyp:gles2_utils_nacl',
267             '../../gpu/gpu_nacl.gyp:command_buffer_client_nacl',
268             '../../gpu/gpu_nacl.gyp:command_buffer_common_nacl',
269             '../../gpu/gpu_nacl.gyp:gles2_implementation_nacl',
270             '../../gpu/gpu_nacl.gyp:gles2_cmd_helper_nacl',
271             '../../gpu/gpu_nacl.gyp:gpu_ipc_nacl',
272             '../../components/tracing_nacl.gyp:tracing_nacl',
273             '../../ipc/ipc_nacl.gyp:ipc_nacl',
274             '../../base/base_nacl.gyp:base_nacl',
275             '../../media/media_nacl.gyp:shared_memory_support_nacl',
276             '../../native_client/src/untrusted/irt/irt.gyp:irt_browser_lib',
277             '../../native_client/src/shared/srpc/srpc.gyp:srpc_lib',
278             '../../native_client/src/shared/platform/platform.gyp:platform_lib',
279             '../../native_client/src/tools/tls_edit/tls_edit.gyp:tls_edit#host',
280             '../../native_client/src/untrusted/nacl/nacl.gyp:imc_syscalls_lib',
281             '../../native_client/src/shared/gio/gio.gyp:gio_lib',
282           ],
283         },
284       ],
285     }],
286   ],