OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 """Entry point for both build and try bots. | 6 """Entry point for both build and try bots. |
7 | 7 |
8 This script is invoked from XXX, usually without arguments | 8 This script is invoked from XXX, usually without arguments |
9 to package an SDK. It automatically determines whether | 9 to package an SDK. It automatically determines whether |
10 this SDK is for mac, win, linux. | 10 this SDK is for mac, win, linux. |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
361 tc_name = 'newlib' | 361 tc_name = 'newlib' |
362 | 362 |
363 InstallFiles(SRC_DIR, tc_dst_inc, NACL_HEADER_MAP[tc_name]) | 363 InstallFiles(SRC_DIR, tc_dst_inc, NACL_HEADER_MAP[tc_name]) |
364 | 364 |
365 | 365 |
366 def MakeNinjaRelPath(path): | 366 def MakeNinjaRelPath(path): |
367 return os.path.join(os.path.relpath(OUT_DIR, SRC_DIR), path) | 367 return os.path.join(os.path.relpath(OUT_DIR, SRC_DIR), path) |
368 | 368 |
369 | 369 |
370 TOOLCHAIN_LIBS = { | 370 TOOLCHAIN_LIBS = { |
| 371 'bionic' : [ |
| 372 'libminidump_generator.a', |
| 373 'libnacl.a', |
| 374 'libnacl_dyncode.a', |
| 375 'libnacl_exception.a', |
| 376 'libnacl_list_mappings.a', |
| 377 'libppapi.a', |
| 378 'libppapi_stub.a', |
| 379 ], |
371 'newlib' : [ | 380 'newlib' : [ |
372 'crti.o', | 381 'crti.o', |
373 'crtn.o', | 382 'crtn.o', |
374 'libminidump_generator.a', | 383 'libminidump_generator.a', |
375 'libnacl.a', | 384 'libnacl.a', |
376 'libnacl_dyncode.a', | 385 'libnacl_dyncode.a', |
377 'libnacl_exception.a', | 386 'libnacl_exception.a', |
378 'libnacl_list_mappings.a', | 387 'libnacl_list_mappings.a', |
379 'libnosys.a', | 388 'libnosys.a', |
380 'libppapi.a', | 389 'libppapi.a', |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 buildbot_common.MakeDir(os.path.join(pepperdir, 'tools')) | 450 buildbot_common.MakeDir(os.path.join(pepperdir, 'tools')) |
442 | 451 |
443 # Add .exe extensions to all windows tools | 452 # Add .exe extensions to all windows tools |
444 for pair in tools_files: | 453 for pair in tools_files: |
445 if platform == 'win' and not pair[0].endswith('.nexe'): | 454 if platform == 'win' and not pair[0].endswith('.nexe'): |
446 pair[0] += '.exe' | 455 pair[0] += '.exe' |
447 pair[1] += '.exe' | 456 pair[1] += '.exe' |
448 | 457 |
449 InstallFiles(ninja_out_dir, os.path.join(pepperdir, 'tools'), tools_files) | 458 InstallFiles(ninja_out_dir, os.path.join(pepperdir, 'tools'), tools_files) |
450 | 459 |
| 460 # Add ARM binaries |
| 461 if platform == 'linux': |
| 462 tools_files = [ |
| 463 ['irt_core_newlib_arm.nexe', 'irt_core_arm.nexe'], |
| 464 ['irt_core_newlib_arm.nexe', 'irt_core_arm.nexe'], |
| 465 ['sel_ldr', 'sel_ldr_arm'], |
| 466 ['nacl_helper_bootstrap', 'nacl_helper_bootstrap_arm'] |
| 467 ] |
| 468 ninja_out_dir = os.path.join(OUT_DIR, build_dir + '-arm', 'Release') |
| 469 InstallFiles(ninja_out_dir, os.path.join(pepperdir, 'tools'), tools_files) |
| 470 |
451 for tc in set(toolchains) & set(['newlib', 'glibc', 'pnacl']): | 471 for tc in set(toolchains) & set(['newlib', 'glibc', 'pnacl']): |
452 if tc == 'pnacl': | 472 if tc == 'pnacl': |
453 xarches = (None,) | 473 xarches = (None,) |
454 else: | 474 else: |
455 xarches = ('arm', '32', '64') | 475 xarches = ('arm', '32', '64') |
456 | 476 |
457 for xarch in xarches: | 477 for xarch in xarches: |
458 if tc == 'glibc' and xarch == 'arm': | 478 if tc == 'glibc' and xarch == 'arm': |
459 continue | 479 continue |
460 | 480 |
461 src_dir = GetGypBuiltLib(tc, xarch) | 481 src_dir = GetGypBuiltLib(tc, xarch) |
462 dst_dir = GetOutputToolchainLib(pepperdir, tc, xarch) | 482 dst_dir = GetOutputToolchainLib(pepperdir, tc, xarch) |
463 InstallFiles(src_dir, dst_dir, TOOLCHAIN_LIBS[tc]) | 483 InstallFiles(src_dir, dst_dir, TOOLCHAIN_LIBS[tc]) |
464 | 484 |
| 485 # Copy ARM newlib components to bionic |
| 486 if tc == 'newlib' and xarch == 'arm' and 'bionic' in toolchains: |
| 487 bionic_dir = GetOutputToolchainLib(pepperdir, 'bionic', xarch) |
| 488 InstallFiles(src_dir, bionic_dir, TOOLCHAIN_LIBS['bionic']) |
| 489 |
465 if tc != 'pnacl': | 490 if tc != 'pnacl': |
466 src_dir = GetGypToolchainLib(tc, xarch) | 491 src_dir = GetGypToolchainLib(tc, xarch) |
467 InstallFiles(src_dir, dst_dir, ['crt1.o']) | 492 InstallFiles(src_dir, dst_dir, ['crt1.o']) |
468 | 493 |
469 | 494 |
470 def GypNinjaBuild_NaCl(rel_out_dir): | 495 def GypNinjaBuild_NaCl(rel_out_dir): |
471 gyp_py = os.path.join(NACL_DIR, 'build', 'gyp_nacl') | 496 gyp_py = os.path.join(NACL_DIR, 'build', 'gyp_nacl') |
472 nacl_core_sdk_gyp = os.path.join(NACL_DIR, 'build', 'nacl_core_sdk.gyp') | 497 nacl_core_sdk_gyp = os.path.join(NACL_DIR, 'build', 'nacl_core_sdk.gyp') |
473 all_gyp = os.path.join(NACL_DIR, 'build', 'all.gyp') | 498 all_gyp = os.path.join(NACL_DIR, 'build', 'all.gyp') |
474 | 499 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
883 buildbot_common.BuildStep('Build GoNaCl AppEngine Projects') | 908 buildbot_common.BuildStep('Build GoNaCl AppEngine Projects') |
884 cmd = ['make', 'upload', 'REVISION=%s' % chrome_revision] | 909 cmd = ['make', 'upload', 'REVISION=%s' % chrome_revision] |
885 env = dict(os.environ) | 910 env = dict(os.environ) |
886 env['NACL_SDK_ROOT'] = pepperdir | 911 env['NACL_SDK_ROOT'] = pepperdir |
887 env['NACLPORTS_NO_ANNOTATE'] = "1" | 912 env['NACLPORTS_NO_ANNOTATE'] = "1" |
888 buildbot_common.Run(cmd, env=env, cwd=GONACL_APPENGINE_SRC_DIR) | 913 buildbot_common.Run(cmd, env=env, cwd=GONACL_APPENGINE_SRC_DIR) |
889 | 914 |
890 | 915 |
891 def main(args): | 916 def main(args): |
892 parser = optparse.OptionParser(description=__doc__) | 917 parser = optparse.OptionParser(description=__doc__) |
| 918 parser.add_option('--qemu', help='Add qemu for ARM.', |
| 919 action='store_true') |
893 parser.add_option('--bionic', help='Add bionic build.', | 920 parser.add_option('--bionic', help='Add bionic build.', |
894 action='store_true') | 921 action='store_true') |
895 parser.add_option('--tar', help='Force the tar step.', | 922 parser.add_option('--tar', help='Force the tar step.', |
896 action='store_true') | 923 action='store_true') |
897 parser.add_option('--archive', help='Force the archive step.', | 924 parser.add_option('--archive', help='Force the archive step.', |
898 action='store_true') | 925 action='store_true') |
899 parser.add_option('--gyp', | 926 parser.add_option('--gyp', |
900 help='Use gyp to build examples/libraries/Makefiles.', | 927 help='Use gyp to build examples/libraries/Makefiles.', |
901 action='store_true') | 928 action='store_true') |
902 parser.add_option('--release', help='PPAPI release version.', | 929 parser.add_option('--release', help='PPAPI release version.', |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 if options.build_ports and getos.GetPlatform() == 'linux': | 1015 if options.build_ports and getos.GetPlatform() == 'linux': |
989 ports_tarfile = os.path.join(OUT_DIR, 'naclports.tar.bz2') | 1016 ports_tarfile = os.path.join(OUT_DIR, 'naclports.tar.bz2') |
990 BuildStepSyncNaClPorts() | 1017 BuildStepSyncNaClPorts() |
991 BuildStepBuildNaClPorts(pepper_ver, pepperdir) | 1018 BuildStepBuildNaClPorts(pepper_ver, pepperdir) |
992 if options.tar: | 1019 if options.tar: |
993 BuildStepTarNaClPorts(pepper_ver, ports_tarfile) | 1020 BuildStepTarNaClPorts(pepper_ver, ports_tarfile) |
994 | 1021 |
995 if options.build_app_engine and getos.GetPlatform() == 'linux': | 1022 if options.build_app_engine and getos.GetPlatform() == 'linux': |
996 BuildStepBuildAppEngine(pepperdir, chrome_revision) | 1023 BuildStepBuildAppEngine(pepperdir, chrome_revision) |
997 | 1024 |
| 1025 if options.qemu: |
| 1026 qemudir = os.path.join(NACL_DIR, 'toolchain', 'linux_arm-trusted') |
| 1027 oshelpers.Copy(['-r', qemudir, pepperdir]) |
| 1028 |
998 # Archive on non-trybots. | 1029 # Archive on non-trybots. |
999 if options.archive: | 1030 if options.archive: |
1000 BuildStepArchiveBundle('build', pepper_ver, chrome_revision, nacl_revision, | 1031 BuildStepArchiveBundle('build', pepper_ver, chrome_revision, nacl_revision, |
1001 tarfile) | 1032 tarfile) |
1002 if options.build_ports and getos.GetPlatform() == 'linux': | 1033 if options.build_ports and getos.GetPlatform() == 'linux': |
1003 BuildStepArchiveBundle('naclports', pepper_ver, chrome_revision, | 1034 BuildStepArchiveBundle('naclports', pepper_ver, chrome_revision, |
1004 nacl_revision, ports_tarfile) | 1035 nacl_revision, ports_tarfile) |
1005 BuildStepArchiveSDKTools() | 1036 BuildStepArchiveSDKTools() |
1006 | 1037 |
1007 return 0 | 1038 return 0 |
1008 | 1039 |
1009 | 1040 |
1010 if __name__ == '__main__': | 1041 if __name__ == '__main__': |
1011 try: | 1042 try: |
1012 sys.exit(main(sys.argv)) | 1043 sys.exit(main(sys.argv)) |
1013 except KeyboardInterrupt: | 1044 except KeyboardInterrupt: |
1014 buildbot_common.ErrorExit('build_sdk: interrupted') | 1045 buildbot_common.ErrorExit('build_sdk: interrupted') |
| 1046 |
OLD | NEW |