Chromium Code Reviews| Index: tools/clang/scripts/update.py |
| diff --git a/tools/clang/scripts/update.py b/tools/clang/scripts/update.py |
| index bce2f224f1342a97cc267f237a27dad3d086023f..3e7614a636e4486a3b6bef87f465331112c23e26 100755 |
| --- a/tools/clang/scripts/update.py |
| +++ b/tools/clang/scripts/update.py |
| @@ -8,6 +8,7 @@ update.sh. This script should replace update.sh on all platforms eventually.""" |
| import os |
| import re |
| +import shutil |
| import subprocess |
| import sys |
| @@ -15,7 +16,7 @@ import sys |
| # https://code.google.com/p/chromium/wiki/UpdatingClang |
| # Reverting problematic clang rolls is safe, though. |
| # Note: this revision is only used for Windows. Other platforms use update.sh. |
| -LLVM_WINDOWS_REVISION = '201742' |
| +LLVM_WINDOWS_REVISION = '201744' |
| # Path constants. (All of these should be absolute paths.) |
| THIS_DIR = os.path.abspath(os.path.dirname(__file__)) |
| @@ -23,6 +24,7 @@ CHROMIUM_DIR = os.path.abspath(os.path.join(THIS_DIR, '..', '..', '..')) |
| LLVM_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm') |
| LLVM_BUILD_DIR = os.path.join(CHROMIUM_DIR, 'third_party', 'llvm-build', |
| 'Release+Asserts') |
| +COMPILER_RT_BUILD_DIR = os.path.join(LLVM_BUILD_DIR, '32bit-compiler-rt') |
| CLANG_DIR = os.path.join(LLVM_DIR, 'tools', 'clang') |
| COMPILER_RT_DIR = os.path.join(LLVM_DIR, 'projects', 'compiler-rt') |
| STAMP_FILE = os.path.join(LLVM_BUILD_DIR, 'cr_build_revision') |
| @@ -134,9 +136,29 @@ def UpdateClang(): |
| RunCommand(GetVSVersion().SetupScript('x64') + |
| ['&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', |
| '-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR]) |
| - |
| RunCommand(GetVSVersion().SetupScript('x64') + ['&&', 'ninja', 'all']) |
| + # Do an x86 build of compiler-rt to get the 32-bit ASan run-time. |
| + # TODO(hans): This is pretty hacky. |
|
Nico
2014/02/21 22:22:40
Is this an actionable todo? If so, say what's here
hans
2014/02/21 22:33:00
I've reformulated it. Basically I think we want to
|
| + if not os.path.exists(COMPILER_RT_BUILD_DIR): |
| + os.makedirs(COMPILER_RT_BUILD_DIR) |
| + os.chdir(COMPILER_RT_BUILD_DIR) |
| + RunCommand(GetVSVersion().SetupScript('x86') + |
| + ['&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', |
| + '-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR]) |
| + RunCommand(GetVSVersion().SetupScript('x86') + ['&&', 'ninja', 'compiler-rt']) |
| + asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang', |
| + '3.5', 'lib', 'windows') |
| + asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', |
| + '3.5', 'lib', 'windows') |
| + if not os.path.exists(asan_rt_lib_dst_dir): |
| + os.makedirs(asan_rt_lib_dst_dir) |
| + for root, _, files in os.walk(asan_rt_lib_src_dir): |
| + for f in files: |
| + if re.match(r'^.*-i386\.lib$', f): |
| + shutil.copy(os.path.join(root, f), asan_rt_lib_dst_dir) |
| + print "Copying %s to %s" % (f, asan_rt_lib_dst_dir) |
| + |
| WriteStampFile(LLVM_WINDOWS_REVISION) |
| print 'Clang update was successful.' |
| return 0 |
| @@ -160,7 +182,7 @@ def main(): |
| [os.path.join(os.path.dirname(__file__), 'update.sh')] + sys.argv[1:], |
| stderr=os.fdopen(os.dup(sys.stdin.fileno()))) |
| - if not re.search('clang=1', os.environ.get('GYP_DEFINES', '')): |
| + if not re.search('(clang|asan)=1', os.environ.get('GYP_DEFINES', '')): |
| print 'Skipping Clang update (clang=1 was not set in GYP_DEFINES).' |
| return 0 |