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

Side by Side Diff: tools/clang/scripts/update.py

Issue 2180543002: Roll clang 274369:274369. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 | « tools/clang/scripts/package.py ('k') | no next file » | 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 (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 """This script is used to download prebuilt clang binaries. 6 """This script is used to download prebuilt clang binaries.
7 7
8 It is also used by package.py to build the prebuilt clang binaries.""" 8 It is also used by package.py to build the prebuilt clang binaries."""
9 9
10 import argparse 10 import argparse
(...skipping 16 matching lines...) Expand all
27 # Do NOT CHANGE this if you don't know what you're doing -- see 27 # Do NOT CHANGE this if you don't know what you're doing -- see
28 # https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang.md 28 # https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang.md
29 # Reverting problematic clang rolls is safe, though. 29 # Reverting problematic clang rolls is safe, though.
30 CLANG_REVISION = '274369' 30 CLANG_REVISION = '274369'
31 31
32 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ 32 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ
33 if use_head_revision: 33 if use_head_revision:
34 CLANG_REVISION = 'HEAD' 34 CLANG_REVISION = 'HEAD'
35 35
36 # This is incremented when pushing a new build of Clang at the same revision. 36 # This is incremented when pushing a new build of Clang at the same revision.
37 CLANG_SUB_REVISION=1 37 CLANG_SUB_REVISION=6
38 38
39 PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION) 39 PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION)
40 40
41 # Path constants. (All of these should be absolute paths.) 41 # Path constants. (All of these should be absolute paths.)
42 THIS_DIR = os.path.abspath(os.path.dirname(__file__)) 42 THIS_DIR = os.path.abspath(os.path.dirname(__file__))
43 CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..')) 43 CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..'))
44 THIRD_PARTY_DIR = os.path.join(CHROMIUM_DIR, 'third_party') 44 THIRD_PARTY_DIR = os.path.join(CHROMIUM_DIR, 'third_party')
45 LLVM_DIR = os.path.join(THIRD_PARTY_DIR, 'llvm') 45 LLVM_DIR = os.path.join(THIRD_PARTY_DIR, 'llvm')
46 LLVM_BOOTSTRAP_DIR = os.path.join(THIRD_PARTY_DIR, 'llvm-bootstrap') 46 LLVM_BOOTSTRAP_DIR = os.path.join(THIRD_PARTY_DIR, 'llvm-bootstrap')
47 LLVM_BOOTSTRAP_INSTALL_DIR = os.path.join(THIRD_PARTY_DIR, 47 LLVM_BOOTSTRAP_INSTALL_DIR = os.path.join(THIRD_PARTY_DIR,
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after
430 return 1 430 return 1
431 431
432 DownloadHostGcc(args) 432 DownloadHostGcc(args)
433 AddCMakeToPath() 433 AddCMakeToPath()
434 AddGnuWinToPath() 434 AddGnuWinToPath()
435 435
436 DeleteChromeToolsShim() 436 DeleteChromeToolsShim()
437 437
438 Checkout('LLVM', LLVM_REPO_URL + '/llvm/trunk', LLVM_DIR) 438 Checkout('LLVM', LLVM_REPO_URL + '/llvm/trunk', LLVM_DIR)
439 Checkout('Clang', LLVM_REPO_URL + '/cfe/trunk', CLANG_DIR) 439 Checkout('Clang', LLVM_REPO_URL + '/cfe/trunk', CLANG_DIR)
440 if sys.platform == 'win32' or use_head_revision: 440 Checkout('LLD', LLVM_REPO_URL + '/lld/trunk', LLD_DIR)
441 Checkout('LLD', LLVM_REPO_URL + '/lld/trunk', LLD_DIR)
442 Checkout('compiler-rt', LLVM_REPO_URL + '/compiler-rt/trunk', COMPILER_RT_DIR) 441 Checkout('compiler-rt', LLVM_REPO_URL + '/compiler-rt/trunk', COMPILER_RT_DIR)
443 if sys.platform == 'darwin': 442 if sys.platform == 'darwin':
444 # clang needs a libc++ checkout, else -stdlib=libc++ won't find includes 443 # clang needs a libc++ checkout, else -stdlib=libc++ won't find includes
445 # (i.e. this is needed for bootstrap builds). 444 # (i.e. this is needed for bootstrap builds).
446 Checkout('libcxx', LLVM_REPO_URL + '/libcxx/trunk', LIBCXX_DIR) 445 Checkout('libcxx', LLVM_REPO_URL + '/libcxx/trunk', LIBCXX_DIR)
447 # We used to check out libcxxabi on OS X; we no longer need that. 446 # We used to check out libcxxabi on OS X; we no longer need that.
448 if os.path.exists(LIBCXXABI_DIR): 447 if os.path.exists(LIBCXXABI_DIR):
449 RmTree(LIBCXXABI_DIR) 448 RmTree(LIBCXXABI_DIR)
450 449
451 cc, cxx = None, None 450 cc, cxx = None, None
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
522 521
523 if args.gcc_toolchain: 522 if args.gcc_toolchain:
524 # Tell the bootstrap compiler to use a specific gcc prefix to search 523 # Tell the bootstrap compiler to use a specific gcc prefix to search
525 # for standard library headers and shared object files. 524 # for standard library headers and shared object files.
526 cflags = ['--gcc-toolchain=' + args.gcc_toolchain] 525 cflags = ['--gcc-toolchain=' + args.gcc_toolchain]
527 cxxflags = ['--gcc-toolchain=' + args.gcc_toolchain] 526 cxxflags = ['--gcc-toolchain=' + args.gcc_toolchain]
528 print 'Building final compiler' 527 print 'Building final compiler'
529 528
530 # Build LLVM gold plugin with LTO. That speeds up the linker by ~10%. 529 # Build LLVM gold plugin with LTO. That speeds up the linker by ~10%.
531 # We only use LTO for Linux now. 530 # We only use LTO for Linux now.
532 if args.bootstrap and args.lto_gold_plugin: 531 if args.bootstrap and args.lto:
533 print 'Building LTO LLVM Gold plugin' 532 print 'Building LTO LLVM Gold plugin'
534 if os.path.exists(LLVM_LTO_GOLD_PLUGIN_DIR): 533 if os.path.exists(LLVM_LTO_GOLD_PLUGIN_DIR):
535 RmTree(LLVM_LTO_GOLD_PLUGIN_DIR) 534 RmTree(LLVM_LTO_GOLD_PLUGIN_DIR)
536 EnsureDirExists(LLVM_LTO_GOLD_PLUGIN_DIR) 535 EnsureDirExists(LLVM_LTO_GOLD_PLUGIN_DIR)
537 os.chdir(LLVM_LTO_GOLD_PLUGIN_DIR) 536 os.chdir(LLVM_LTO_GOLD_PLUGIN_DIR)
538 537
539 # Create a symlink to LLVMgold.so build in the previous step so that ar
540 # and ranlib could find it while linking LLVMgold.so with LTO.
541 EnsureDirExists(BFD_PLUGINS_DIR)
542 RunCommand(['ln', '-sf',
543 os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'lib', 'LLVMgold.so'),
544 os.path.join(BFD_PLUGINS_DIR, 'LLVMgold.so')])
545
546 lto_cflags = ['-flto'] 538 lto_cflags = ['-flto']
547 lto_ldflags = ['-fuse-ld=gold'] 539 lto_cxxflags = ['-flto']
540 lto_ldflags = ['-fuse-ld=lld']
548 if args.gcc_toolchain: 541 if args.gcc_toolchain:
549 # Tell the bootstrap compiler to use a specific gcc prefix to search 542 # Tell the bootstrap compiler to use a specific gcc prefix to search
550 # for standard library headers and shared object files. 543 # for standard library headers and shared object files.
551 lto_cflags += ['--gcc-toolchain=' + args.gcc_toolchain] 544 lto_cflags += ['--gcc-toolchain=' + args.gcc_toolchain]
552 lto_cmake_args = base_cmake_args + [ 545 lto_cmake_args = base_cmake_args + [
553 '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir, 546 '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir,
554 '-DCMAKE_C_COMPILER=' + cc, 547 '-DCMAKE_C_COMPILER=' + cc,
555 '-DCMAKE_CXX_COMPILER=' + cxx, 548 '-DCMAKE_CXX_COMPILER=' + cxx,
556 '-DCMAKE_C_FLAGS=' + ' '.join(lto_cflags), 549 '-DCMAKE_C_FLAGS=' + ' '.join(lto_cflags),
557 '-DCMAKE_CXX_FLAGS=' + ' '.join(lto_cflags), 550 '-DCMAKE_CXX_FLAGS=' + ' '.join(lto_cxxflags),
558 '-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(lto_ldflags), 551 '-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(lto_ldflags),
559 '-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(lto_ldflags), 552 '-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(lto_ldflags),
560 '-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(lto_ldflags)] 553 '-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(lto_ldflags)]
561 554
562 # We need to use the proper binutils which support LLVM Gold plugin. 555 # We need to use the proper binutils which support LTO.
563 lto_env = os.environ.copy() 556 lto_env = os.environ.copy()
564 lto_env['PATH'] = BINUTILS_BIN_DIR + os.pathsep + lto_env.get('PATH', '') 557 lto_env['PATH'] = BINUTILS_BIN_DIR + os.pathsep + lto_env.get('PATH', '')
565
566 RmCmakeCache('.') 558 RmCmakeCache('.')
567 RunCommand(['cmake'] + lto_cmake_args + [LLVM_DIR], env=lto_env) 559 RunCommand(['cmake'] + lto_cmake_args + [LLVM_DIR], env=lto_env)
568 RunCommand(['ninja', 'LLVMgold'], env=lto_env) 560 RunCommand(['ninja', 'LLVMgold'], env=lto_env)
569 561
570 562
571 # LLVM uses C++11 starting in llvm 3.5. On Linux, this means libstdc++4.7+ is 563 # LLVM uses C++11 starting in llvm 3.5. On Linux, this means libstdc++4.7+ is
572 # needed, on OS X it requires libc++. clang only automatically links to libc++ 564 # needed, on OS X it requires libc++. clang only automatically links to libc++
573 # when targeting OS X 10.9+, so add stdlib=libc++ explicitly so clang can run 565 # when targeting OS X 10.9+, so add stdlib=libc++ explicitly so clang can run
574 # on OS X versions as old as 10.7. 566 # on OS X versions as old as 10.7.
575 deployment_target = '' 567 deployment_target = ''
(...skipping 14 matching lines...) Expand all
590 # Build clang. 582 # Build clang.
591 583
592 # If building at head, define a macro that plugins can use for #ifdefing 584 # If building at head, define a macro that plugins can use for #ifdefing
593 # out code that builds at head, but not at CLANG_REVISION or vice versa. 585 # out code that builds at head, but not at CLANG_REVISION or vice versa.
594 if use_head_revision: 586 if use_head_revision:
595 cflags += ['-DLLVM_FORCE_HEAD_REVISION'] 587 cflags += ['-DLLVM_FORCE_HEAD_REVISION']
596 cxxflags += ['-DLLVM_FORCE_HEAD_REVISION'] 588 cxxflags += ['-DLLVM_FORCE_HEAD_REVISION']
597 589
598 CreateChromeToolsShim() 590 CreateChromeToolsShim()
599 591
600 deployment_env = None 592 llvm_build_cflags = cflags
593 llvm_build_cxxflags = cxxflags
594 llvm_build_ldflags = ldflags
595 llvm_build_env = None
596 if sys.platform != 'win32':
597 # On Windows, the line below might add some Unicode entries
598 # and that will fail if passed into popen. See
599 # http://stackoverflow.com/questions/12253014/why-does-popen-fail-on-windows -if-the-env-parameter-contains-a-unicode-object
600 # Since we don't need to add anything into environment on Windows,
601 # just workaround this, until we moved into Python 3, where it's
602 # supposedly fixed.
603 llvm_build_env = os.environ.copy()
601 if deployment_target: 604 if deployment_target:
602 deployment_env = os.environ.copy() 605 llvm_build_env['MACOSX_DEPLOYMENT_TARGET'] = deployment_target
603 deployment_env['MACOSX_DEPLOYMENT_TARGET'] = deployment_target 606 if args.lto:
607 # Put proper binutils for building with LTO
608 llvm_build_env['PATH'] = (BINUTILS_BIN_DIR + os.pathsep +
609 llvm_build_env.get('PATH', ''))
610 llvm_build_cflags += ['-flto']
611 llvm_build_cxxflags += ['-flto']
612 llvm_build_ldflags += ['-fuse-ld=lld']
604 613
605 cmake_args = [] 614 cmake_args = []
606 # TODO(thakis): Unconditionally append this to base_cmake_args instead once 615 # TODO(thakis): Unconditionally append this to base_cmake_args instead once
607 # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698) 616 # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698)
608 cc_args = base_cmake_args if sys.platform != 'win32' else cmake_args 617 cc_args = base_cmake_args if sys.platform != 'win32' else cmake_args
609 if cc is not None: cc_args.append('-DCMAKE_C_COMPILER=' + cc) 618 if cc is not None: cc_args.append('-DCMAKE_C_COMPILER=' + cc)
610 if cxx is not None: cc_args.append('-DCMAKE_CXX_COMPILER=' + cxx) 619 if cxx is not None: cc_args.append('-DCMAKE_CXX_COMPILER=' + cxx)
611 cmake_args += base_cmake_args + [ 620 cmake_args += base_cmake_args + [
612 '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir, 621 '-DLLVM_BINUTILS_INCDIR=' + binutils_incdir,
613 '-DCMAKE_C_FLAGS=' + ' '.join(cflags), 622 '-DCMAKE_C_FLAGS=' + ' '.join(llvm_build_cflags),
614 '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags), 623 '-DCMAKE_CXX_FLAGS=' + ' '.join(llvm_build_cxxflags),
615 '-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(ldflags), 624 '-DCMAKE_EXE_LINKER_FLAGS=' + ' '.join(llvm_build_ldflags),
616 '-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(ldflags), 625 '-DCMAKE_SHARED_LINKER_FLAGS=' + ' '.join(llvm_build_ldflags),
617 '-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(ldflags), 626 '-DCMAKE_MODULE_LINKER_FLAGS=' + ' '.join(llvm_build_ldflags),
618 '-DCMAKE_INSTALL_PREFIX=' + LLVM_BUILD_DIR, 627 '-DCMAKE_INSTALL_PREFIX=' + LLVM_BUILD_DIR,
619 # TODO(thakis): Remove this once official builds pass -Wl,--build-id 628 # TODO(thakis): Remove this once official builds pass -Wl,--build-id
620 # explicitly, https://crbug.com/622775 629 # explicitly, https://crbug.com/622775
621 '-DENABLE_LINKER_BUILD_ID=ON', 630 '-DENABLE_LINKER_BUILD_ID=ON',
622 '-DCHROMIUM_TOOLS_SRC=%s' % os.path.join(CHROMIUM_DIR, 'tools', 'clang'), 631 '-DCHROMIUM_TOOLS_SRC=%s' % os.path.join(CHROMIUM_DIR, 'tools', 'clang'),
623 '-DCHROMIUM_TOOLS=%s' % ';'.join(args.tools)] 632 '-DCHROMIUM_TOOLS=%s' % ';'.join(args.tools)]
624 633
625 EnsureDirExists(LLVM_BUILD_DIR) 634 EnsureDirExists(LLVM_BUILD_DIR)
626 os.chdir(LLVM_BUILD_DIR) 635 os.chdir(LLVM_BUILD_DIR)
627 RmCmakeCache('.') 636 RmCmakeCache('.')
628 RunCommand(['cmake'] + cmake_args + [LLVM_DIR], 637 RunCommand(['cmake'] + cmake_args + [LLVM_DIR],
629 msvc_arch='x64', env=deployment_env) 638 msvc_arch='x64', env=llvm_build_env)
630 639
631 if args.gcc_toolchain: 640 if args.gcc_toolchain:
632 # Copy in the right stdlibc++.so.6 so clang can start. 641 # Copy in the right stdlibc++.so.6 so clang can start.
633 if not os.path.exists(os.path.join(LLVM_BUILD_DIR, 'lib')): 642 if not os.path.exists(os.path.join(LLVM_BUILD_DIR, 'lib')):
634 os.mkdir(os.path.join(LLVM_BUILD_DIR, 'lib')) 643 os.mkdir(os.path.join(LLVM_BUILD_DIR, 'lib'))
635 libstdcpp = subprocess.check_output( 644 libstdcpp = subprocess.check_output(
636 [cxx] + cxxflags + ['-print-file-name=libstdc++.so.6']).rstrip() 645 [cxx] + cxxflags + ['-print-file-name=libstdc++.so.6']).rstrip()
637 CopyFile(libstdcpp, os.path.join(LLVM_BUILD_DIR, 'lib')) 646 CopyFile(libstdcpp, os.path.join(LLVM_BUILD_DIR, 'lib'))
638 647
639 RunCommand(['ninja'], msvc_arch='x64') 648 RunCommand(['ninja'], msvc_arch='x64')
(...skipping 19 matching lines...) Expand all
659 RmTree(COMPILER_RT_BUILD_DIR) 668 RmTree(COMPILER_RT_BUILD_DIR)
660 os.makedirs(COMPILER_RT_BUILD_DIR) 669 os.makedirs(COMPILER_RT_BUILD_DIR)
661 os.chdir(COMPILER_RT_BUILD_DIR) 670 os.chdir(COMPILER_RT_BUILD_DIR)
662 # TODO(thakis): Add this once compiler-rt can build with clang-cl (see 671 # TODO(thakis): Add this once compiler-rt can build with clang-cl (see
663 # above). 672 # above).
664 #if args.bootstrap and sys.platform == 'win32': 673 #if args.bootstrap and sys.platform == 'win32':
665 # The bootstrap compiler produces 64-bit binaries by default. 674 # The bootstrap compiler produces 64-bit binaries by default.
666 #cflags += ['-m32'] 675 #cflags += ['-m32']
667 #cxxflags += ['-m32'] 676 #cxxflags += ['-m32']
668 compiler_rt_args = base_cmake_args + [ 677 compiler_rt_args = base_cmake_args + [
669 '-DCMAKE_C_FLAGS=' + ' '.join(cflags), 678 '-DCMAKE_C_FLAGS=' + ' '.join(llvm_build_cflags),
670 '-DCMAKE_CXX_FLAGS=' + ' '.join(cxxflags)] 679 '-DCMAKE_CXX_FLAGS=' + ' '.join(llvm_build_cxxflags)]
671 if sys.platform != 'win32': 680 if sys.platform != 'win32':
672 compiler_rt_args += ['-DLLVM_CONFIG_PATH=' + 681 compiler_rt_args += ['-DLLVM_CONFIG_PATH=' +
673 os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config'), 682 os.path.join(LLVM_BUILD_DIR, 'bin', 'llvm-config'),
674 '-DSANITIZER_MIN_OSX_VERSION="10.7"'] 683 '-DSANITIZER_MIN_OSX_VERSION="10.7"']
675 # compiler-rt is part of the llvm checkout on Windows but a stand-alone 684 # compiler-rt is part of the llvm checkout on Windows but a stand-alone
676 # directory elsewhere, see the TODO above COMPILER_RT_DIR. 685 # directory elsewhere, see the TODO above COMPILER_RT_DIR.
677 RmCmakeCache('.') 686 RmCmakeCache('.')
678 RunCommand(['cmake'] + compiler_rt_args + 687 RunCommand(['cmake'] + compiler_rt_args +
679 [LLVM_DIR if sys.platform == 'win32' else COMPILER_RT_DIR], 688 [LLVM_DIR if sys.platform == 'win32' else COMPILER_RT_DIR],
680 msvc_arch='x86', env=deployment_env) 689 msvc_arch='x86', env=llvm_build_env)
681 RunCommand(['ninja', 'compiler-rt'], msvc_arch='x86') 690 RunCommand(['ninja', 'compiler-rt'], msvc_arch='x86')
682 691
683 # Copy select output to the main tree. 692 # Copy select output to the main tree.
684 # TODO(hans): Make this (and the .gypi and .isolate files) version number 693 # TODO(hans): Make this (and the .gypi and .isolate files) version number
685 # independent. 694 # independent.
686 if sys.platform == 'win32': 695 if sys.platform == 'win32':
687 platform = 'windows' 696 platform = 'windows'
688 elif sys.platform == 'darwin': 697 elif sys.platform == 'darwin':
689 platform = 'darwin' 698 platform = 'darwin'
690 else: 699 else:
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 parser = argparse.ArgumentParser(description='Build Clang.') 810 parser = argparse.ArgumentParser(description='Build Clang.')
802 parser.add_argument('--bootstrap', action='store_true', 811 parser.add_argument('--bootstrap', action='store_true',
803 help='first build clang with CC, then with itself.') 812 help='first build clang with CC, then with itself.')
804 parser.add_argument('--if-needed', action='store_true', 813 parser.add_argument('--if-needed', action='store_true',
805 help="run only if the script thinks clang is needed") 814 help="run only if the script thinks clang is needed")
806 parser.add_argument('--force-local-build', action='store_true', 815 parser.add_argument('--force-local-build', action='store_true',
807 help="don't try to download prebuild binaries") 816 help="don't try to download prebuild binaries")
808 parser.add_argument('--gcc-toolchain', help='set the version for which gcc ' 817 parser.add_argument('--gcc-toolchain', help='set the version for which gcc '
809 'version be used for building; --gcc-toolchain=/opt/foo ' 818 'version be used for building; --gcc-toolchain=/opt/foo '
810 'picks /opt/foo/bin/gcc') 819 'picks /opt/foo/bin/gcc')
811 parser.add_argument('--lto-gold-plugin', action='store_true', 820 parser.add_argument('--lto', action='store_true',
812 help='build LLVM Gold plugin with LTO') 821 help='build Clang toolchain with LTO')
813 parser.add_argument('--llvm-force-head-revision', action='store_true', 822 parser.add_argument('--llvm-force-head-revision', action='store_true',
814 help=('use the revision in the repo when printing ' 823 help=('use the revision in the repo when printing '
815 'the revision')) 824 'the revision'))
816 parser.add_argument('--print-revision', action='store_true', 825 parser.add_argument('--print-revision', action='store_true',
817 help='print current clang revision and exit.') 826 help='print current clang revision and exit.')
818 parser.add_argument('--print-clang-version', action='store_true', 827 parser.add_argument('--print-clang-version', action='store_true',
819 help='print current clang version (e.g. x.y.z) and exit.') 828 help='print current clang version (e.g. x.y.z) and exit.')
820 parser.add_argument('--run-tests', action='store_true', 829 parser.add_argument('--run-tests', action='store_true',
821 help='run tests after building; only for local builds') 830 help='run tests after building; only for local builds')
822 parser.add_argument('--tools', nargs='*', 831 parser.add_argument('--tools', nargs='*',
823 help='select which chrome tools to build', 832 help='select which chrome tools to build',
824 default=['plugins', 'blink_gc_plugin']) 833 default=['plugins', 'blink_gc_plugin'])
825 parser.add_argument('--without-android', action='store_false', 834 parser.add_argument('--without-android', action='store_false',
826 help='don\'t build Android ASan runtime (linux only)', 835 help='don\'t build Android ASan runtime (linux only)',
827 dest='with_android', 836 dest='with_android',
828 default=sys.platform.startswith('linux')) 837 default=sys.platform.startswith('linux'))
829 args = parser.parse_args() 838 args = parser.parse_args()
830 839
831 if args.lto_gold_plugin and not args.bootstrap: 840 if args.lto and not args.bootstrap:
832 print '--lto-gold-plugin requires --bootstrap' 841 print '--lto requires --bootstrap'
833 return 1 842 return 1
834 if args.lto_gold_plugin and not sys.platform.startswith('linux'): 843 if args.lto and not sys.platform.startswith('linux'):
835 print '--lto-gold-plugin is only effective on Linux. Ignoring the option.' 844 print '--lto is only effective on Linux. Ignoring the option.'
836 args.lto_gold_plugin = False 845 args.lto = False
837 846
838 if args.if_needed: 847 if args.if_needed:
839 is_clang_required = False 848 is_clang_required = False
840 # clang is always used on Mac and Linux. 849 # clang is always used on Mac and Linux.
841 if sys.platform == 'darwin' or sys.platform.startswith('linux'): 850 if sys.platform == 'darwin' or sys.platform.startswith('linux'):
842 is_clang_required = True 851 is_clang_required = True
843 # clang requested via $GYP_DEFINES. 852 # clang requested via $GYP_DEFINES.
844 if re.search(r'\b(clang|asan|lsan|msan|tsan)=1', 853 if re.search(r'\b(clang|asan|lsan|msan|tsan)=1',
845 os.environ.get('GYP_DEFINES', '')): 854 os.environ.get('GYP_DEFINES', '')):
846 is_clang_required = True 855 is_clang_required = True
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
885 args.force_local_build = True 894 args.force_local_build = True
886 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): 895 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''):
887 # Only build the Android ASan rt on ToT bots when targetting Android. 896 # Only build the Android ASan rt on ToT bots when targetting Android.
888 args.with_android = False 897 args.with_android = False
889 898
890 return UpdateClang(args) 899 return UpdateClang(args)
891 900
892 901
893 if __name__ == '__main__': 902 if __name__ == '__main__':
894 sys.exit(main()) 903 sys.exit(main())
OLDNEW
« no previous file with comments | « tools/clang/scripts/package.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698