Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Side by Side Diff: native_client_sdk/src/build_tools/build_artifacts.py

Issue 1388503003: [NaCl SDK] Remove newlib toolchain from the SDK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/build_sdk.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 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 """Script to build binary components of the SDK. 6 """Script to build binary components of the SDK.
7 7
8 This script builds binary components of the Native Client SDK, create tarballs 8 This script builds binary components of the Native Client SDK, create tarballs
9 for them, and uploads them to Google Cloud Storage. 9 for them, and uploads them to Google Cloud Storage.
10 10
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 46
47 PLATFORM = getos.GetPlatform() 47 PLATFORM = getos.GetPlatform()
48 TAR = oshelpers.FindExeInPath('tar') 48 TAR = oshelpers.FindExeInPath('tar')
49 options = None 49 options = None
50 all_archives = [] 50 all_archives = []
51 51
52 52
53 # Mapping from toolchain name to the equivalent package_version.py directory 53 # Mapping from toolchain name to the equivalent package_version.py directory
54 # name. 54 # name.
55 TOOLCHAIN_PACKAGE_MAP = { 55 TOOLCHAIN_PACKAGE_MAP = {
56 'newlib': 'nacl_x86_newlib', 56 'glibc_x86': 'nacl_x86_glibc',
57 'bionic': 'nacl_arm_bionic', 57 'glibc_arm': 'nacl_arm_glibc',
58 'arm': 'nacl_arm_newlib',
59 'glibc': 'nacl_x86_glibc',
60 'pnacl': 'pnacl_newlib'} 58 'pnacl': 'pnacl_newlib'}
61 59
62 60
63 def Tar(archive_path, root, files): 61 def Tar(archive_path, root, files):
64 if os.path.exists(TAR): 62 if os.path.exists(TAR):
65 cmd = [TAR] 63 cmd = [TAR]
66 else: 64 else:
67 cmd = [sys.executable, CYGTAR] 65 cmd = [sys.executable, CYGTAR]
68 cmd.extend(['-cjf', archive_path]) 66 cmd.extend(['-cjf', archive_path])
69 cmd.extend(files) 67 cmd.extend(files)
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
323 return os.path.join(tcpath, 'x86_64-nacl', 'lib32') 321 return os.path.join(tcpath, 'x86_64-nacl', 'lib32')
324 elif xarch == 'x86_64': 322 elif xarch == 'x86_64':
325 return os.path.join(tcpath, 'x86_64-nacl', 'lib') 323 return os.path.join(tcpath, 'x86_64-nacl', 'lib')
326 elif xarch == 'arm': 324 elif xarch == 'arm':
327 return os.path.join(tcpath, 'arm-nacl', 'lib') 325 return os.path.join(tcpath, 'arm-nacl', 'lib')
328 326
329 327
330 def GetGypBuiltLib(root, tcname, xarch=None): 328 def GetGypBuiltLib(root, tcname, xarch=None):
331 if tcname == 'pnacl': 329 if tcname == 'pnacl':
332 tcname = 'pnacl_newlib' 330 tcname = 'pnacl_newlib'
331 if tcname in ('glibc_arm', 'glibc_x86'):
332 tcname = 'glibc'
333 if xarch == 'x86_32': 333 if xarch == 'x86_32':
334 xarch = '32' 334 xarch = '32'
335 elif xarch == 'x86_64': 335 elif xarch == 'x86_64':
336 xarch = '64' 336 xarch = '64'
337 elif not xarch: 337 elif not xarch:
338 xarch = '' 338 xarch = ''
339 return os.path.join(root, 'Release', 'gen', 'tc_' + tcname, 'lib' + xarch) 339 return os.path.join(root, 'Release', 'gen', 'tc_' + tcname, 'lib' + xarch)
340 340
341 341
342 def GetGypToolchainLib(root, tcname, xarch): 342 def GetGypToolchainLib(root, tcname, xarch):
343 if xarch == 'arm':
344 toolchain = xarch
345 else:
346 toolchain = tcname
347
348 tcpath = os.path.join(root, 'Release', 'gen', 'sdk', '%s_x86' % PLATFORM, 343 tcpath = os.path.join(root, 'Release', 'gen', 'sdk', '%s_x86' % PLATFORM,
349 TOOLCHAIN_PACKAGE_MAP[toolchain]) 344 TOOLCHAIN_PACKAGE_MAP[tcname])
350 return GetToolchainNaClLib(tcname, tcpath, xarch) 345 return GetToolchainNaClLib(tcname, tcpath, xarch)
351 346
352 347
353 def MakeGypArchives(): 348 def MakeGypArchives():
354 join = os.path.join 349 join = os.path.join
355 gyp_chromium = join(SRC_DIR, 'build', 'gyp_chromium') 350 gyp_chromium = join(SRC_DIR, 'build', 'gyp_chromium')
356 # TODO(binji): gyp_nacl doesn't build properly on Windows anymore; it only 351 # TODO(binji): gyp_nacl doesn't build properly on Windows anymore; it only
357 # can use VS2010, not VS2013 which is now required by the Chromium repo. NaCl 352 # can use VS2010, not VS2013 which is now required by the Chromium repo. NaCl
358 # needs to be updated to perform the same logic as Chromium in detecting VS, 353 # needs to be updated to perform the same logic as Chromium in detecting VS,
359 # which can now exist in the depot_tools directory. 354 # which can now exist in the depot_tools directory.
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 archive.Copy(join(tmpdir, 'Release'), GetToolsFiles()) 390 archive.Copy(join(tmpdir, 'Release'), GetToolsFiles())
396 archive.Copy(join(tmpdir_64, 'Release'), GetTools64Files()) 391 archive.Copy(join(tmpdir_64, 'Release'), GetTools64Files())
397 if PLATFORM == 'linux': 392 if PLATFORM == 'linux':
398 archive.Copy(join(tmpdir_arm, 'Release'), GetToolsArmFiles()) 393 archive.Copy(join(tmpdir_arm, 'Release'), GetToolsArmFiles())
399 # TODO(binji): dump_syms doesn't currently build on Windows. See 394 # TODO(binji): dump_syms doesn't currently build on Windows. See
400 # http://crbug.com/245456 395 # http://crbug.com/245456
401 if PLATFORM != 'win': 396 if PLATFORM != 'win':
402 archive.Copy(join(tmpdir, 'Release'), breakpad_targets) 397 archive.Copy(join(tmpdir, 'Release'), breakpad_targets)
403 archive.Tar() 398 archive.Tar()
404 399
405 # newlib x86 libs archives
406 for arch in ('x86_32', 'x86_64'):
407 archive = Archive('newlib_%s_libs' % arch)
408 archive.Copy(GetGypBuiltLib(tmpdir, 'newlib', arch),
409 GetNewlibToolchainLibs())
410 archive.Copy(GetGypToolchainLib(tmpdir, 'newlib', arch), 'crt1.o')
411 archive.Tar()
412
413 # newlib arm libs archive
414 archive = Archive('newlib_arm_libs')
415 archive.Copy(GetGypBuiltLib(tmpdir_arm, 'newlib', 'arm'),
416 GetNewlibToolchainLibs())
417 archive.Copy(GetGypToolchainLib(tmpdir_arm, 'newlib', 'arm'), 'crt1.o')
418 archive.Tar()
419
420 # glibc x86 libs archives 400 # glibc x86 libs archives
421 for arch in ('x86_32', 'x86_64'): 401 for arch in ('x86_32', 'x86_64'):
422 archive = Archive('glibc_%s_libs' % arch) 402 archive = Archive('glibc_%s_libs' % arch)
423 archive.Copy(GetGypBuiltLib(tmpdir, 'glibc', arch), GetGlibcToolchainLibs()) 403 archive.Copy(GetGypBuiltLib(tmpdir, 'glibc', arch), GetGlibcToolchainLibs())
424 archive.Copy(GetGypToolchainLib(tmpdir, 'glibc', arch), 'crt1.o') 404 archive.Copy(GetGypToolchainLib(tmpdir, 'glibc', arch), 'crt1.o')
425 archive.Tar() 405 archive.Tar()
426 406
427 # pnacl libs archive 407 # pnacl libs archive
428 archive = Archive('pnacl_libs') 408 archive = Archive('pnacl_libs')
429 archive.Copy(GetGypBuiltLib(tmpdir, 'pnacl'), GetPNaClToolchainLibs()) 409 archive.Copy(GetGypBuiltLib(tmpdir, 'pnacl'), GetPNaClToolchainLibs())
430 archive.Tar() 410 archive.Tar()
431 411
432 if PLATFORM == 'linux':
433 # bionic arm libs archive (use newlib-built files)
434 archive = Archive('bionic_arm_libs')
435 archive.Copy(GetGypBuiltLib(tmpdir_arm, 'newlib', 'arm'),
436 GetBionicToolchainLibs())
437 archive.Copy(GetGypToolchainLib(tmpdir_arm, 'newlib', 'arm'), 'crt1.o')
438 archive.Tar()
439
440 # Destroy the temporary directories 412 # Destroy the temporary directories
441 tmpdir_obj.Destroy() 413 tmpdir_obj.Destroy()
442 tmpdirarm_obj.Destroy() 414 tmpdirarm_obj.Destroy()
443 tmpdir64_obj.Destroy() 415 tmpdir64_obj.Destroy()
444 416
445 417
446 def MakePNaClArchives(): 418 def MakePNaClArchives():
447 join = os.path.join 419 join = os.path.join
448 gyp_chromium = join(SRC_DIR, 'build', 'gyp_chromium') 420 gyp_chromium = join(SRC_DIR, 'build', 'gyp_chromium')
449 pnacl_irt_shim_gyp = join(SRC_DIR, 'ppapi', 'native_client', 'src', 421 pnacl_irt_shim_gyp = join(SRC_DIR, 'ppapi', 'native_client', 'src',
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 476
505 def MakeToolchainHeaderArchives(): 477 def MakeToolchainHeaderArchives():
506 archive = Archive('newlib_headers') 478 archive = Archive('newlib_headers')
507 archive.Copy(SRC_DIR, GetNewlibHeaders()) 479 archive.Copy(SRC_DIR, GetNewlibHeaders())
508 archive.Tar() 480 archive.Tar()
509 481
510 archive = Archive('glibc_headers') 482 archive = Archive('glibc_headers')
511 archive.Copy(SRC_DIR, GetGlibcHeaders()) 483 archive.Copy(SRC_DIR, GetGlibcHeaders())
512 archive.Tar() 484 archive.Tar()
513 485
514 if PLATFORM == 'linux':
515 archive = Archive('bionic_headers')
516 archive.Copy(SRC_DIR, GetBionicHeaders())
517 archive.Tar()
518
519 486
520 def MakePepperArchive(): 487 def MakePepperArchive():
521 archive = Archive('ppapi') 488 archive = Archive('ppapi')
522 archive.Copy(os.path.join(SRC_DIR, 'ppapi'), ['c', 'cpp', 'lib', 'utility']) 489 archive.Copy(os.path.join(SRC_DIR, 'ppapi'), ['c', 'cpp', 'lib', 'utility'])
523 archive.Tar() 490 archive.Tar()
524 491
525 492
526 def UploadArchives(): 493 def UploadArchives():
527 major_version = build_version.ChromeMajorVersion() 494 major_version = build_version.ChromeMajorVersion()
528 chrome_revision = build_version.ChromeRevision() 495 chrome_revision = build_version.ChromeRevision()
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
560 parser.add_argument('--mac-sdk', 527 parser.add_argument('--mac-sdk',
561 help='Set the mac-sdk (e.g. 10.6) to use when building with ninja.') 528 help='Set the mac-sdk (e.g. 10.6) to use when building with ninja.')
562 parser.add_argument('--no-arm-trusted', action='store_true', 529 parser.add_argument('--no-arm-trusted', action='store_true',
563 help='Disable building of ARM trusted components (sel_ldr, etc).') 530 help='Disable building of ARM trusted components (sel_ldr, etc).')
564 parser.add_argument('--upload', action='store_true', 531 parser.add_argument('--upload', action='store_true',
565 help='Upload tarballs to GCS.') 532 help='Upload tarballs to GCS.')
566 533
567 global options 534 global options
568 options = parser.parse_args(args) 535 options = parser.parse_args(args)
569 536
570 toolchains = ['pnacl', 'newlib', 'glibc', 'arm'] 537 toolchains = ['pnacl', 'glibc_x86', 'glibc_arm']
571 if PLATFORM == 'linux':
572 toolchains.append('bionic')
573 538
574 MakeVersionJson() 539 MakeVersionJson()
575 for tc in toolchains: 540 for tc in toolchains:
576 MakeToolchainArchive(tc) 541 MakeToolchainArchive(tc)
577 MakeGypArchives() 542 MakeGypArchives()
578 MakePNaClArchives() 543 MakePNaClArchives()
579 MakeToolchainHeaderArchives() 544 MakeToolchainHeaderArchives()
580 MakePepperArchive() 545 MakePepperArchive()
581 if options.upload: 546 if options.upload:
582 UploadArchives() 547 UploadArchives()
583 548
584 return 0 549 return 0
585 550
586 if __name__ == '__main__': 551 if __name__ == '__main__':
587 try: 552 try:
588 sys.exit(main(sys.argv[1:])) 553 sys.exit(main(sys.argv[1:]))
589 except KeyboardInterrupt: 554 except KeyboardInterrupt:
590 buildbot_common.ErrorExit('build_artifacts: interrupted') 555 buildbot_common.ErrorExit('build_artifacts: interrupted')
OLDNEW
« no previous file with comments | « no previous file | native_client_sdk/src/build_tools/build_sdk.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698