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 argparse | 9 import argparse |
10 import contextlib | 10 import contextlib |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 '%(clang)s/lib/Parse/ParseExpr.cpp', | 214 '%(clang)s/lib/Parse/ParseExpr.cpp', |
215 '%(clang)s/lib/Parse/ParseTemplate.cpp', | 215 '%(clang)s/lib/Parse/ParseTemplate.cpp', |
216 '%(clang)s/lib/Sema/SemaDeclCXX.cpp', | 216 '%(clang)s/lib/Sema/SemaDeclCXX.cpp', |
217 '%(clang)s/lib/Sema/SemaExprCXX.cpp', | 217 '%(clang)s/lib/Sema/SemaExprCXX.cpp', |
218 '%(clang)s/test/SemaCXX/default2.cpp', | 218 '%(clang)s/test/SemaCXX/default2.cpp', |
219 '%(clang)s/test/SemaCXX/typo-correction-delayed.cpp', | 219 '%(clang)s/test/SemaCXX/typo-correction-delayed.cpp', |
220 '%(compiler_rt)s/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.c
c', | 220 '%(compiler_rt)s/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.c
c', |
221 '%(compiler_rt)s/test/tsan/signal_segv_handler.cc', | 221 '%(compiler_rt)s/test/tsan/signal_segv_handler.cc', |
222 '%(compiler_rt)s/lib/sanitizer_common/sanitizer_coverage_libcdep.cc', | 222 '%(compiler_rt)s/lib/sanitizer_common/sanitizer_coverage_libcdep.cc', |
223 '%(compiler_rt)s/cmake/config-ix.cmake', | 223 '%(compiler_rt)s/cmake/config-ix.cmake', |
| 224 '%(compiler_rt)s/CMakeLists.txt', |
224 '%(compiler_rt)s/lib/ubsan/ubsan_platform.h', | 225 '%(compiler_rt)s/lib/ubsan/ubsan_platform.h', |
225 ] | 226 ] |
226 for f in files: | 227 for f in files: |
227 f = f % { | 228 f = f % { |
228 'clang': CLANG_DIR, | 229 'clang': CLANG_DIR, |
229 'compiler_rt': COMPILER_RT_DIR, | 230 'compiler_rt': COMPILER_RT_DIR, |
230 'llvm': LLVM_DIR, | 231 'llvm': LLVM_DIR, |
231 } | 232 } |
232 if os.path.exists(f): | 233 if os.path.exists(f): |
233 os.remove(f) # For unversioned files. | 234 os.remove(f) # For unversioned files. |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
275 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm | 276 -; RUN: llvm-go test llvm.org/llvm/bindings/go/llvm |
276 +; RUN: true | 277 +; RUN: true |
277 | 278 |
278 ; REQUIRES: shell | 279 ; REQUIRES: shell |
279 """ | 280 """ |
280 ] | 281 ] |
281 | 282 |
282 # The UBSan run-time, which is now bundled with the ASan run-time, doesn't | 283 # The UBSan run-time, which is now bundled with the ASan run-time, doesn't |
283 # work on Mac OS X 10.8 (PR23539). | 284 # work on Mac OS X 10.8 (PR23539). |
284 compiler_rt_patches = [ r"""\ | 285 compiler_rt_patches = [ r"""\ |
285 --- cmake/config-ix.cmake | 286 --- CMakeLists.txt» (revision 241602) |
286 +++ cmake/config-ix.cmake | 287 +++ CMakeLists.txt» (working copy) |
287 @@ -319,7 +319,7 @@ else() | 288 @@ -305,6 +305,7 @@ |
288 endif() | 289 list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim) |
289 | 290 endif() |
290 if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND | 291 endif() |
291 - OS_NAME MATCHES "Darwin|Linux|FreeBSD") | 292 + set(SANITIZER_MIN_OSX_VERSION "10.7") |
292 + OS_NAME MATCHES "Linux|FreeBSD") | 293 if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7") |
293 set(COMPILER_RT_HAS_UBSAN TRUE) | 294 message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}") |
294 else() | 295 endif() |
295 set(COMPILER_RT_HAS_UBSAN FALSE) | |
296 diff --git a/lib/ubsan/ubsan_platform.h b/lib/ubsan/ubsan_platform.h | |
297 index 8ba253b..d5dce8d 100644 | |
298 --- lib/ubsan/ubsan_platform.h | |
299 +++ lib/ubsan/ubsan_platform.h | |
300 @@ -14,7 +14,7 @@ | |
301 #define UBSAN_PLATFORM_H | |
302 | |
303 // Other platforms should be easy to add, and probably work as-is. | |
304 -#if (defined(__linux__) || defined(__FreeBSD__) || defined(__APPLE__)) && \ | |
305 +#if (defined(__linux__) || defined(__FreeBSD__)) && \ | |
306 (defined(__x86_64__) || defined(__i386__) || defined(__arm__) || \ | |
307 defined(__aarch64__) || defined(__mips__) || defined(__powerpc64__)) | |
308 # define CAN_SANITIZE_UB 1 | |
309 """ | 296 """ |
310 ] | 297 ] |
311 | 298 |
312 for path, patches in [(LLVM_DIR, llvm_patches), | 299 for path, patches in [(LLVM_DIR, llvm_patches), |
313 (CLANG_DIR, clang_patches), | 300 (CLANG_DIR, clang_patches), |
314 (COMPILER_RT_DIR, compiler_rt_patches)]: | 301 (COMPILER_RT_DIR, compiler_rt_patches)]: |
315 print 'Applying patches in', path | 302 print 'Applying patches in', path |
316 for patch in patches: | 303 for patch in patches: |
317 print patch | 304 print patch |
318 p = subprocess.Popen( ['patch', '-p0', '-d', path], stdin=subprocess.PIPE) | 305 p = subprocess.Popen( ['patch', '-p0', '-d', path], stdin=subprocess.PIPE) |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
531 '-current_version', '1', '-compatibility_version', '1', '-lSystem', | 518 '-current_version', '1', '-compatibility_version', '1', '-lSystem', |
532 '-install_name', '@executable_path/libc++.dylib', | 519 '-install_name', '@executable_path/libc++.dylib', |
533 '-Wl,-unexported_symbols_list,' + libdir + '/libc++unexp.exp', | 520 '-Wl,-unexported_symbols_list,' + libdir + '/libc++unexp.exp', |
534 '-Wl,-force_symbols_not_weak_list,' + libdir + '/notweak.exp', | 521 '-Wl,-force_symbols_not_weak_list,' + libdir + '/notweak.exp', |
535 '-Wl,-force_symbols_weak_list,' + libdir + '/weak.exp']) | 522 '-Wl,-force_symbols_weak_list,' + libdir + '/weak.exp']) |
536 if os.path.exists('libc++.dylib'): | 523 if os.path.exists('libc++.dylib'): |
537 os.remove('libc++.dylib') | 524 os.remove('libc++.dylib') |
538 os.symlink('libc++.1.dylib', 'libc++.dylib') | 525 os.symlink('libc++.1.dylib', 'libc++.dylib') |
539 ldflags += ['-stdlib=libc++', '-L' + libcxxbuild] | 526 ldflags += ['-stdlib=libc++', '-L' + libcxxbuild] |
540 | 527 |
| 528 if args.bootstrap: |
| 529 # Now that the libc++ headers have been installed and libc++.dylib is |
| 530 # built, delete the libc++ checkout again so that it's not part of the |
| 531 # main build below -- the libc++(abi) tests don't pass on OS X in |
| 532 # bootstrap builds (http://llvm.org/PR24068) |
| 533 RmTree(LIBCXX_DIR) |
| 534 RmTree(LIBCXXABI_DIR) |
| 535 cxxflags = ['-stdlib=libc++', '-nostdinc++', |
| 536 '-I' + os.path.join(LLVM_BOOTSTRAP_INSTALL_DIR, |
| 537 'include/c++/v1') |
| 538 ] + cflags |
| 539 |
541 # Build clang. | 540 # Build clang. |
542 binutils_incdir = '' | 541 binutils_incdir = '' |
543 if sys.platform.startswith('linux'): | 542 if sys.platform.startswith('linux'): |
544 binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include') | 543 binutils_incdir = os.path.join(BINUTILS_DIR, 'Linux_x64/Release/include') |
545 | 544 |
546 # If building at head, define a macro that plugins can use for #ifdefing | 545 # If building at head, define a macro that plugins can use for #ifdefing |
547 # out code that builds at head, but not at LLVM_WIN_REVISION or vice versa. | 546 # out code that builds at head, but not at LLVM_WIN_REVISION or vice versa. |
548 if use_head_revision: | 547 if use_head_revision: |
549 cflags += ['-DLLVM_FORCE_HEAD_REVISION'] | 548 cflags += ['-DLLVM_FORCE_HEAD_REVISION'] |
550 cxxflags += ['-DLLVM_FORCE_HEAD_REVISION'] | 549 cxxflags += ['-DLLVM_FORCE_HEAD_REVISION'] |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 | 752 |
754 args.force_local_build = True | 753 args.force_local_build = True |
755 # Skip local patches when using HEAD: they probably don't apply anymore. | 754 # Skip local patches when using HEAD: they probably don't apply anymore. |
756 args.with_patches = False | 755 args.with_patches = False |
757 | 756 |
758 return UpdateClang(args) | 757 return UpdateClang(args) |
759 | 758 |
760 | 759 |
761 if __name__ == '__main__': | 760 if __name__ == '__main__': |
762 sys.exit(main()) | 761 sys.exit(main()) |
OLD | NEW |