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 """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 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
476 cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang') | 476 cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang') |
477 cxx = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang++') | 477 cxx = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang++') |
478 | 478 |
479 if args.gcc_toolchain: | 479 if args.gcc_toolchain: |
480 # Tell the bootstrap compiler to use a specific gcc prefix to search | 480 # Tell the bootstrap compiler to use a specific gcc prefix to search |
481 # for standard library headers and shared object files. | 481 # for standard library headers and shared object files. |
482 cflags = ['--gcc-toolchain=' + args.gcc_toolchain] | 482 cflags = ['--gcc-toolchain=' + args.gcc_toolchain] |
483 cxxflags = ['--gcc-toolchain=' + args.gcc_toolchain] | 483 cxxflags = ['--gcc-toolchain=' + args.gcc_toolchain] |
484 print 'Building final compiler' | 484 print 'Building final compiler' |
485 | 485 |
| 486 # TODO(thakis): Remove this after a few hours. |
| 487 if os.path.exists(LLVM_BUILD_DIR): |
| 488 RmTree(LLVM_BUILD_DIR) |
| 489 |
486 if sys.platform == 'darwin': | 490 if sys.platform == 'darwin': |
487 # Build libc++.dylib while some bots are still on OS X 10.6. | 491 # Build libc++.dylib while some bots are still on OS X 10.6. |
488 libcxxbuild = os.path.join(LLVM_BUILD_DIR, 'libcxxbuild') | 492 libcxxbuild = os.path.join(LLVM_BUILD_DIR, 'libcxxbuild') |
489 if os.path.isdir(libcxxbuild): | 493 if os.path.isdir(libcxxbuild): |
490 RmTree(libcxxbuild) | 494 RmTree(libcxxbuild) |
491 libcxxflags = ['-O3', '-std=c++11', '-fstrict-aliasing'] | 495 libcxxflags = ['-O3', '-std=c++11', '-fstrict-aliasing'] |
492 | 496 |
493 # libcxx and libcxxabi both have a file stdexcept.cpp, so put their .o files | 497 # libcxx and libcxxabi both have a file stdexcept.cpp, so put their .o files |
494 # into different subdirectories. | 498 # into different subdirectories. |
495 os.makedirs(os.path.join(libcxxbuild, 'libcxx')) | 499 os.makedirs(os.path.join(libcxxbuild, 'libcxx')) |
(...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
810 args.force_local_build = True | 814 args.force_local_build = True |
811 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 815 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
812 # Only build the Android ASan rt on ToT bots when targetting Android. | 816 # Only build the Android ASan rt on ToT bots when targetting Android. |
813 args.with_android = False | 817 args.with_android = False |
814 | 818 |
815 return UpdateClang(args) | 819 return UpdateClang(args) |
816 | 820 |
817 | 821 |
818 if __name__ == '__main__': | 822 if __name__ == '__main__': |
819 sys.exit(main()) | 823 sys.exit(main()) |
OLD | NEW |