1 # Copyright (c) 2011 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.
8 # Enable -Werror by default, but put it in a variable so it can
9 # be optionally disabled.
13 ['"<(target_arch)"=="arm"', {
14 # Settings for the newer GCC versions currently used only on ARM.
15 'NACL_RODATA_FLAG%': '-Trodata-segment',
17 # Settings for the older GCC version used on x86_32 and x86_64.
18 'NACL_RODATA_FLAG%': '--build-id,--section-start,.note.gnu.build-id',
24 # See native_client/Sconstruct for more details.
25 # Expected address for beginning of data in for the IRT.
26 'NACL_IRT_DATA_START': '0x3ef00000',
27 # Expected address for beginning of code in for the IRT.
28 'NACL_IRT_TEXT_START': '0x0fa00000',
29 # Flag to pass to linker to set start of RODATA segment.
30 'NACL_RODATA_FLAG%': '<(NACL_RODATA_FLAG)',
31 # Default C compiler defines.
32 'nacl_default_defines': [
34 '__STDC_LIMIT_MACROS=1',
35 '__STDC_FORMAT_MACROS=1',
38 '_POSIX_C_SOURCE=199506',
40 'DYNAMIC_ANNOTATIONS_ENABLED=1',
41 'DYNAMIC_ANNOTATIONS_PREFIX=NACL_',
43 'nacl_default_compile_flags': [
44 #'-std=gnu99', Added by build_nexe
48 '-fdiagnostics-show-option',
51 # The flag gomadir is one of the flag to enable goma on build_nexe.py.
52 # It should be set only if use_goma is true.
60 ['target_arch=="ia32" or target_arch=="x64"', {
61 # Common defaults for all x86 nacl-gcc targets
66 'nacl_glibc_tc_root': '<(DEPTH)/native_client/toolchain/win_x86',
71 'nacl_glibc_tc_root': '<(DEPTH)/native_client/toolchain/mac_x86',
76 'nacl_glibc_tc_root': '<(DEPTH)/native_client/toolchain/linux_x86',
98 'tc_lib_dir_newlib32': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib32',
99 'tc_lib_dir_newlib64': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/lib64',
100 'tc_lib_dir_glibc32': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib32',
101 'tc_lib_dir_glibc64': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/lib64',
102 'tc_lib_dir_irt32': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/lib32',
103 'tc_lib_dir_irt64': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/lib64',
104 'tc_include_dir_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/include',
105 'tc_include_dir_glibc': '<(SHARED_INTERMEDIATE_DIR)/tc_glibc/include',
107 'extra_deps_newlib64': [],
108 'extra_deps_newlib32': [],
109 'extra_deps_glibc64': [],
110 'extra_deps_glibc32': [],
111 'include_dirs': ['<(DEPTH)'],
113 '<@(nacl_default_defines)',
114 'NACL_BUILD_ARCH=x86',
120 # This is needed to open the .c filenames, which are given
121 # relative to the .gyp file.
123 # This is needed to open the .h filenames, which are given
124 # relative to the native_client directory's parent.
130 ['target_arch=="arm"', {
131 # Common defaults for all ARM nacl-gcc targets
152 'extra_deps_newlib_arm': [],
153 'native_sources': [],
154 'tc_lib_dir_newlib_arm': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libarm',
155 'tc_lib_dir_irt_arm': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/libarm',
156 'tc_include_dir_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/include',
157 'include_dirs': ['<(DEPTH)'],
159 '<@(nacl_default_defines)',
160 'NACL_BUILD_ARCH=arm',
166 # This is needed to open the .c filenames, which are given
167 # relative to the .gyp file.
169 # This is needed to open the .h filenames, which are given
170 # relative to the native_client directory's parent.
176 ['target_arch=="mipsel"', {
177 # Common defaults for all mips pnacl-clang targets
198 'extra_deps_newlib_mips': [],
199 'native_sources': [],
200 'tc_lib_dir_newlib_mips': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/libmips',
201 'tc_lib_dir_irt_mips': '<(SHARED_INTERMEDIATE_DIR)/tc_irt/libmips',
202 'tc_include_dir_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_newlib/include',
203 'include_dirs': ['<(DEPTH)'],
205 '<@(nacl_default_defines)',
206 'NACL_BUILD_ARCH=mips',
212 # This is needed to open the .c filenames, which are given
213 # relative to the .gyp file.
215 # This is needed to open the .h filenames, which are given
216 # relative to the native_client directory's parent.
222 ['target_arch=="ia32" or target_arch=="x64"', {
224 # x86-64 newlib nexe action
225 'target_conditions': [
226 ['nexe_target!="" and build_newlib!=0 and enable_x86_64!=0', {
228 'tool_name': 'newlib',
229 'out_newlib64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe',
230 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
234 'action_name': 'build newlib x86-64 nexe',
236 'source_list_newlib64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
238 'msvs_cygwin_shell': 0,
239 'description': 'building >(out_newlib64)',
241 '<(DEPTH)/native_client/build/build_nexe.py',
242 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
244 '>@(extra_deps_newlib64)',
245 '^(source_list_newlib64)',
246 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
248 'outputs': ['>(out_newlib64)'],
251 '<(DEPTH)/native_client/build/build_nexe.py',
252 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
255 '--build', 'newlib_nexe',
256 '--root', '<(DEPTH)',
257 '--name', '>(out_newlib64)',
258 '--objdir', '>(objdir_newlib64)',
259 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
260 '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
261 '--gomadir', '<(gomadir)',
262 '--defines=^(defines) >(_defines)',
263 '--link_flags=-B>(tc_lib_dir_newlib64) ^(link_flags) >(_link_flags)',
264 '--source-list=^(source_list_newlib64)',
269 # x86-64 newlib library action
270 ['nlib_target!="" and build_newlib!=0 and enable_x86_64!=0', {
272 'tool_name': 'newlib',
273 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
274 'out_newlib64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nlib_target)',
278 'action_name': 'build newlib x86-64 nlib',
280 'source_list_newlib64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
282 'msvs_cygwin_shell': 0,
283 'description': 'building >(out_newlib64)',
285 '<(DEPTH)/native_client/build/build_nexe.py',
286 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
288 '>@(extra_deps_newlib64)',
289 '^(source_list_newlib64)',
290 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
292 'outputs': ['>(out_newlib64)'],
295 '<(DEPTH)/native_client/build/build_nexe.py',
296 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
299 '--build', 'newlib_nlib',
300 '--root', '<(DEPTH)',
301 '--name', '>(out_newlib64)',
302 '--objdir', '>(objdir_newlib64)',
303 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
304 '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
305 '--gomadir', '<(gomadir)',
306 '--defines=^(defines) >(_defines)',
307 '--link_flags=-B>(tc_lib_dir_newlib64) ^(link_flags) >(_link_flags)',
308 '--source-list=^(source_list_newlib64)',
313 # x86-64 IRT nexe action
314 ['nexe_target!="" and build_irt!=0 and enable_x86_64!=0', {
317 'out_newlib64%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x64.nexe',
318 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
322 'action_name': 'build IRT x86-64 nexe',
324 'source_list_newlib64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
326 'msvs_cygwin_shell': 0,
327 'description': 'building >(out_newlib64)',
329 '<(DEPTH)/native_client/build/build_nexe.py',
330 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
332 '>@(extra_deps_newlib64)',
333 '^(source_list_newlib64)',
334 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
335 '<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
337 'outputs': ['>(out_newlib64)'],
340 '<(DEPTH)/native_client/build/build_nexe.py',
341 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
344 '--build', 'newlib_nexe_pnacl',
345 '--root', '<(DEPTH)',
346 '--name', '>(out_newlib64)',
347 '--objdir', '>(objdir_newlib64)',
348 '--config-name', '<(CONFIGURATION_NAME)',
349 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
350 '--compile_flags=--target=x86_64-nacl -stdlib=libstdc++ ^(compile_flags) >(_compile_flags) -gline-tables-only ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
351 '--gomadir', '<(gomadir)',
352 '--defines=^(defines) >(_defines)',
353 '--link_flags=--target=x86_64-nacl -stdlib=libstdc++ -arch x86-64 --pnacl-allow-translate --pnacl-allow-native -Wn,-Trodata-segment=<(NACL_IRT_DATA_START) -Wn,-Ttext-segment=<(NACL_IRT_TEXT_START) -B>(tc_lib_dir_irt64) ^(link_flags) >(_link_flags)',
354 '--source-list=^(source_list_newlib64)',
355 '--tls-edit=<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
360 # x86-64 IRT library action
361 ['nlib_target!="" and build_irt!=0 and enable_x86_64!=0', {
364 'objdir_newlib64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
365 'out_newlib64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nlib_target)',
369 'action_name': 'build irt x86-64 nlib',
371 'source_list_newlib64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
373 'msvs_cygwin_shell': 0,
374 'description': 'building >(out_newlib64)',
376 '<(DEPTH)/native_client/build/build_nexe.py',
377 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
379 '>@(extra_deps_newlib64)',
380 '^(source_list_newlib64)',
381 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
383 'outputs': ['>(out_newlib64)'],
386 '<(DEPTH)/native_client/build/build_nexe.py',
387 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
390 '--build', 'newlib_nlib_pnacl',
391 '--root', '<(DEPTH)',
392 '--name', '>(out_newlib64)',
393 '--objdir', '>(objdir_newlib64)',
394 '--config-name', '<(CONFIGURATION_NAME)',
395 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
396 '--compile_flags=--target=x86_64-nacl -stdlib=libstdc++ ^(compile_flags) >(_compile_flags) -gline-tables-only ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
397 '--gomadir', '<(gomadir)',
398 '--defines=^(defines) >(_defines)',
399 '--link_flags=--target=x86_64-nacl -stdlib=libstdc++ -B>(tc_lib_dir_irt64) ^(link_flags) >(_link_flags)',
400 '--source-list=^(source_list_newlib64)',
405 # x86-32 newlib nexe action
406 ['nexe_target!="" and build_newlib!=0 and enable_x86_32!=0', {
408 'tool_name': 'newlib',
409 'out_newlib32%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x32.nexe',
410 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
414 'action_name': 'build newlib x86-32 nexe',
416 'source_list_newlib32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
418 'msvs_cygwin_shell': 0,
419 'description': 'building >(out_newlib32)',
421 '<(DEPTH)/native_client/build/build_nexe.py',
422 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
424 '>@(extra_deps_newlib32)',
425 '^(source_list_newlib32)',
426 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
428 'outputs': ['>(out_newlib32)'],
431 '<(DEPTH)/native_client/build/build_nexe.py',
432 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
435 '--build', 'newlib_nexe',
436 '--root', '<(DEPTH)',
437 '--name', '>(out_newlib32)',
438 '--objdir', '>(objdir_newlib32)',
439 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
440 '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
441 '--gomadir', '<(gomadir)',
442 '--defines=^(defines) >(_defines)',
443 '--link_flags=-m32 -B>(tc_lib_dir_newlib32) ^(link_flags) >(_link_flags)',
444 '--source-list=^(source_list_newlib32)',
449 # x86-32 newlib library action
450 ['nlib_target!="" and build_newlib!=0 and enable_x86_32!=0', {
452 'tool_name': 'newlib',
453 'out_newlib32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nlib_target)',
454 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
458 'action_name': 'build newlib x86-32 nlib',
460 'source_list_newlib32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
462 'msvs_cygwin_shell': 0,
463 'description': 'building >(out_newlib32)',
465 '<(DEPTH)/native_client/build/build_nexe.py',
466 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
468 '>@(extra_deps_newlib32)',
469 '^(source_list_newlib32)',
470 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
472 'outputs': ['>(out_newlib32)'],
475 '<(DEPTH)/native_client/build/build_nexe.py',
476 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
479 '--build', 'newlib_nlib',
480 '--root', '<(DEPTH)',
481 '--name', '>(out_newlib32)',
482 '--objdir', '>(objdir_newlib32)',
483 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
484 '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
485 '--gomadir', '<(gomadir)',
486 '--defines=^(defines) >(_defines)',
487 '--link_flags=-m32 -B>(tc_lib_dir_newlib32) ^(link_flags) >(_link_flags)',
488 '--source-list=^(source_list_newlib32)',
493 # x86-32 IRT nexe build
494 ['nexe_target!="" and build_irt!=0 and enable_x86_32!=0', {
497 'out_newlib32%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_x32.nexe',
498 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
502 'action_name': 'build IRT x86-32 nexe',
504 'source_list_newlib32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
506 'msvs_cygwin_shell': 0,
507 'description': 'building >(out_newlib32)',
509 '<(DEPTH)/native_client/build/build_nexe.py',
510 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
512 '>@(extra_deps_newlib32)',
513 '^(source_list_newlib32)',
514 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
515 '<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
517 'outputs': ['>(out_newlib32)'],
520 '<(DEPTH)/native_client/build/build_nexe.py',
521 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
524 '--build', 'newlib_nexe',
525 '--root', '<(DEPTH)',
526 '--name', '>(out_newlib32)',
527 '--objdir', '>(objdir_newlib32)',
528 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
529 '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
530 '--gomadir', '<(gomadir)',
531 '--defines=^(defines) >(_defines)',
532 '--link_flags=-m32 -B>(tc_lib_dir_irt32) -Wl,-Trodata-segment=<(NACL_IRT_DATA_START) -Wl,-Ttext-segment=<(NACL_IRT_TEXT_START) ^(link_flags) >(_link_flags)',
533 '--source-list=^(source_list_newlib32)',
534 '--tls-edit=<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
539 # x86-32 IRT library build
540 ['nlib_target!="" and build_irt!=0 and enable_x86_32!=0', {
543 'out_newlib32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nlib_target)',
544 'objdir_newlib32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
548 'action_name': 'build IRT x86-32 nlib',
550 'source_list_newlib32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
552 'msvs_cygwin_shell': 0,
553 'description': 'building >(out_newlib32)',
555 '<(DEPTH)/native_client/build/build_nexe.py',
556 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
558 '>@(extra_deps_newlib32)',
559 '^(source_list_newlib32)',
560 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_newlib/stamp.prep',
562 'outputs': ['>(out_newlib32)'],
565 '<(DEPTH)/native_client/build/build_nexe.py',
566 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
569 '--build', 'newlib_nlib',
570 '--root', '<(DEPTH)',
571 '--name', '>(out_newlib32)',
572 '--objdir', '>(objdir_newlib32)',
573 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
574 '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
575 '--gomadir', '<(gomadir)',
576 '--defines=^(defines) >(_defines)',
577 '--link_flags=-m32 -B>(tc_lib_dir_irt32) ^(link_flags) >(_link_flags)',
578 '--source-list=^(source_list_newlib32)',
585 }], # end x86 gcc nexe/nlib actions
586 ['target_arch=="arm"', {
588 'target_conditions': [
589 # arm newlib nexe action
590 ['nexe_target!="" and build_newlib!=0', {
592 'tool_name': 'newlib',
593 'out_newlib_arm%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_arm.nexe',
594 'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
598 'action_name': 'build newlib arm nexe',
600 'source_list_newlib_arm%': '^|(<(tool_name)-arm.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
602 'msvs_cygwin_shell': 0,
603 'description': 'building >(out_newlib_arm)',
605 '<(DEPTH)/native_client/build/build_nexe.py',
606 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
608 '>@(extra_deps_newlib_arm)',
609 '^(source_list_newlib_arm)',
610 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib/stamp.prep',
612 'outputs': ['>(out_newlib_arm)'],
615 '<(DEPTH)/native_client/build/build_nexe.py',
616 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
619 '--build', 'newlib_nexe',
620 '--root', '<(DEPTH)',
621 '--name', '>(out_newlib_arm)',
622 '--objdir', '>(objdir_newlib_arm)',
623 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
624 '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
625 '--gomadir', '<(gomadir)',
626 '--defines=^(defines) >(_defines)',
627 '--link_flags=-B>(tc_lib_dir_newlib_arm) ^(link_flags) >(_link_flags)',
628 '--source-list=^(source_list_newlib_arm)',
633 # arm newlib library action
634 ['nlib_target!="" and build_newlib!=0', {
636 'tool_name': 'newlib',
637 'out_newlib_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
638 'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
642 'action_name': 'build newlib arm nlib',
644 'source_list_newlib_arm%': '^|(<(tool_name)-arm.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
646 'msvs_cygwin_shell': 0,
647 'description': 'building >(out_newlib_arm)',
649 '<(DEPTH)/native_client/build/build_nexe.py',
650 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
652 '>@(extra_deps_newlib_arm)',
653 '^(source_list_newlib_arm)',
654 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib/stamp.prep',
656 'outputs': ['>(out_newlib_arm)'],
659 '<(DEPTH)/native_client/build/build_nexe.py',
660 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
663 '--build', 'newlib_nlib',
664 '--root', '<(DEPTH)',
665 '--name', '>(out_newlib_arm)',
666 '--objdir', '>(objdir_newlib_arm)',
667 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
668 '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
669 '--gomadir', '<(gomadir)',
670 '--defines=^(defines) >(_defines)',
671 '--link_flags=-B>(tc_lib_dir_newlib_arm) ^(link_flags) >(_link_flags)',
672 '--source-list=^(source_list_newlib_arm)',
677 # arm irt nexe action
678 ['nexe_target!="" and build_irt!=0', {
681 'out_newlib_arm%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_arm.nexe',
682 'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
686 'action_name': 'build IRT arm nexe',
688 'source_list_newlib_arm%': '^|(<(tool_name)-arm.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
690 'msvs_cygwin_shell': 0,
691 'description': 'building >(out_newlib_arm)',
693 '<(DEPTH)/native_client/build/build_nexe.py',
694 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
696 '>@(extra_deps_newlib_arm)',
697 '^(source_list_newlib_arm)',
698 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib/stamp.prep',
699 '<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
701 'outputs': ['>(out_newlib_arm)'],
704 '<(DEPTH)/native_client/build/build_nexe.py',
705 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
708 '--build', 'newlib_nexe',
709 '--root', '<(DEPTH)',
710 '--name', '>(out_newlib_arm)',
711 '--objdir', '>(objdir_newlib_arm)',
712 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
713 '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
714 '--gomadir', '<(gomadir)',
715 '--defines=^(defines) >(_defines)',
716 '--link_flags=-B>(tc_lib_dir_irt_arm) -Wl,-Trodata-segment=<(NACL_IRT_DATA_START) -Wl,-Ttext-segment=<(NACL_IRT_TEXT_START) ^(link_flags) >(_link_flags)',
717 '--source-list=^(source_list_newlib_arm)',
718 '--tls-edit=<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
723 # arm IRT library action
724 ['nlib_target!="" and build_irt!=0', {
727 'out_newlib_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
728 'objdir_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)-arm/>(_target_name)',
732 'action_name': 'build IRT arm nlib',
734 'source_list_newlib_arm%': '^|(<(tool_name)-arm.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
736 'msvs_cygwin_shell': 0,
737 'description': 'building >(out_newlib_arm)',
739 '<(DEPTH)/native_client/build/build_nexe.py',
740 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
742 '>@(extra_deps_newlib_arm)',
743 '^(source_list_newlib_arm)',
744 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_arm_newlib/stamp.prep',
746 'outputs': ['>(out_newlib_arm)'],
749 '<(DEPTH)/native_client/build/build_nexe.py',
750 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
753 '--build', 'newlib_nlib',
754 '--root', '<(DEPTH)',
755 '--name', '>(out_newlib_arm)',
756 '--objdir', '>(objdir_newlib_arm)',
757 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
758 '--compile_flags=-Wno-unused-local-typedefs -Wno-psabi ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
759 '--gomadir', '<(gomadir)',
760 '--defines=^(defines) >(_defines)',
761 '--link_flags=-B>(tc_lib_dir_irt_arm) ^(link_flags) >(_link_flags)',
762 '--source-list=^(source_list_newlib_arm)',
767 ], # end target_conditions for arm newlib (nexe/nlib)
769 }], # end target_arch = arm
770 ['target_arch=="mipsel"', {
772 'target_conditions': [
773 # mips newlib nexe action
774 ['nexe_target!="" and build_newlib!=0', {
776 'tool_name': 'newlib',
777 'out_newlib_mips%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_mips.nexe',
778 'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_target_name)',
782 'action_name': 'build newlib mips nexe',
784 'source_list_newlib_mips%': '^|(<(tool_name)-mips.>(_target_name).source_list.gypcmd ^(_sources) ^(sources) ^(native_sources))',
786 'msvs_cygwin_shell': 0,
787 'description': 'building >(out_newlib_mips)',
789 '<(DEPTH)/native_client/build/build_nexe.py',
790 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources) >(native_sources))',
792 '>@(extra_deps_newlib_mips)',
793 '^(source_list_newlib_mips)',
794 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.prep',
796 'outputs': ['>(out_newlib_mips)'],
799 '<(DEPTH)/native_client/build/build_nexe.py',
800 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
803 '--build', 'newlib_nexe',
804 '--root', '<(DEPTH)',
805 '--name', '>(out_newlib_mips)',
806 '--objdir', '>(objdir_newlib_mips)',
807 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
808 '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
809 '--gomadir', '<(gomadir)',
810 '--defines=^(defines) >(_defines)',
811 '--link_flags=-arch mips -B>(tc_lib_dir_newlib_mips) ^(link_flags) >(_link_flags)',
812 '--source-list=^(source_list_newlib_mips)',
817 # mips newlib library action
818 ['nlib_target!="" and build_newlib!=0', {
820 'tool_name': 'newlib',
821 'out_newlib_mips%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libmips/>(nlib_target)',
822 'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_target_name)',
826 'action_name': 'build newlib mips nlib',
828 'source_list_newlib_mips%': '^|(<(tool_name)-mips.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
830 'msvs_cygwin_shell': 0,
831 'description': 'building >(out_newlib_mips)',
833 '<(DEPTH)/native_client/build/build_nexe.py',
834 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
836 '>@(extra_deps_newlib_mips)',
837 '^(source_list_newlib_mips)',
838 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.prep',
840 'outputs': ['>(out_newlib_mips)'],
843 '<(DEPTH)/native_client/build/build_nexe.py',
844 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
847 '--build', 'newlib_nlib',
848 '--root', '<(DEPTH)',
849 '--name', '>(out_newlib_mips)',
850 '--objdir', '>(objdir_newlib_mips)',
851 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
852 '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
853 '--gomadir', '<(gomadir)',
854 '--defines=^(defines) >(_defines)',
855 '--link_flags=-B>(tc_lib_dir_newlib_mips) ^(link_flags) >(_link_flags)',
856 '--source-list=^(source_list_newlib_mips)',
861 # mips irt nexe action
862 ['nexe_target!="" and build_irt!=0', {
865 'out_newlib_mips%': '<(PRODUCT_DIR)/>(nexe_target)_newlib_mips.nexe',
866 'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_target_name)',
870 'action_name': 'build IRT mips nexe',
872 'source_list_newlib_mips%': '^|(<(tool_name)-mips.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
874 'msvs_cygwin_shell': 0,
875 'description': 'building >(out_newlib_mips)',
877 '<(DEPTH)/native_client/build/build_nexe.py',
878 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
880 '>@(extra_deps_newlib_mips)',
881 '^(source_list_newlib_mips)',
882 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.prep',
883 '<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
885 'outputs': ['>(out_newlib_mips)'],
888 '<(DEPTH)/native_client/build/build_nexe.py',
889 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
892 '--build', 'newlib_nexe',
893 '--root', '<(DEPTH)',
894 '--name', '>(out_newlib_mips)',
895 '--objdir', '>(objdir_newlib_mips)',
896 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
897 '--compile_flags=-stdlib=libstdc++ ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
898 '--gomadir', '<(gomadir)',
899 '--defines=^(defines) >(_defines)',
900 '--link_flags=-arch mips -stdlib=libstdc++ --pnacl-allow-translate --pnacl-allow-native -Wt,-mtls-use-call --pnacl-disable-abi-check -Wl,-Trodata-segment=<(NACL_IRT_DATA_START) -Wl,-Ttext-segment=<(NACL_IRT_TEXT_START) -B>(tc_lib_dir_irt_mips) ^(link_flags) >(_link_flags)',
901 '--source-list=^(source_list_newlib_mips)',
902 '--tls-edit=<(PRODUCT_DIR)/tls_edit<(EXECUTABLE_SUFFIX)',
907 # mips IRT library action
908 ['nlib_target!="" and build_irt!=0', {
911 'out_newlib_mips%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libmips/>(nlib_target)',
912 'objdir_newlib_mips%': '>(INTERMEDIATE_DIR)/<(tool_name)-mips/>(_target_name)',
916 'action_name': 'build IRT mips nlib',
918 'source_list_newlib_mips%': '^|(<(tool_name)-mips.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
920 'msvs_cygwin_shell': 0,
921 'description': 'building >(out_newlib_mips)',
923 '<(DEPTH)/native_client/build/build_nexe.py',
924 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
926 '>@(extra_deps_newlib_mips)',
927 '^(source_list_newlib_mips)',
928 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.prep',
930 'outputs': ['>(out_newlib_mips)'],
933 '<(DEPTH)/native_client/build/build_nexe.py',
934 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
937 '--build', 'newlib_nlib',
938 '--root', '<(DEPTH)',
939 '--name', '>(out_newlib_mips)',
940 '--objdir', '>(objdir_newlib_mips)',
941 '--include-dirs=>(tc_include_dir_newlib) ^(include_dirs) >(_include_dirs)',
942 '--compile_flags=-stdlib=libstdc++ ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
943 '--gomadir', '<(gomadir)',
944 '--defines=^(defines) >(_defines)',
945 '--link_flags=-stdlib=libstdc++ -B>(tc_lib_dir_irt_mips) ^(link_flags) >(_link_flags)',
946 '--source-list=^(source_list_newlib_mips)',
951 ], # end target_conditions for mips newlib
953 }], # end target_arch = mips
954 ['target_arch=="ia32" or target_arch=="x64"', {
956 # x86-64 glibc nexe action
957 'target_conditions': [
958 ['nexe_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', {
960 'tool_name': 'glibc',
961 'out_glibc64%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x64.nexe',
962 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
966 'action_name': 'build glibc x86-64 nexe',
968 'source_list_glibc64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
970 'msvs_cygwin_shell': 0,
971 'description': 'building >(out_glibc64)',
973 '<(DEPTH)/native_client/build/build_nexe.py',
974 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
976 '>@(extra_deps_glibc64)',
977 '^(source_list_glibc64)',
978 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
980 'outputs': ['>(out_glibc64)'],
983 '<(DEPTH)/native_client/build/build_nexe.py',
984 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
987 '--build', 'glibc_nexe',
988 '--root', '<(DEPTH)',
989 '--name', '>(out_glibc64)',
990 '--objdir', '>(objdir_glibc64)',
991 '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
992 '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
993 '--gomadir', '<(gomadir)',
994 '--defines=^(defines) >(_defines)',
995 '--link_flags=-B>(tc_lib_dir_glibc64) ^(link_flags) >(_link_flags)',
996 '--source-list=^(source_list_glibc64)',
1001 # x86-32 glibc nexe action
1002 ['nexe_target!="" and build_glibc!=0 and enable_x86_32!=0 and disable_glibc==0', {
1004 'tool_name': 'glibc',
1005 'out_glibc32%': '<(PRODUCT_DIR)/>(nexe_target)_glibc_x32.nexe',
1006 'objdir_glibc32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
1010 'action_name': 'build glibc x86-32 nexe',
1012 'source_list_glibc32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1014 'msvs_cygwin_shell': 0,
1015 'description': 'building >(out_glibc32)',
1017 '<(DEPTH)/native_client/build/build_nexe.py',
1018 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1020 '>@(extra_deps_glibc32)',
1021 '^(source_list_glibc32)',
1022 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
1024 'outputs': ['>(out_glibc32)'],
1027 '<(DEPTH)/native_client/build/build_nexe.py',
1028 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1031 '--build', 'glibc_nexe',
1032 '--root', '<(DEPTH)',
1033 '--name', '>(out_glibc32)',
1034 '--objdir', '>(objdir_glibc32)',
1035 '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1036 '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1037 '--gomadir', '<(gomadir)',
1038 '--defines=^(defines) >(_defines)',
1039 '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_link_flags)',
1040 '--source-list=^(source_list_glibc32)',
1045 # x86-64 glibc static library action
1046 ['nlib_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', {
1048 'tool_name': 'glibc',
1049 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64/>(_target_name)',
1050 'out_glibc64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nlib_target)',
1054 'action_name': 'build glibc x86-64 nlib',
1056 'source_list_glibc64%': '^|(<(tool_name)-x86-64.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1058 'msvs_cygwin_shell': 0,
1059 'description': 'building >(out_glibc64)',
1061 '<(DEPTH)/native_client/build/build_nexe.py',
1062 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1064 '>@(extra_deps_glibc64)',
1065 '^(source_list_glibc64)',
1066 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
1068 'outputs': ['>(out_glibc64)'],
1071 '<(DEPTH)/native_client/build/build_nexe.py',
1072 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1075 '--build', 'glibc_nlib',
1076 '--root', '<(DEPTH)',
1077 '--name', '>(out_glibc64)',
1078 '--objdir', '>(objdir_glibc64)',
1079 '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1080 '--compile_flags=-m64 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1081 '--gomadir', '<(gomadir)',
1082 '--defines=^(defines) >(_defines)',
1083 '--link_flags=-B>(tc_lib_dir_glibc64) ^(link_flags) >(_link_flags)',
1084 '--source-list=^(source_list_glibc64)',
1089 # x86-32 glibc static library action
1090 ['nlib_target!="" and build_glibc!=0 and enable_x86_32!=0 and disable_glibc==0', {
1092 'tool_name': 'glibc',
1093 'out_glibc32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nlib_target)',
1094 'objdir_glibc32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32/>(_target_name)',
1098 'action_name': 'build glibc x86-32 nlib',
1100 'source_list_glibc32%': '^|(<(tool_name)-x86-32.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1102 'msvs_cygwin_shell': 0,
1103 'description': 'building >(out_glibc32)',
1105 '<(DEPTH)/native_client/build/build_nexe.py',
1106 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1108 '>@(extra_deps_glibc32)',
1109 '^(source_list_glibc32)',
1110 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
1112 'outputs': ['>(out_glibc32)'],
1115 '<(DEPTH)/native_client/build/build_nexe.py',
1116 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1119 '--build', 'glibc_nlib',
1120 '--root', '<(DEPTH)',
1121 '--name', '>(out_glibc32)',
1122 '--objdir', '>(objdir_glibc32)',
1123 '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1124 '--compile_flags=-m32 ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1125 '--gomadir', '<(gomadir)',
1126 '--defines=^(defines) >(_defines)',
1127 '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_link_flags)',
1128 '--source-list=^(source_list_glibc32)',
1133 # x86-64 glibc shared library action
1134 ['nso_target!="" and build_glibc!=0 and enable_x86_64!=0 and disable_glibc==0', {
1136 'tool_name': 'glibc',
1137 'objdir_glibc64%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-64-so/>(_target_name)',
1138 'out_glibc64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib64/>(nso_target)',
1142 'action_name': 'build glibc x86-64 nso',
1144 'source_list_glibc64%': '^|(<(tool_name)-x86-64-so.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1146 'msvs_cygwin_shell': 0,
1147 'description': 'building >(out_glibc64)',
1149 '<(DEPTH)/native_client/build/build_nexe.py',
1150 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1152 '>@(extra_deps_glibc64)',
1153 '^(source_list_glibc64)',
1154 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
1156 'outputs': ['>(out_glibc64)'],
1159 '<(DEPTH)/native_client/build/build_nexe.py',
1161 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1163 '--build', 'glibc_nso',
1164 '--root', '<(DEPTH)',
1165 '--name', '>(out_glibc64)',
1166 '--objdir', '>(objdir_glibc64)',
1167 '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1168 '--compile_flags=-m64 -fPIC ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1169 '--gomadir', '<(gomadir)',
1170 '--defines=^(defines) >(_defines)',
1171 '--link_flags=-B>(tc_lib_dir_glibc64) ^(link_flags) >(_link_flags)',
1172 '--source-list=^(source_list_glibc64)',
1177 # x86-32 glibc shared library action
1178 ['nso_target!="" and build_glibc!=0 and enable_x86_32!=0 and disable_glibc==0', {
1180 'tool_name': 'glibc',
1181 'out_glibc32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib32/>(nso_target)',
1182 'objdir_glibc32%': '>(INTERMEDIATE_DIR)/<(tool_name)-x86-32-so/>(_target_name)',
1186 'action_name': 'build glibc x86-32 nso',
1188 'source_list_glibc32%': '^|(<(tool_name)-x86-32-so.>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1190 'msvs_cygwin_shell': 0,
1191 'description': 'building >(out_glibc32)',
1193 '<(DEPTH)/native_client/build/build_nexe.py',
1194 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1196 '>@(extra_deps_glibc32)',
1197 '^(source_list_glibc32)',
1198 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_x86_glibc/stamp.prep',
1200 'outputs': ['>(out_glibc32)'],
1203 '<(DEPTH)/native_client/build/build_nexe.py',
1205 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1207 '--build', 'glibc_nso',
1208 '--root', '<(DEPTH)',
1209 '--name', '>(out_glibc32)',
1210 '--objdir', '>(objdir_glibc32)',
1211 '--include-dirs=>(tc_include_dir_glibc) ^(include_dirs) >(_include_dirs)',
1212 '--compile_flags=-m32 -fPIC ^(gcc_compile_flags) >(_gcc_compile_flags) ^(compile_flags) >(_compile_flags)',
1213 '--gomadir', '<(gomadir)',
1214 '--defines=^(defines) >(_defines)',
1215 '--link_flags=-m32 -B>(tc_lib_dir_glibc32) ^(link_flags) >(_link_flags)',
1216 '--source-list=^(source_list_glibc32)',
1221 ], # end target_conditions for glibc (nexe/nlib/nso, x86-32/64)
1223 }], # end target_arch == ia32 or x64
1225 # Common defaults for pnacl targets
1226 'target_defaults': {
1227 'gcc_compile_flags': [],
1228 'pnacl_compile_flags': [],
1230 'disable_pnacl%': 0,
1231 'build_pnacl_newlib': 0,
1232 'pnacl_native_biased': 0,
1235 'extra_deps_pnacl_newlib': [],
1236 'tc_lib_dir_pnacl_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib',
1237 'tc_lib_dir_pnacl_translate' :'<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_translate',
1238 'tc_include_dir_pnacl_newlib': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/include',
1240 '<@(nacl_default_compile_flags)',
1242 'gcc_compile_flags': [
1243 '-fomit-frame-pointer',
1244 # A debugger should be able to unwind IRT call frames. As the IRT is
1245 # compiled with high level of optimizations and without debug info,
1246 # compiler is requested to generate unwind tables explicitly. This
1247 # is the default behavior on x86-64 and when compiling C++ with
1248 # exceptions enabled, the change is for the benefit of x86-32 C.
1249 # These are only required for the IRT but are here for all
1250 # nacl-gcc-compiled binaries because the IRT depends on other libs
1251 '-fasynchronous-unwind-tables',
1253 'pnacl_compile_flags': [
1255 '-Wno-unused-private-field',
1256 '-Wno-char-subscripts',
1257 '-Wno-unused-function',
1260 'target_conditions': [
1261 # pnacl actions for building pexes and translating them
1262 ['nexe_target!="" and disable_pnacl==0 and build_pnacl_newlib!=0 '
1263 'and pnacl_native_biased==0', {
1265 'out_pnacl_newlib_x86_32_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_x32.nexe',
1266 'out_pnacl_newlib_x86_64_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_x64.nexe',
1267 'out_pnacl_newlib_arm_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_arm.nexe',
1268 'out_pnacl_newlib_mips_nexe%': '<(PRODUCT_DIR)/>(nexe_target)_pnacl_newlib_mips.nexe',
1269 'tool_name': 'pnacl_newlib',
1270 'inst_dir': '<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib',
1271 'out_pnacl_newlib%': '<(PRODUCT_DIR)/>(nexe_target)_newlib.pexe',
1272 'objdir_pnacl_newlib%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
1276 'translate_flags': [],
1280 'action_name': 'build newlib pexe',
1282 'source_list_pnacl_newlib%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1284 'msvs_cygwin_shell': 0,
1285 'description': 'building >(out_pnacl_newlib)',
1287 '<(DEPTH)/native_client/build/build_nexe.py',
1288 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1290 '>@(extra_deps_pnacl_newlib)',
1291 '^(source_list_pnacl_newlib)',
1292 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.prep',
1294 'outputs': ['>(out_pnacl_newlib)'],
1297 '<(DEPTH)/native_client/build/build_nexe.py',
1298 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1301 '--build', 'newlib_pexe',
1302 '--root', '<(DEPTH)',
1303 '--name', '>(out_pnacl_newlib)',
1304 '--objdir', '>(objdir_pnacl_newlib)',
1305 '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1306 '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1307 '--gomadir', '<(gomadir)',
1308 '--defines=^(defines) >(_defines)',
1309 '--link_flags=-B<(SHARED_INTERMEDIATE_DIR)/tc_pnacl_newlib/lib ^(link_flags) >(_link_flags)',
1310 '--source-list=^(source_list_pnacl_newlib)',
1313 'target_conditions': [
1314 [ 'enable_x86_32!=0', {
1316 'action_name': 'translate newlib pexe to x86-32 nexe',
1317 'msvs_cygwin_shell': 0,
1318 'description': 'translating >(out_pnacl_newlib_x86_32_nexe)',
1320 # Having this in the input somehow causes devenv warnings
1321 # when building pnacl browser tests.
1322 # '<(DEPTH)/native_client/build/build_nexe.py',
1323 '>(out_pnacl_newlib)',
1325 'outputs': [ '>(out_pnacl_newlib_x86_32_nexe)' ],
1328 '<(DEPTH)/native_client/build/build_nexe.py',
1329 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1331 '--build', 'newlib_translate',
1332 '--root', '<(DEPTH)',
1333 '--name', '>(out_pnacl_newlib_x86_32_nexe)',
1334 '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-x86-32',
1335 '>(out_pnacl_newlib)',
1339 [ 'enable_x86_64!=0', {
1341 'action_name': 'translate newlib pexe to x86-64 nexe',
1342 'msvs_cygwin_shell': 0,
1343 'description': 'translating >(out_pnacl_newlib_x86_64_nexe)',
1345 # Having this in the input somehow causes devenv warnings
1346 # when building pnacl browser tests.
1347 # '<(DEPTH)/native_client/build/build_nexe.py',
1348 '>(out_pnacl_newlib)',
1350 'outputs': [ '>(out_pnacl_newlib_x86_64_nexe)' ],
1353 '<(DEPTH)/native_client/build/build_nexe.py',
1354 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1356 '--build', 'newlib_translate',
1357 '--root', '<(DEPTH)',
1358 '--name', '>(out_pnacl_newlib_x86_64_nexe)',
1359 '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-x86-64',
1360 '>(out_pnacl_newlib)',
1364 [ 'enable_arm!=0', {
1366 'action_name': 'translate newlib pexe to ARM nexe',
1367 'msvs_cygwin_shell': 0,
1368 'description': 'translating >(out_pnacl_newlib_arm_nexe)',
1370 # Having this in the input somehow causes devenv warnings
1371 # when building pnacl browser tests.
1372 # '<(DEPTH)/native_client/build/build_nexe.py',
1373 '>(out_pnacl_newlib)',
1375 'outputs': [ '>(out_pnacl_newlib_arm_nexe)' ],
1378 '<(DEPTH)/native_client/build/build_nexe.py',
1379 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1381 '--build', 'newlib_translate',
1382 '--root', '<(DEPTH)',
1383 '--name', '>(out_pnacl_newlib_arm_nexe)',
1384 '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-arm',
1385 '>(out_pnacl_newlib)',
1389 [ 'enable_mips!=0', {
1391 'action_name': 'translate newlib pexe to MIPS nexe',
1392 'msvs_cygwin_shell': 0,
1393 'description': 'translating >(out_pnacl_newlib_mips_nexe)',
1395 # Having this in the input somehow causes devenv warnings
1396 # when building pnacl browser tests.
1397 # '<(DEPTH)/native_client/build/build_nexe.py',
1398 '>(out_pnacl_newlib)',
1400 'outputs': [ '>(out_pnacl_newlib_mips_nexe)' ],
1403 '<(DEPTH)/native_client/build/build_nexe.py',
1404 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1406 '--build', 'newlib_translate',
1407 '--root', '<(DEPTH)',
1408 '--name', '>(out_pnacl_newlib_mips_nexe)',
1409 '--link_flags=^(translate_flags) >(translate_flags) -Wl,-L>(tc_lib_dir_pnacl_translate)/lib-mips',
1410 '>(out_pnacl_newlib)',
1415 }], # end pnacl actions for building pexes and translating to nexes
1416 # pnacl action for building portable bitcode libraries
1417 ['nlib_target!="" and disable_pnacl==0 and build_pnacl_newlib!=0'
1418 'and pnacl_native_biased==0', {
1420 'tool_name': 'pnacl_newlib',
1421 'objdir_pnacl_newlib%': '>(INTERMEDIATE_DIR)/<(tool_name)-pnacl/>(_target_name)',
1422 'out_pnacl_newlib%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib/>(nlib_target)',
1426 'action_name': 'build newlib plib',
1428 'source_list_pnacl_newlib%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1430 'msvs_cygwin_shell': 0,
1431 'description': 'building >(out_pnacl_newlib)',
1433 '<(DEPTH)/native_client/build/build_nexe.py',
1434 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1436 '>@(extra_deps_pnacl_newlib)',
1437 '^(source_list_pnacl_newlib)',
1438 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.prep',
1440 'outputs': ['>(out_pnacl_newlib)'],
1443 '<(DEPTH)/native_client/build/build_nexe.py',
1444 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1447 '--build', 'newlib_plib',
1448 '--root', '<(DEPTH)',
1449 '--name', '>(out_pnacl_newlib)',
1450 '--objdir', '>(objdir_pnacl_newlib)',
1451 '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1452 '--compile_flags=^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1453 '--gomadir', '<(gomadir)',
1454 '--defines=^(defines) >(_defines)',
1455 '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1456 '--source-list=^(source_list_pnacl_newlib)',
1460 }], # end pnacl actions for bitcode libraries
1461 ], # end target conditions for pnacl pexe/plib
1462 # pnacl actions for building ABI-biased native libraries
1465 ['target_arch=="arm"', {
1466 'target_conditions': [
1467 ['disable_pnacl==0 and pnacl_native_biased==1 and nlib_target!="" and build_pnacl_newlib!=0', {
1469 'tool_name': 'pnacl_newlib_arm',
1470 'out_pnacl_newlib_arm%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/libarm/>(nlib_target)',
1471 'objdir_pnacl_newlib_arm%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
1475 'action_name': 'build newlib arm nlib (via pnacl)',
1477 'source_list_pnacl_newlib_arm%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1479 'msvs_cygwin_shell': 0,
1480 'description': 'building >(out_pnacl_newlib_arm)',
1482 '<(DEPTH)/native_client/build/build_nexe.py',
1483 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1485 '>@(extra_deps_pnacl_newlib)',
1486 '^(source_list_pnacl_newlib_arm)',
1487 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.prep'
1489 'outputs': ['>(out_pnacl_newlib_arm)'],
1492 '<(DEPTH)/native_client/build/build_nexe.py',
1493 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1496 '--build', 'newlib_nlib_pnacl',
1497 '--root', '<(DEPTH)',
1498 '--name', '>(out_pnacl_newlib_arm)',
1499 '--objdir', '>(objdir_pnacl_newlib_arm)',
1500 '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1501 '--compile_flags=--target=armv7-unknown-nacl-gnueabi -mfloat-abi=hard --pnacl-allow-translate -arch arm ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1502 '--gomadir', '<(gomadir)',
1503 '--defines=^(defines) >(_defines)',
1504 '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1505 '--source-list=^(source_list_pnacl_newlib_arm)',
1512 # ia32 or x64 (want to build both for Windows)
1513 ['target_arch=="ia32" or target_arch=="x64"', {
1514 'target_conditions': [
1516 ['enable_x86_64!=0 and disable_pnacl==0 and pnacl_native_biased==1 '
1517 'and nlib_target!="" and build_pnacl_newlib!=0', {
1519 'tool_name': 'pnacl_newlib_x86_64',
1520 'out_pnacl_newlib_x86_64%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib-x86-64/>(nlib_target)',
1521 'objdir_pnacl_newlib_x86_64%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
1525 'action_name': 'build newlib x86-64 nlib (via pnacl)',
1527 'source_list_pnacl_newlib_x86_64%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1529 'msvs_cygwin_shell': 0,
1530 'description': 'building >(out_pnacl_newlib_x86_64)',
1532 '<(DEPTH)/native_client/build/build_nexe.py',
1533 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1535 '>@(extra_deps_pnacl_newlib)',
1536 '^(source_list_pnacl_newlib_x86_64)',
1537 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.prep'
1539 'outputs': ['>(out_pnacl_newlib_x86_64)'],
1542 '<(DEPTH)/native_client/build/build_nexe.py',
1543 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1546 '--build', 'newlib_nlib_pnacl',
1547 '--root', '<(DEPTH)',
1548 '--name', '>(out_pnacl_newlib_x86_64)',
1549 '--objdir', '>(objdir_pnacl_newlib_x86_64)',
1550 '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1551 '--compile_flags=--target=x86_64-unknown-nacl --pnacl-allow-translate -arch x86-64 ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1552 '--gomadir', '<(gomadir)',
1553 '--defines=^(defines) >(_defines)',
1554 '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1555 '--source-list=^(source_list_pnacl_newlib_x86_64)',
1561 ['enable_x86_32!=0 and disable_pnacl==0 and pnacl_native_biased==1 '
1562 'and nlib_target!="" and build_pnacl_newlib!=0', {
1564 'tool_name': 'pnacl_newlib_x86_32',
1565 'out_pnacl_newlib_x86_32%': '<(SHARED_INTERMEDIATE_DIR)/tc_<(tool_name)/lib-x86-32/>(nlib_target)',
1566 'objdir_pnacl_newlib_x86_32%': '>(INTERMEDIATE_DIR)/<(tool_name)/>(_target_name)',
1570 'action_name': 'build newlib x86-32 nlib (via pnacl)',
1572 'source_list_pnacl_newlib_x86_32%': '^|(<(tool_name).>(_target_name).source_list.gypcmd ^(_sources) ^(sources))',
1574 'msvs_cygwin_shell': 0,
1575 'description': 'building >(out_pnacl_newlib_x86_32)',
1577 '<(DEPTH)/native_client/build/build_nexe.py',
1578 '>!@pymod_do_main(>(get_sources) >(sources) >(_sources))',
1580 '>@(extra_deps_pnacl_newlib)',
1581 '^(source_list_pnacl_newlib_x86_32)',
1582 '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/<(OS)_pnacl/stamp.prep'
1584 'outputs': ['>(out_pnacl_newlib_x86_32)'],
1587 '<(DEPTH)/native_client/build/build_nexe.py',
1588 '-t', '<(SHARED_INTERMEDIATE_DIR)/sdk/toolchain/',
1591 '--build', 'newlib_nlib_pnacl',
1592 '--root', '<(DEPTH)',
1593 '--name', '>(out_pnacl_newlib_x86_32)',
1594 '--objdir', '>(objdir_pnacl_newlib_x86_32)',
1595 '--include-dirs=>(tc_include_dir_pnacl_newlib) ^(include_dirs) >(_include_dirs)',
1596 '--compile_flags=--target=i686-unknown-nacl --pnacl-allow-translate -arch x86-32 ^(compile_flags) >(_compile_flags) ^(pnacl_compile_flags) >(_pnacl_compile_flags)',
1597 '--gomadir', '<(gomadir)',
1598 '--defines=^(defines) >(_defines)',
1599 '--link_flags=-B>(tc_lib_dir_pnacl_newlib) ^(link_flags) >(_link_flags)',
1600 '--source-list=^(source_list_pnacl_newlib_x86_32)',
1605 ], # end ia32 or x64
1606 # TODO(jvoung): implement MIPS clause.
1607 # Do they want the IRT ABI to be biased toward --target=mipsel-...-nacl
1608 # or do they want it to be le32 along with -expand-byval, etc.
1609 # (then the shim isn't necessary)?
1610 }], # end pnacl actions for building ABI-biased native libraries
1611 ], # end conditions for pnacl biased nlib