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 |
| 11 import cStringIO |
11 import distutils.spawn | 12 import distutils.spawn |
12 import glob | 13 import glob |
13 import os | 14 import os |
14 import pipes | 15 import pipes |
15 import re | 16 import re |
16 import shutil | 17 import shutil |
17 import subprocess | 18 import subprocess |
18 import stat | 19 import stat |
19 import sys | 20 import sys |
20 import tarfile | 21 import tarfile |
21 import tempfile | 22 import tempfile |
| 23 import time |
22 import urllib2 | 24 import urllib2 |
23 import zipfile | 25 import zipfile |
24 | 26 |
25 # 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 |
26 # https://code.google.com/p/chromium/wiki/UpdatingClang | 28 # https://code.google.com/p/chromium/wiki/UpdatingClang |
27 # Reverting problematic clang rolls is safe, though. | 29 # Reverting problematic clang rolls is safe, though. |
28 CLANG_REVISION = '254793' | 30 CLANG_REVISION = '254049' |
29 | 31 |
30 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ | 32 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ |
31 if use_head_revision: | 33 if use_head_revision: |
32 CLANG_REVISION = 'HEAD' | 34 CLANG_REVISION = 'HEAD' |
33 | 35 |
34 # 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. |
35 CLANG_SUB_REVISION=1 | 37 CLANG_SUB_REVISION=1 |
36 | 38 |
37 PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION) | 39 PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION) |
38 | 40 |
(...skipping 468 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
507 binutils_incdir = '' | 509 binutils_incdir = '' |
508 if sys.platform.startswith('linux'): | 510 if sys.platform.startswith('linux'): |
509 binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include') | 511 binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include') |
510 | 512 |
511 # If building at head, define a macro that plugins can use for #ifdefing | 513 # If building at head, define a macro that plugins can use for #ifdefing |
512 # out code that builds at head, but not at CLANG_REVISION or vice versa. | 514 # out code that builds at head, but not at CLANG_REVISION or vice versa. |
513 if use_head_revision: | 515 if use_head_revision: |
514 cflags += ['-DLLVM_FORCE_HEAD_REVISION'] | 516 cflags += ['-DLLVM_FORCE_HEAD_REVISION'] |
515 cxxflags += ['-DLLVM_FORCE_HEAD_REVISION'] | 517 cxxflags += ['-DLLVM_FORCE_HEAD_REVISION'] |
516 | 518 |
| 519 # Pin MSan to the old ABI. |
| 520 # TODO(eugenis): Remove when MSan migrates to new ABI (crbug.com/560589). |
| 521 cxxflags += [ '-DMSAN_LINUX_X86_64_OLD_MAPPING' ] |
| 522 |
517 CreateChromeToolsShim() | 523 CreateChromeToolsShim() |
518 | 524 |
519 deployment_env = None | 525 deployment_env = None |
520 if deployment_target: | 526 if deployment_target: |
521 deployment_env = os.environ.copy() | 527 deployment_env = os.environ.copy() |
522 deployment_env['MACOSX_DEPLOYMENT_TARGET'] = deployment_target | 528 deployment_env['MACOSX_DEPLOYMENT_TARGET'] = deployment_target |
523 | 529 |
524 cmake_args = [] | 530 cmake_args = [] |
525 # TODO(thakis): Unconditionally append this to base_cmake_args instead once | 531 # TODO(thakis): Unconditionally append this to base_cmake_args instead once |
526 # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698) | 532 # compiler-rt can build with clang-cl on Windows (http://llvm.org/PR23698) |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
776 args.force_local_build = True | 782 args.force_local_build = True |
777 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 783 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
778 # Only build the Android ASan rt on ToT bots when targetting Android. | 784 # Only build the Android ASan rt on ToT bots when targetting Android. |
779 args.with_android = False | 785 args.with_android = False |
780 | 786 |
781 return UpdateClang(args) | 787 return UpdateClang(args) |
782 | 788 |
783 | 789 |
784 if __name__ == '__main__': | 790 if __name__ == '__main__': |
785 sys.exit(main()) | 791 sys.exit(main()) |
OLD | NEW |