| 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 distutils.spawn | 11 import distutils.spawn |
| 12 import glob | 12 import glob |
| 13 import os | 13 import os |
| 14 import pipes | 14 import pipes |
| 15 import re | 15 import re |
| 16 import shutil | 16 import shutil |
| 17 import subprocess | 17 import subprocess |
| 18 import stat | 18 import stat |
| 19 import sys | 19 import sys |
| 20 import tarfile | 20 import tarfile |
| 21 import tempfile | 21 import tempfile |
| 22 import time | 22 import time |
| 23 import urllib2 | 23 import urllib2 |
| 24 import zipfile | 24 import zipfile |
| 25 | 25 |
| 26 # Do NOT CHANGE this if you don't know what you're doing -- see | 26 # Do NOT CHANGE this if you don't know what you're doing -- see |
| 27 # https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang.md | 27 # https://chromium.googlesource.com/chromium/src/+/master/docs/updating_clang.md |
| 28 # Reverting problematic clang rolls is safe, though. | 28 # Reverting problematic clang rolls is safe, though. |
| 29 CLANG_REVISION = '264334' | 29 CLANG_REVISION = '264915' |
| 30 | 30 |
| 31 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ | 31 use_head_revision = 'LLVM_FORCE_HEAD_REVISION' in os.environ |
| 32 if use_head_revision: | 32 if use_head_revision: |
| 33 CLANG_REVISION = 'HEAD' | 33 CLANG_REVISION = 'HEAD' |
| 34 | 34 |
| 35 # This is incremented when pushing a new build of Clang at the same revision. | 35 # This is incremented when pushing a new build of Clang at the same revision. |
| 36 CLANG_SUB_REVISION=1 | 36 CLANG_SUB_REVISION=1 |
| 37 | 37 |
| 38 PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION) | 38 PACKAGE_VERSION = "%s-%s" % (CLANG_REVISION, CLANG_SUB_REVISION) |
| 39 | 39 |
| (...skipping 433 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 473 # compiler can start. | 473 # compiler can start. |
| 474 CopyFile(libstdcpp, os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'lib')) | 474 CopyFile(libstdcpp, os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'lib')) |
| 475 | 475 |
| 476 if sys.platform == 'win32': | 476 if sys.platform == 'win32': |
| 477 cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang-cl.exe') | 477 cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang-cl.exe') |
| 478 cxx = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang-cl.exe') | 478 cxx = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang-cl.exe') |
| 479 # CMake has a hard time with backslashes in compiler paths: | 479 # CMake has a hard time with backslashes in compiler paths: |
| 480 # https://stackoverflow.com/questions/13050827 | 480 # https://stackoverflow.com/questions/13050827 |
| 481 cc = cc.replace('\\', '/') | 481 cc = cc.replace('\\', '/') |
| 482 cxx = cxx.replace('\\', '/') | 482 cxx = cxx.replace('\\', '/') |
| 483 # If we're using VS 2015, tell the stage 1 compiler to act like it. | |
| 484 if GetVSVersion().ShortName().startswith('2015'): | |
| 485 cflags += ['-fms-compatibility-version=19'] | |
| 486 cxxflags += ['-fms-compatibility-version=19'] | |
| 487 else: | 483 else: |
| 488 cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang') | 484 cc = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang') |
| 489 cxx = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang++') | 485 cxx = os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, 'bin', 'clang++') |
| 490 | 486 |
| 491 if args.gcc_toolchain: | 487 if args.gcc_toolchain: |
| 492 # Tell the bootstrap compiler to use a specific gcc prefix to search | 488 # Tell the bootstrap compiler to use a specific gcc prefix to search |
| 493 # for standard library headers and shared object files. | 489 # for standard library headers and shared object files. |
| 494 cflags = ['--gcc-toolchain=' + args.gcc_toolchain] | 490 cflags = ['--gcc-toolchain=' + args.gcc_toolchain] |
| 495 cxxflags = ['--gcc-toolchain=' + args.gcc_toolchain] | 491 cxxflags = ['--gcc-toolchain=' + args.gcc_toolchain] |
| 496 print 'Building final compiler' | 492 print 'Building final compiler' |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 795 args.force_local_build = True | 791 args.force_local_build = True |
| 796 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): | 792 if 'OS=android' not in os.environ.get('GYP_DEFINES', ''): |
| 797 # Only build the Android ASan rt on ToT bots when targetting Android. | 793 # Only build the Android ASan rt on ToT bots when targetting Android. |
| 798 args.with_android = False | 794 args.with_android = False |
| 799 | 795 |
| 800 return UpdateClang(args) | 796 return UpdateClang(args) |
| 801 | 797 |
| 802 | 798 |
| 803 if __name__ == '__main__': | 799 if __name__ == '__main__': |
| 804 sys.exit(main()) | 800 sys.exit(main()) |
| OLD | NEW |