| OLD | NEW |
| (Empty) |
| 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. | |
| 4 | |
| 5 { | |
| 6 'includes': [ | |
| 7 '../build/common_untrusted.gypi', | |
| 8 ], | |
| 9 'target_defaults': { | |
| 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. | |
| 16 'variables': { | |
| 17 'nacl_untrusted_build': 1, | |
| 18 'test_files': [], | |
| 19 'generate_nmf%': 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': [ | |
| 25 ['nexe_target!=""', { | |
| 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.n
exe', | |
| 30 'out_newlib_mips%': '>(nacl_newlib_out_dir)/>(nexe_target)_newlib_mips
32.nexe', | |
| 31 'nmf_newlib%': '>(nacl_newlib_out_dir)/>(nexe_target).nmf', | |
| 32 'out_glibc32%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_32.nex
e', | |
| 33 'out_glibc64%': '>(nacl_glibc_out_dir)/>(nexe_target)_glibc_x86_64.nex
e', | |
| 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)_newl
ib_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_di
r)/>(nexe_target)_pnacl_newlib_arm_nonsfi.nexe', | |
| 40 'nmf_pnacl_newlib_nonsfi%': '>(nacl_pnacl_newlib_nonsfi_out_dir)/>(nex
e_target).nmf', | |
| 41 }], | |
| 42 ], | |
| 43 }, | |
| 44 'dependencies': [ | |
| 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/ppapi_nacl.gyp:nacl_elf_loader', | |
| 49 '<(DEPTH)/ppapi/native_client/native_client.gyp:ppapi_lib', | |
| 50 ], | |
| 51 'target_conditions': [ | |
| 52 ['test_files!=[] and build_newlib==1', { | |
| 53 'copies': [ | |
| 54 { | |
| 55 'destination': '>(nacl_newlib_out_dir)', | |
| 56 'files': [ | |
| 57 '>@(test_files)', | |
| 58 ], | |
| 59 }, | |
| 60 ], | |
| 61 }], | |
| 62 ['test_files!=[] and "<(target_arch)"!="mipsel" and disable_glibc==0 and b
uild_glibc==1', { | |
| 63 'copies': [ | |
| 64 { | |
| 65 'destination': '>(nacl_glibc_out_dir)', | |
| 66 'files': [ | |
| 67 '>@(test_files)', | |
| 68 ], | |
| 69 }, | |
| 70 ], | |
| 71 }], | |
| 72 # Nonsfi pnacl copy is covered below. | |
| 73 ['test_files!=[] and build_pnacl_newlib==1 and disable_pnacl==0', { | |
| 74 'copies': [ | |
| 75 { | |
| 76 'destination': '>(nacl_pnacl_newlib_out_dir)', | |
| 77 'files': [ | |
| 78 '>@(test_files)', | |
| 79 ], | |
| 80 }, | |
| 81 ], | |
| 82 }], | |
| 83 ['test_files!=[] and build_pnacl_newlib==1 and (enable_x86_32_nonsfi==1 or
enable_arm_nonsfi==1)', { | |
| 84 'copies': [ | |
| 85 { | |
| 86 'destination': '>(nacl_pnacl_newlib_nonsfi_out_dir)', | |
| 87 'files': [ | |
| 88 '>@(test_files)', | |
| 89 ], | |
| 90 }, | |
| 91 ], | |
| 92 }], | |
| 93 ['nexe_target!=""', { | |
| 94 'variables': { | |
| 95 # Patch over the fact that untrusted.gypi doesn't define these in all | |
| 96 # cases. | |
| 97 'enable_x86_64%': 0, | |
| 98 'enable_x86_32%': 0, | |
| 99 'enable_arm%': 0, | |
| 100 'enable_mips%': 0, | |
| 101 'include_dirs': [ | |
| 102 '<(DEPTH)', | |
| 103 ], | |
| 104 'link_flags': [ | |
| 105 '-lppapi_cpp', | |
| 106 '-lppapi', | |
| 107 '-pthread', | |
| 108 ], | |
| 109 'extra_args': [ | |
| 110 '--strip-all', | |
| 111 ], | |
| 112 'variables': { | |
| 113 'conditions': [ | |
| 114 ['target_arch=="arm"', { | |
| 115 'objdump': '>(nacl_glibc_tc_root)/bin/arm-nacl-objdump' | |
| 116 }, { | |
| 117 'objdump': '>(nacl_glibc_tc_root)/bin/x86_64-nacl-objdump' | |
| 118 }], | |
| 119 ] | |
| 120 }, | |
| 121 'create_nmf': '<(DEPTH)/native_client_sdk/src/tools/create_nmf.py', | |
| 122 'create_nmf_args_portable%': [], | |
| 123 'create_nonsfi_test_nmf': '<(DEPTH)/ppapi/tests/create_nonsfi_test_nmf
.py', | |
| 124 'create_nmf_args': [ | |
| 125 '--no-default-libpath', | |
| 126 '--objdump=<(objdump)', | |
| 127 ], | |
| 128 }, | |
| 129 'target_conditions': [ | |
| 130 ['generate_nmf==1 and build_newlib==1 and disable_newlib==0', { | |
| 131 'actions': [ | |
| 132 { | |
| 133 'action_name': 'Generate NEWLIB NMF', | |
| 134 'inputs': ['>(create_nmf)'], | |
| 135 'outputs': ['>(nmf_newlib)'], | |
| 136 'action': [ | |
| 137 'python', | |
| 138 '>(create_nmf)', | |
| 139 '>@(create_nmf_args)', | |
| 140 '--output=>(nmf_newlib)', | |
| 141 '>@(create_nmf_args_portable)', | |
| 142 ], | |
| 143 'target_conditions': [ | |
| 144 ['enable_x86_64==1', { | |
| 145 'inputs': ['>(out_newlib64)'], | |
| 146 'action': ['>(out_newlib64)'], | |
| 147 }], | |
| 148 ['enable_x86_32==1', { | |
| 149 'inputs': ['>(out_newlib32)'], | |
| 150 'action': ['>(out_newlib32)'], | |
| 151 }], | |
| 152 ['enable_arm==1', { | |
| 153 'inputs': ['>(out_newlib_arm)'], | |
| 154 'action': ['>(out_newlib_arm)'], | |
| 155 }], | |
| 156 ['enable_mips==1', { | |
| 157 'inputs': ['>(out_newlib_mips)'], | |
| 158 'action': ['>(out_newlib_mips)'], | |
| 159 }], | |
| 160 ], | |
| 161 }, | |
| 162 ], | |
| 163 }], | |
| 164 ['"<(target_arch)"!="mipsel" and generate_nmf==1 and disable_glibc==0
and build_glibc==1', { | |
| 165 'variables': { | |
| 166 # NOTE: Use /lib, not /lib64 here; it is a symbolic link which | |
| 167 # doesn't work on Windows. | |
| 168 'libdir_glibc64': '>(nacl_glibc_tc_root)/x86_64-nacl/lib', | |
| 169 'libdir_glibc32': '>(nacl_glibc_tc_root)/x86_64-nacl/lib32', | |
| 170 'libdir_glibc_arm': '>(nacl_glibc_tc_root)/arm-nacl/lib', | |
| 171 }, | |
| 172 'actions': [ | |
| 173 { | |
| 174 'action_name': 'Generate GLIBC NMF and copy libs', | |
| 175 'inputs': ['>(create_nmf)'], | |
| 176 # NOTE: There is no explicit dependency for the lib32 | |
| 177 # and lib64 directories created in the PRODUCT_DIR. | |
| 178 # They are created as a side-effect of NMF creation. | |
| 179 'outputs': ['>(nmf_glibc)'], | |
| 180 'action': [ | |
| 181 'python', | |
| 182 '>@(_inputs)', | |
| 183 '>@(create_nmf_args)', | |
| 184 '--output=>(nmf_glibc)', | |
| 185 '--path-prefix=>(nexe_target)_libs', | |
| 186 '--stage-dependencies=<(nacl_glibc_out_dir)', | |
| 187 '>@(create_nmf_args_portable)', | |
| 188 ], | |
| 189 'target_conditions': [ | |
| 190 ['enable_x86_64==1', { | |
| 191 'inputs': ['>(out_glibc64)'], | |
| 192 'action': [ | |
| 193 '--library-path=>(libdir_glibc64)', | |
| 194 '--library-path=>(tc_lib_dir_glibc64)', | |
| 195 ], | |
| 196 }], | |
| 197 ['enable_x86_32==1', { | |
| 198 'inputs': ['>(out_glibc32)'], | |
| 199 'action': [ | |
| 200 '--library-path=>(libdir_glibc32)', | |
| 201 '--library-path=>(tc_lib_dir_glibc32)', | |
| 202 ], | |
| 203 }], | |
| 204 ['enable_arm==1', { | |
| 205 'inputs': ['>(out_glibc_arm)'], | |
| 206 'action': [ | |
| 207 '--library-path=>(libdir_glibc_arm)', | |
| 208 '--library-path=>(tc_lib_dir_glibc_arm)', | |
| 209 ], | |
| 210 }], | |
| 211 ], | |
| 212 }, | |
| 213 ], | |
| 214 }], | |
| 215 ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0', { | |
| 216 'actions': [ | |
| 217 { | |
| 218 'action_name': 'Generate PNACL NEWLIB NMF', | |
| 219 # NOTE: create_nmf must be first, it is the script python | |
| 220 # executes below. | |
| 221 'inputs': ['>(create_nmf)', '>(out_pnacl_newlib)'], | |
| 222 'outputs': ['>(nmf_pnacl_newlib)'], | |
| 223 'action': [ | |
| 224 'python', | |
| 225 '>(create_nmf)', | |
| 226 '>@(create_nmf_args)', | |
| 227 '--output=>(nmf_pnacl_newlib)', | |
| 228 '>(out_pnacl_newlib)', | |
| 229 '>@(create_nmf_args_portable)', | |
| 230 ], | |
| 231 }, | |
| 232 ], | |
| 233 }], | |
| 234 ['generate_nmf==1 and build_pnacl_newlib==1 and disable_pnacl==0 and (
enable_x86_32_nonsfi==1 or enable_arm_nonsfi==1)', { | |
| 235 'actions': [ | |
| 236 { | |
| 237 'action_name': 'Generate PNACL NEWLIB nonsfi NMF', | |
| 238 'inputs': ['>(create_nonsfi_test_nmf)'], | |
| 239 'outputs': ['>(nmf_pnacl_newlib_nonsfi)'], | |
| 240 'action': [ | |
| 241 'python', | |
| 242 '>(create_nonsfi_test_nmf)', | |
| 243 '>@(create_nmf_args_portable)', | |
| 244 '--output=>(nmf_pnacl_newlib_nonsfi)', | |
| 245 ], | |
| 246 'target_conditions': [ | |
| 247 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="ia32"', { | |
| 248 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'], | |
| 249 'action': [ | |
| 250 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)', | |
| 251 '--arch=x86-32', | |
| 252 ] | |
| 253 }], | |
| 254 ['enable_x86_32_nonsfi==1 and "<(target_arch)"=="x64"', { | |
| 255 'inputs': ['>(out_pnacl_newlib_x86_32_nonsfi_nexe)'], | |
| 256 'action': [ | |
| 257 '--program=>(out_pnacl_newlib_x86_32_nonsfi_nexe)', | |
| 258 # This should be used only for nacl_helper_nonsfi test. | |
| 259 # In theory this should be x86-32. However, currently | |
| 260 # fallback logic to x86-32-nonsfi is not implemented, | |
| 261 # and, moreover, it would break the tests for current | |
| 262 # nacl_helper in Non-SFI mode on x64 Chrome. | |
| 263 # So, here we introduce the hack to use "x86-64" in order | |
| 264 # to take the benefit to run nacl_helper_nonsfi tests on | |
| 265 # x64 Chrome. | |
| 266 # TODO(hidehiko): Remove this hack. | |
| 267 '--arch=x86-64', | |
| 268 ] | |
| 269 }], | |
| 270 ['enable_arm_nonsfi==1', { | |
| 271 'inputs': ['>(out_pnacl_newlib_arm_nonsfi_nexe)'], | |
| 272 'action': [ | |
| 273 '--program=>(out_pnacl_newlib_arm_nonsfi_nexe)', | |
| 274 '--arch=arm', | |
| 275 ] | |
| 276 }], | |
| 277 ], | |
| 278 }, | |
| 279 ], | |
| 280 }], | |
| 281 ], | |
| 282 }], | |
| 283 ], | |
| 284 }, | |
| 285 } | |
| OLD | NEW |