1 # Copyright (c) 2013 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.
7 '../build/common_untrusted.gypi',
10 # We need to override the variables in untrusted.gypi outside of a
11 # target_condition block because the target_condition block in
12 # untrusted gypi is fully evaluated and interpolated before any of the
13 # target_condition blocks in this file are expanded. This means that any
14 # variables overriden inside a target_condition block in this file will not
15 # affect the values in untrusted.gypi.
19 'nacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/newlib',
20 'nacl_glibc_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/glibc',
21 'nacl_pnacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/pnacl',
22 'nacl_pnacl_newlib_nonsfi_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/nonsfi',
23 'target_conditions': [
25 # These variables are used for nexe building and for library building.
26 'out_newlib32%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_32.nexe',
27 'out_newlib64%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_64.nexe',
28 'out_newlib_arm%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_arm.nexe',
29 'out_newlib_mips%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_mips32.nexe',
30 'nmf_newlib%': '>(nacl_newlib_out_dir)/>(nexe_target).nmf',
31 'out_glibc32%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_32.nexe',
32 'out_glibc64%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_64.nexe',
33 'out_glibc_arm%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_arm.nexe',
34 'nmf_glibc%': '>(nacl_glibc_out_dir)/>(nexe_target).nmf',
35 'out_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target)_newlib_pnacl.pexe',
36 'nmf_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target).nmf',
37 'out_pnacl_newlib_x86_32_nonsfi_nexe': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nexe_target)_pnacl_newlib_x32_nonsfi.nexe',
38 'out_pnacl_newlib_arm_nonsfi_nexe': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nexe_target)_pnacl_newlib_arm_nonsfi.nexe',
39 'nmf_pnacl_newlib_nonsfi%': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nexe_target).nmf',
44 '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
45 '<(DEPTH)/native_client/src/untrusted/pthread/pthread.gyp:pthread_lib',
46 '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
47 '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
49 'target_conditions': [
50 ['test_files!=[] and build_newlib==1', {
53 'destination': '>(nacl_newlib_out_dir)',
60 ['test_files!=[] and "<(target_arch)"!="arm" and "<(target_arch)"!="mipsel" and disable_glibc==0 and build_glibc==1', {
63 'destination': '>(nacl_glibc_out_dir)',
70 # Nonsfi pnacl copy is covered below.
71 ['test_files!=[] and build_pnacl_newlib==1 and disable_pnacl==0', {
74 'destination': '>(nacl_pnacl_newlib_out_dir)',
81 ['test_files!=[] and build_pnacl_newlib==1 and (enable_x86_32_nonsfi==1 or enable_arm_nonsfi==1)', {
84 'destination': '>(nacl_pnacl_newlib_nonsfi_out_dir)',
93 # Patch over the fact that untrusted.gypi doesn't define these in all
110 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
111 'create_nmf_args_portable%': [],
112 'create_nonsfi_test_nmf': '<(DEPTH)/ppapi/tests/create_nonsfi_test_nmf.py',
114 '--no-default-libpath',
115 '--objdump=>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
118 'target_conditions': [
119 ['generate_nmf==1 and build_newlib==1', {
122 'action_name': 'Generate NEWLIB NMF',
123 'inputs': ['>(create_nmf)'],
124 'outputs': ['>(nmf_newlib)'],
128 '>@(create_nmf_args)',
129 '--output=>(nmf_newlib)',
130 '>@(create_nmf_args_portable)',
132 'target_conditions': [
133 ['enable_x86_64==1', {
134 'inputs': ['>(out_newlib64)'],
135 'action': ['>(out_newlib64)'],
137 ['enable_x86_32==1', {
138 'inputs': ['>(out_newlib32)'],
139 'action': ['>(out_newlib32)'],
142 'inputs': ['>(out_newlib_arm)'],
143 'action': ['>(out_newlib_arm)'],
146 'inputs': ['>(out_newlib_mips)'],
147 'action': ['>(out_newlib_mips)'],
153 ['"<(target_arch)"!="arm" and "<(target_arch)"!="mipsel" and generate_nmf==1 and disable_glibc==0 and build_glibc==1', {
155 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
156 # doesn't work on Windows.
157 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
158 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
162 'action_name': 'Generate GLIBC NMF and copy libs',
163 'inputs': ['>(create_nmf)'],
164 # NOTE: There is no explicit dependency for the lib32
165 # and lib64 directories created in the PRODUCT_DIR.
166 # They are created as a side-effect of NMF creation.
167 'outputs': ['>(nmf_glibc)'],
171 '>@(create_nmf_args)',
172 '--output=>(nmf_glibc)',
173 '--path-prefix=>(nexe_target)_libs',
174 '--stage-dependencies=<(nacl_glibc_out_dir)',
175 '>@(create_nmf_args_portable)',
177 'target_conditions': [
178 ['enable_x86_64==1', {
179 'inputs': ['>(out_glibc64)'],
181 '--library-path=>(libdir_glibc64)',
182 '--library-path=>(tc_lib_dir_glibc64)',
185 ['enable_x86_32==1', {
186 'inputs': ['>(out_glibc32)'],
188 '--library-path=>(libdir_glibc32)',
189 '--library-path=>(tc_lib_dir_glibc32)',
192 # TODO(ncbray) handle arm case. We don't have ARM glibc yet.
197 ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0', {
200 'action_name': 'Generate PNACL NEWLIB NMF',
201 # NOTE: create_nmf must be first, it is the script python
203 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib)'],
204 'outputs': ['>(nmf_pnacl_newlib)'],
208 '>@(create_nmf_args)',
209 '--output=>(nmf_pnacl_newlib)',
210 '>(out_pnacl_newlib)',
211 '>@(create_nmf_args_portable)',
216 ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0 and (enable_x86_32_nonsfi==1 or enable_arm_nonsfi==1)', {
219 'action_name': 'Generate PNACL NEWLIB nonsfi NMF',
220 'inputs': ['>(create_nonsfi_test_nmf)'],
221 'outputs': ['>(nmf_pnacl_newlib_nonsfi)'],
224 '>(create_nonsfi_test_nmf)',
225 '>@(create_nmf_args_portable)',
226 '--output=>(nmf_pnacl_newlib_nonsfi)',
228 'target_conditions': [
229 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="ia32"', {
230 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
232 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
236 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="x64"', {
237 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
239 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
240 # This should be used only for nacl_helper_nonsfi test.
241 # In theory this should be x86-32. However, currently
242 # fallback logic to x86-32-nonsfi is not implemented,
243 # and, moreover, it would break the tests for current
244 # nacl_helper in Non-SFI mode on x64 Chrome.
245 # So, here we introduce the hack to use "x86-64" in order
246 # to take the benefit to run nacl_helper_nonsfi tests on
248 # TODO(hidehiko): Remove this hack.
252 ['enable_arm_nonsfi==1', {
253 'inputs': ['>(out_pnacl_newlib_arm_nonsfi_nexe)'],
255 '--program=>(out_pnacl_newlib_arm_nonsfi_nexe)',