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.
17 'nacl_untrusted_build': 1,
20 'nacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/newlib',
21 'nacl_glibc_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/glibc',
22 'nacl_pnacl_newlib_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/pnacl',
23 'nacl_pnacl_newlib_nonsfi_out_dir': '<(PRODUCT_DIR)/>(nexe_destination_dir)/nonsfi',
24 'target_conditions': [
26 # These variables are used for nexe building and for library building.
27 'out_newlib32%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_32.nexe',
28 'out_newlib64%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_x86_64.nexe',
29 'out_newlib_arm%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_arm.nexe',
30 'out_newlib_mips%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_mips32.nexe',
31 'nmf_newlib%': '>(nacl_newlib_out_dir)/>(nexe_target).nmf',
32 'out_glibc32%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_32.nexe',
33 'out_glibc64%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_64.nexe',
34 'out_glibc_arm%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_arm.nexe',
35 'nmf_glibc%': '>(nacl_glibc_out_dir)/>(nexe_target).nmf',
36 'out_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target)_newlib_pnacl.pexe',
37 'nmf_pnacl_newlib%': '>(nacl_pnacl_newlib_out_dir)/>(nexe_target).nmf',
38 'out_pnacl_newlib_x86_32_nonsfi_nexe': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nexe_target)_pnacl_newlib_x32_nonsfi.nexe',
39 'out_pnacl_newlib_arm_nonsfi_nexe': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nexe_target)_pnacl_newlib_arm_nonsfi.nexe',
40 'nmf_pnacl_newlib_nonsfi%': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nexe_target).nmf',
45 '<(DEPTH)/native_client/src/untrusted/nacl/nacl.gyp:nacl_lib',
46 '<(DEPTH)/native_client/src/untrusted/pthread/pthread.gyp:pthread_lib',
47 '<(DEPTH)/ppapi/ppapi_nacl.gyp:ppapi_cpp_lib',
48 '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib',
50 'target_conditions': [
51 ['test_files!=[] and build_newlib==1', {
54 'destination': '>(nacl_newlib_out_dir)',
61 ['test_files!=[] and "<(target_arch)"!="arm" and "<(target_arch)"!="mipsel" and disable_glibc==0 and build_glibc==1', {
64 'destination': '>(nacl_glibc_out_dir)',
71 # Nonsfi pnacl copy is covered below.
72 ['test_files!=[] and build_pnacl_newlib==1 and disable_pnacl==0', {
75 'destination': '>(nacl_pnacl_newlib_out_dir)',
82 ['test_files!=[] and build_pnacl_newlib==1 and (enable_x86_32_nonsfi==1 or enable_arm_nonsfi==1)', {
85 'destination': '>(nacl_pnacl_newlib_nonsfi_out_dir)',
94 # Patch over the fact that untrusted.gypi doesn't define these in all
111 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py',
112 'create_nmf_args_portable%': [],
113 'create_nonsfi_test_nmf': '<(DEPTH)/ppapi/tests/create_nonsfi_test_nmf.py',
115 '--no-default-libpath',
116 '--objdump=>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump',
119 'target_conditions': [
120 ['generate_nmf==1 and build_newlib==1 and disable_newlib==0', {
123 'action_name': 'Generate NEWLIB NMF',
124 'inputs': ['>(create_nmf)'],
125 'outputs': ['>(nmf_newlib)'],
129 '>@(create_nmf_args)',
130 '--output=>(nmf_newlib)',
131 '>@(create_nmf_args_portable)',
133 'target_conditions': [
134 ['enable_x86_64==1', {
135 'inputs': ['>(out_newlib64)'],
136 'action': ['>(out_newlib64)'],
138 ['enable_x86_32==1', {
139 'inputs': ['>(out_newlib32)'],
140 'action': ['>(out_newlib32)'],
143 'inputs': ['>(out_newlib_arm)'],
144 'action': ['>(out_newlib_arm)'],
147 'inputs': ['>(out_newlib_mips)'],
148 'action': ['>(out_newlib_mips)'],
154 ['"<(target_arch)"!="arm" and "<(target_arch)"!="mipsel" and generate_nmf==1 and disable_glibc==0 and build_glibc==1', {
156 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which
157 # doesn't work on Windows.
158 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib',
159 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32',
163 'action_name': 'Generate GLIBC NMF and copy libs',
164 'inputs': ['>(create_nmf)'],
165 # NOTE: There is no explicit dependency for the lib32
166 # and lib64 directories created in the PRODUCT_DIR.
167 # They are created as a side-effect of NMF creation.
168 'outputs': ['>(nmf_glibc)'],
172 '>@(create_nmf_args)',
173 '--output=>(nmf_glibc)',
174 '--path-prefix=>(nexe_target)_libs',
175 '--stage-dependencies=<(nacl_glibc_out_dir)',
176 '>@(create_nmf_args_portable)',
178 'target_conditions': [
179 ['enable_x86_64==1', {
180 'inputs': ['>(out_glibc64)'],
182 '--library-path=>(libdir_glibc64)',
183 '--library-path=>(tc_lib_dir_glibc64)',
186 ['enable_x86_32==1', {
187 'inputs': ['>(out_glibc32)'],
189 '--library-path=>(libdir_glibc32)',
190 '--library-path=>(tc_lib_dir_glibc32)',
193 # TODO(ncbray) handle arm case. We don't have ARM glibc yet.
198 ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0', {
201 'action_name': 'Generate PNACL NEWLIB NMF',
202 # NOTE: create_nmf must be first, it is the script python
204 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib)'],
205 'outputs': ['>(nmf_pnacl_newlib)'],
209 '>@(create_nmf_args)',
210 '--output=>(nmf_pnacl_newlib)',
211 '>(out_pnacl_newlib)',
212 '>@(create_nmf_args_portable)',
217 ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0 and (enable_x86_32_nonsfi==1 or enable_arm_nonsfi==1)', {
220 'action_name': 'Generate PNACL NEWLIB nonsfi NMF',
221 'inputs': ['>(create_nonsfi_test_nmf)'],
222 'outputs': ['>(nmf_pnacl_newlib_nonsfi)'],
225 '>(create_nonsfi_test_nmf)',
226 '>@(create_nmf_args_portable)',
227 '--output=>(nmf_pnacl_newlib_nonsfi)',
229 'target_conditions': [
230 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="ia32"', {
231 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
233 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
237 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="x64"', {
238 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'],
240 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)',
241 # This should be used only for nacl_helper_nonsfi test.
242 # In theory this should be x86-32. However, currently
243 # fallback logic to x86-32-nonsfi is not implemented,
244 # and, moreover, it would break the tests for current
245 # nacl_helper in Non-SFI mode on x64 Chrome.
246 # So, here we introduce the hack to use "x86-64" in order
247 # to take the benefit to run nacl_helper_nonsfi tests on
249 # TODO(hidehiko): Remove this hack.
253 ['enable_arm_nonsfi==1', {
254 'inputs': ['>(out_pnacl_newlib_arm_nonsfi_nexe)'],
256 '--program=>(out_pnacl_newlib_arm_nonsfi_nexe)',