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 """Windows can't run .sh files, so this is a Python implementation of | 6 """Windows can't run .sh files, so this is a Python implementation of |
7 update.sh. This script should replace update.sh on all platforms eventually.""" | 7 update.sh. This script should replace update.sh on all platforms eventually.""" |
8 | 8 |
9 import os | 9 import os |
10 import re | 10 import re |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
209 # Do an x86 build of compiler-rt to get the 32-bit ASan run-time. | 209 # Do an x86 build of compiler-rt to get the 32-bit ASan run-time. |
210 # TODO(hans): Remove once the regular build above produces this. | 210 # TODO(hans): Remove once the regular build above produces this. |
211 if not os.path.exists(COMPILER_RT_BUILD_DIR): | 211 if not os.path.exists(COMPILER_RT_BUILD_DIR): |
212 os.makedirs(COMPILER_RT_BUILD_DIR) | 212 os.makedirs(COMPILER_RT_BUILD_DIR) |
213 os.chdir(COMPILER_RT_BUILD_DIR) | 213 os.chdir(COMPILER_RT_BUILD_DIR) |
214 RunCommand(GetVSVersion().SetupScript('x86') + | 214 RunCommand(GetVSVersion().SetupScript('x86') + |
215 ['&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', | 215 ['&&', 'cmake', '-GNinja', '-DCMAKE_BUILD_TYPE=Release', |
216 '-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR]) | 216 '-DLLVM_ENABLE_ASSERTIONS=ON', LLVM_DIR]) |
217 RunCommand(GetVSVersion().SetupScript('x86') + ['&&', 'ninja', 'compiler-rt']) | 217 RunCommand(GetVSVersion().SetupScript('x86') + ['&&', 'ninja', 'compiler-rt']) |
218 | 218 |
219 asan_rt_bin_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'bin') | |
220 asan_rt_bin_dst_dir = os.path.join(LLVM_BUILD_DIR, 'bin') | |
221 CopyDirectoryContents(asan_rt_bin_src_dir, asan_rt_bin_dst_dir, | |
222 r'^.*-i386\.dll$') | |
223 | |
224 # TODO(hans): Make this (and the .gypi file) version number independent. | 219 # TODO(hans): Make this (and the .gypi file) version number independent. |
225 asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang', | 220 asan_rt_lib_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'lib', 'clang', |
226 '3.6.0', 'lib', 'windows') | 221 '3.6.0', 'lib', 'windows') |
227 asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', | 222 asan_rt_lib_dst_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', |
228 '3.6.0', 'lib', 'windows') | 223 '3.6.0', 'lib', 'windows') |
229 CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir, | 224 CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir, |
230 r'^.*-i386\.lib$') | 225 r'^.*-i386\.lib$') |
231 | 226 |
227 # TODO(hans): Remove when LLVM_WIN_REVISION is updated. | |
228 # Old versions of compiler-rt will leave the asan dll in bin/ | |
229 asan_rt_bin_src_dir = os.path.join(COMPILER_RT_BUILD_DIR, 'bin') | |
230 CopyDirectoryContents(asan_rt_bin_src_dir, asan_rt_lib_dst_dir, | |
231 r'^.*-i386\.dll$') | |
Nico
2014/12/04 20:31:56
Won't this copy the old dll that's around from a p
hans
2014/12/04 20:33:06
The copy below will overwrite any old file with a
| |
232 | |
233 CopyDirectoryContents(asan_rt_lib_src_dir, asan_rt_lib_dst_dir, | |
234 r'^.*-i386\.dll$') | |
235 | |
232 CopyFile(os.path.join(asan_rt_lib_src_dir, '..', '..', 'asan_blacklist.txt'), | 236 CopyFile(os.path.join(asan_rt_lib_src_dir, '..', '..', 'asan_blacklist.txt'), |
233 os.path.join(asan_rt_lib_dst_dir, '..', '..')) | 237 os.path.join(asan_rt_lib_dst_dir, '..', '..')) |
234 | 238 |
235 # Make an extra copy of the sanitizer headers, to be put on the include path | 239 # Make an extra copy of the sanitizer headers, to be put on the include path |
236 # of the fallback compiler. | 240 # of the fallback compiler. |
237 sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', '3.6.0', | 241 sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', '3.6.0', |
238 'include', 'sanitizer') | 242 'include', 'sanitizer') |
239 aux_sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', | 243 aux_sanitizer_include_dir = os.path.join(LLVM_BUILD_DIR, 'lib', 'clang', |
240 '3.6.0', 'include_sanitizer', | 244 '3.6.0', 'include_sanitizer', |
241 'sanitizer') | 245 'sanitizer') |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
275 | 279 |
276 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): | 280 if re.search(r'\b(make_clang_dir)=', os.environ.get('GYP_DEFINES', '')): |
277 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' | 281 print 'Skipping Clang update (make_clang_dir= was set in GYP_DEFINES).' |
278 return 0 | 282 return 0 |
279 | 283 |
280 return UpdateClang() | 284 return UpdateClang() |
281 | 285 |
282 | 286 |
283 if __name__ == '__main__': | 287 if __name__ == '__main__': |
284 sys.exit(main()) | 288 sys.exit(main()) |
OLD | NEW |