Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 May 2013 18:27:12 +0000 (UTC)
From:      Ed Schouten <ed@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org
Subject:   svn commit: r251034 - in vendor/compiler-rt/dist: . SDKs/darwin/usr/include SDKs/darwin/usr/include/sys SDKs/linux/usr/include SDKs/linux/usr/include/sys cmake/Modules include include/sanitizer lib...
Message-ID:  <201305271827.r4RIRCJp005145@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ed
Date: Mon May 27 18:27:12 2013
New Revision: 251034
URL: http://svnweb.freebsd.org/changeset/base/251034

Log:
  Import compiler-rt r182741.

Added:
  vendor/compiler-rt/dist/SDKs/darwin/usr/include/fcntl.h
  vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/fcntl.h
  vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/mman.h
  vendor/compiler-rt/dist/SDKs/linux/usr/include/fcntl.h
  vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/fcntl.h
  vendor/compiler-rt/dist/include/CMakeLists.txt
  vendor/compiler-rt/dist/include/sanitizer/linux_syscall_hooks.h
  vendor/compiler-rt/dist/lib/arm/aeabi_dcmp.S
  vendor/compiler-rt/dist/lib/arm/aeabi_fcmp.S
  vendor/compiler-rt/dist/lib/asan/asan.syms
  vendor/compiler-rt/dist/lib/asan/asan_blacklist.txt
  vendor/compiler-rt/dist/lib/asan/asan_fake_stack.h
  vendor/compiler-rt/dist/lib/asan/asan_interface_internal.h
  vendor/compiler-rt/dist/lib/asan/asan_poisoning.h
  vendor/compiler-rt/dist/lib/asan/asan_preinit.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/
  vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/interface_symbols_darwin.c
  vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/lit.local.cfg
  vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/reexec-insert-libraries-env.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Darwin/unset-insert-libraries-on-exec.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/init-order-atexit-extra.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-blacklist-extra2.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-constexpr-extra.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/asan_prelink_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob_test_root/
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob_test_root/aa
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob_test_root/ab
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/glob_test_root/ba
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/heavy_uar_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/interface_symbols_linux.c
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/malloc_delete_mismatch.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/preinit_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/syscalls.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/time_null_regtest.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/zero-base-shadow.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/SharedLibs/darwin-dummy-shared-lib-so.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/SharedLibs/init-order-dlopen-so.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/allow_user_segv.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/default_blacklist.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/double-free.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/global-demangle.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/huge_negative_hea_oob.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/init-order-atexit.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/init-order-dlopen.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-constexpr.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/interface_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/invalid-free.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/log_path_fork_test.cc.disabled
  vendor/compiler-rt/dist/lib/asan/lit_tests/malloc_fill.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/memcmp_strict_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/partial_right.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/stack-oob-frames.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/throw_call_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/throw_invoke_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/time_interceptor.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/unaligned_loads_and_stores.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-free-right.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-poison.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/wait.cc
  vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test.cc
  vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test_helpers.mm
  vendor/compiler-rt/dist/lib/asan/tests/asan_mem_test.cc
  vendor/compiler-rt/dist/lib/asan/tests/asan_oob_test.cc
  vendor/compiler-rt/dist/lib/asan/tests/asan_str_test.cc
  vendor/compiler-rt/dist/lib/interception/interception_type_test.cc
  vendor/compiler-rt/dist/lib/lsan/
  vendor/compiler-rt/dist/lib/lsan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/lsan/Makefile.mk
  vendor/compiler-rt/dist/lib/lsan/lit_tests/
  vendor/compiler-rt/dist/lib/lsan/lit_tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/lsan/lit_tests/SharedLibs/
  vendor/compiler-rt/dist/lib/lsan/lit_tests/SharedLibs/lit.local.cfg
  vendor/compiler-rt/dist/lib/lsan/lit_tests/Unit/
  vendor/compiler-rt/dist/lib/lsan/lit_tests/Unit/lit.cfg
  vendor/compiler-rt/dist/lib/lsan/lit_tests/Unit/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/lsan/lit_tests/lit.cfg
  vendor/compiler-rt/dist/lib/lsan/lit_tests/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/lsan/lit_tests/use_globals_initialized.cc
  vendor/compiler-rt/dist/lib/lsan/lsan.cc
  vendor/compiler-rt/dist/lib/lsan/lsan.h
  vendor/compiler-rt/dist/lib/lsan/lsan_allocator.cc
  vendor/compiler-rt/dist/lib/lsan/lsan_allocator.h
  vendor/compiler-rt/dist/lib/lsan/lsan_common.cc
  vendor/compiler-rt/dist/lib/lsan/lsan_common.h
  vendor/compiler-rt/dist/lib/lsan/lsan_common_linux.cc
  vendor/compiler-rt/dist/lib/lsan/lsan_interceptors.cc
  vendor/compiler-rt/dist/lib/lsan/lsan_thread.cc
  vendor/compiler-rt/dist/lib/lsan/lsan_thread.h
  vendor/compiler-rt/dist/lib/lsan/tests/
  vendor/compiler-rt/dist/lib/lsan/tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/lsan/tests/lsan_dummy_unittest.cc
  vendor/compiler-rt/dist/lib/lsan/tests/lsan_testlib.cc
  vendor/compiler-rt/dist/lib/msan/Makefile.mk
  vendor/compiler-rt/dist/lib/msan/lit_tests/
  vendor/compiler-rt/dist/lib/msan/lit_tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/
  vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob.cc
  vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_test_root/
  vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_test_root/aa
  vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_test_root/ab
  vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/glob_test_root/ba
  vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/lit.local.cfg
  vendor/compiler-rt/dist/lib/msan/lit_tests/Linux/syscalls.cc
  vendor/compiler-rt/dist/lib/msan/lit_tests/Unit/
  vendor/compiler-rt/dist/lib/msan/lit_tests/Unit/lit.cfg
  vendor/compiler-rt/dist/lib/msan/lit_tests/Unit/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/msan/lit_tests/c-strdup.c
  vendor/compiler-rt/dist/lib/msan/lit_tests/default_blacklist.cc
  vendor/compiler-rt/dist/lib/msan/lit_tests/getaddrinfo-positive.cc
  vendor/compiler-rt/dist/lib/msan/lit_tests/getaddrinfo.cc
  vendor/compiler-rt/dist/lib/msan/lit_tests/heap-origin.cc
  vendor/compiler-rt/dist/lib/msan/lit_tests/lit.cfg
  vendor/compiler-rt/dist/lib/msan/lit_tests/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/msan/lit_tests/no_sanitize_memory.cc
  vendor/compiler-rt/dist/lib/msan/lit_tests/no_sanitize_memory_prop.cc
  vendor/compiler-rt/dist/lib/msan/lit_tests/readdir64.cc
  vendor/compiler-rt/dist/lib/msan/lit_tests/stack-origin.cc
  vendor/compiler-rt/dist/lib/msan/msan.syms
  vendor/compiler-rt/dist/lib/msan/msan_blacklist.txt
  vendor/compiler-rt/dist/lib/msan/msan_interface_internal.h
  vendor/compiler-rt/dist/lib/msan/tests/msan_loadable.cc
  vendor/compiler-rt/dist/lib/msan/tests/msan_test_config.h
  vendor/compiler-rt/dist/lib/msan/tests/msan_test_main.cc
  vendor/compiler-rt/dist/lib/msandr/
  vendor/compiler-rt/dist/lib/msandr/CMakeLists.txt
  vendor/compiler-rt/dist/lib/msandr/README.txt
  vendor/compiler-rt/dist/lib/msandr/msandr.cc
  vendor/compiler-rt/dist/lib/profile/CMakeLists.txt
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_libcdep.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_syscalls.inc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux_libcdep.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_limits_posix.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix_libcdep.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stoptheworld.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_linux_libcdep.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_syscall_generic.inc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_syscall_linux_x86_64.inc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_thread_registry.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_thread_registry.h
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_atomic_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_linux_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stoptheworld_testlib.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_thread_registry_test.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/SharedLibs/
  vendor/compiler-rt/dist/lib/tsan/lit_tests/SharedLibs/lit.local.cfg
  vendor/compiler-rt/dist/lib/tsan/lit_tests/SharedLibs/load_shared_lib-so.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/aligned_vs_unaligned_race.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_free.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_free2.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_norace.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_race.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/atomic_stack.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/benign_race.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/inlined_memcpy_race.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/java_lock_rec.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/java_lock_rec_race.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/load_shared_lib.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp2.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp3.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/longjmp4.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/malloc_overflow.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/malloc_stack.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset8.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/oob_race.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_mutex2.c
  vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_write.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_end_with_ignore.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_end_with_ignore2.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak4.c
  vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak5.c
  vendor/compiler-rt/dist/lib/tsan/lit_tests/tsan-vs-gvn.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/unaligned_norace.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/unaligned_race.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/vptr_harmful_race2.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan.syms
  vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/bounds.cpp
  vendor/compiler-rt/dist/lib/ubsan/ubsan.syms
  vendor/compiler-rt/dist/test/timing/modsi3.c
Deleted:
  vendor/compiler-rt/dist/lib/asan/asan_allocator.cc
  vendor/compiler-rt/dist/lib/asan/asan_thread_registry.cc
  vendor/compiler-rt/dist/lib/asan/asan_thread_registry.h
  vendor/compiler-rt/dist/lib/asan/dynamic/
  vendor/compiler-rt/dist/lib/asan/lit_tests/interface_symbols.c
  vendor/compiler-rt/dist/lib/asan/lit_tests/log_path_fork_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/malloc_delete_mismatch.cc
  vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test.mm
  vendor/compiler-rt/dist/lib/interception/mach_override/
  vendor/compiler-rt/dist/lib/msan/msan_platform_limits_posix.cc
  vendor/compiler-rt/dist/lib/msan/msan_platform_limits_posix.h
  vendor/compiler-rt/dist/lib/msan/tests/lit.cfg
  vendor/compiler-rt/dist/lib/msan/tests/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_linux.cc
  vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_platform_test.cc
Modified:
  vendor/compiler-rt/dist/CMakeLists.txt
  vendor/compiler-rt/dist/Makefile
  vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h
  vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h
  vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h
  vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h
  vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h
  vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h
  vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h
  vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake
  vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake
  vendor/compiler-rt/dist/include/sanitizer/asan_interface.h
  vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h
  vendor/compiler-rt/dist/include/sanitizer/msan_interface.h
  vendor/compiler-rt/dist/lib/CMakeLists.txt
  vendor/compiler-rt/dist/lib/Makefile.mk
  vendor/compiler-rt/dist/lib/apple_versioning.c
  vendor/compiler-rt/dist/lib/arm/divmodsi4.S
  vendor/compiler-rt/dist/lib/arm/modsi3.S
  vendor/compiler-rt/dist/lib/arm/udivmodsi4.S
  vendor/compiler-rt/dist/lib/arm/umodsi3.S
  vendor/compiler-rt/dist/lib/asan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/asan/Makefile.mk
  vendor/compiler-rt/dist/lib/asan/asan_allocator.h
  vendor/compiler-rt/dist/lib/asan/asan_allocator2.cc
  vendor/compiler-rt/dist/lib/asan/asan_fake_stack.cc
  vendor/compiler-rt/dist/lib/asan/asan_flags.h
  vendor/compiler-rt/dist/lib/asan/asan_globals.cc
  vendor/compiler-rt/dist/lib/asan/asan_intercepted_functions.h
  vendor/compiler-rt/dist/lib/asan/asan_interceptors.cc
  vendor/compiler-rt/dist/lib/asan/asan_interceptors.h
  vendor/compiler-rt/dist/lib/asan/asan_internal.h
  vendor/compiler-rt/dist/lib/asan/asan_linux.cc
  vendor/compiler-rt/dist/lib/asan/asan_mac.cc
  vendor/compiler-rt/dist/lib/asan/asan_mac.h
  vendor/compiler-rt/dist/lib/asan/asan_malloc_linux.cc
  vendor/compiler-rt/dist/lib/asan/asan_malloc_mac.cc
  vendor/compiler-rt/dist/lib/asan/asan_malloc_win.cc
  vendor/compiler-rt/dist/lib/asan/asan_mapping.h
  vendor/compiler-rt/dist/lib/asan/asan_new_delete.cc
  vendor/compiler-rt/dist/lib/asan/asan_poisoning.cc
  vendor/compiler-rt/dist/lib/asan/asan_posix.cc
  vendor/compiler-rt/dist/lib/asan/asan_report.cc
  vendor/compiler-rt/dist/lib/asan/asan_report.h
  vendor/compiler-rt/dist/lib/asan/asan_rtl.cc
  vendor/compiler-rt/dist/lib/asan/asan_stack.cc
  vendor/compiler-rt/dist/lib/asan/asan_stack.h
  vendor/compiler-rt/dist/lib/asan/asan_stats.cc
  vendor/compiler-rt/dist/lib/asan/asan_stats.h
  vendor/compiler-rt/dist/lib/asan/asan_thread.cc
  vendor/compiler-rt/dist/lib/asan/asan_thread.h
  vendor/compiler-rt/dist/lib/asan/asan_win.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-blacklist.txt
  vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-nobug-extra.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/malloc-in-qsort.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/overflow-in-qsort.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/rlimit_mmap_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/swapcontext_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/Unit/lit.cfg
  vendor/compiler-rt/dist/lib/asan/lit_tests/Unit/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/asan/lit_tests/default_options.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/dlclose-test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/heap-overflow.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-blacklist.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-bug.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/initialization-nobug.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/large_func_test.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/lit.cfg
  vendor/compiler-rt/dist/lib/asan/lit_tests/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/asan/lit_tests/stack-frame-demangle.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/stack-overflow.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/strncpy-overflow.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-free.cc
  vendor/compiler-rt/dist/lib/asan/lit_tests/use-after-scope-inlined.cc
  vendor/compiler-rt/dist/lib/asan/scripts/asan_symbolize.py
  vendor/compiler-rt/dist/lib/asan/tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/asan/tests/asan_globals_test.cc
  vendor/compiler-rt/dist/lib/asan/tests/asan_noinst_test.cc
  vendor/compiler-rt/dist/lib/asan/tests/asan_test.cc
  vendor/compiler-rt/dist/lib/asan/tests/asan_test_config.h
  vendor/compiler-rt/dist/lib/asan/tests/asan_test_utils.h
  vendor/compiler-rt/dist/lib/atomic.c
  vendor/compiler-rt/dist/lib/comparedf2.c
  vendor/compiler-rt/dist/lib/comparesf2.c
  vendor/compiler-rt/dist/lib/interception/CMakeLists.txt
  vendor/compiler-rt/dist/lib/interception/Makefile.mk
  vendor/compiler-rt/dist/lib/interception/interception.h
  vendor/compiler-rt/dist/lib/interception/interception_mac.cc
  vendor/compiler-rt/dist/lib/interception/interception_mac.h
  vendor/compiler-rt/dist/lib/lit.common.cfg
  vendor/compiler-rt/dist/lib/lit.common.unit.cfg
  vendor/compiler-rt/dist/lib/msan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/msan/msan.cc
  vendor/compiler-rt/dist/lib/msan/msan.h
  vendor/compiler-rt/dist/lib/msan/msan_flags.h
  vendor/compiler-rt/dist/lib/msan/msan_interceptors.cc
  vendor/compiler-rt/dist/lib/msan/msan_linux.cc
  vendor/compiler-rt/dist/lib/msan/msan_new_delete.cc
  vendor/compiler-rt/dist/lib/msan/msan_report.cc
  vendor/compiler-rt/dist/lib/msan/tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/msan/tests/msan_test.cc
  vendor/compiler-rt/dist/lib/msan/tests/msandr_test_so.cc
  vendor/compiler-rt/dist/lib/msan/tests/msandr_test_so.h
  vendor/compiler-rt/dist/lib/profile/GCDAProfiling.c
  vendor/compiler-rt/dist/lib/sanitizer_common/CMakeLists.txt
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_clang.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_atomic_msvc.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors.inc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_common_interceptors_scanf.inc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_flags.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_internal_defs.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_lfstack.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libc.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_libc.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_linux.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mac.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_mutex.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_placement_new.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_printf.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_procmaps.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_quarantine.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_report_decorator.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stackdepot.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_stacktrace.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.h
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_itanium.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_mac.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_win.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/scripts/check_lint.sh
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/lit.cfg
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_allocator_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_common_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_flags_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_libc_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_mutex_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc
  vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_utils.h
  vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/tsan/Makefile.old
  vendor/compiler-rt/dist/lib/tsan/analyze_libtsan.sh
  vendor/compiler-rt/dist/lib/tsan/check_cmake.sh
  vendor/compiler-rt/dist/lib/tsan/go/buildgo.sh
  vendor/compiler-rt/dist/lib/tsan/go/test.c
  vendor/compiler-rt/dist/lib/tsan/go/tsan_go.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/tsan/lit_tests/Unit/lit.cfg
  vendor/compiler-rt/dist/lib/tsan/lit_tests/Unit/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/tsan/lit_tests/free_race.c
  vendor/compiler-rt/dist/lib/tsan/lit_tests/free_race2.c
  vendor/compiler-rt/dist/lib/tsan/lit_tests/java.h
  vendor/compiler-rt/dist/lib/tsan/lit_tests/java_lock.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/java_rwlock.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/lit.cfg
  vendor/compiler-rt/dist/lib/tsan/lit_tests/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/tsan/lit_tests/memcpy_race.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/mutex_destroy_locked.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset7.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_heap.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_mutex.c
  vendor/compiler-rt/dist/lib/tsan/lit_tests/signal_errno.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/signal_malloc.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/simple_race.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/test_output.sh
  vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak3.c
  vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_name.cc
  vendor/compiler-rt/dist/lib/tsan/lit_tests/vptr_harmful_race.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/CMakeLists.txt
  vendor/compiler-rt/dist/lib/tsan/rtl/Makefile.mk
  vendor/compiler-rt/dist/lib/tsan/rtl/Makefile.old
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_defs.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_fd.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_flags.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_flags.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interceptors.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_ann.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_ann.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_atomic.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_inl.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_java.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_java.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_md5.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mman.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mman.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mutex.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mutexset.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_linux.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_mac.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_windows.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_report.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_amd64.S
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_mutex.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_report.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_rtl_thread.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_stat.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_stat.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_suppressions.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_symbolize.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_symbolize.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_symbolize_addr2line_linux.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.cc
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_sync.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_update_shadow_word_inl.h
  vendor/compiler-rt/dist/lib/tsan/rtl/tsan_vector.h
  vendor/compiler-rt/dist/lib/tsan/tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_test_util_linux.cc
  vendor/compiler-rt/dist/lib/tsan/tests/unit/CMakeLists.txt
  vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_mman_test.cc
  vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_mutexset_test.cc
  vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_shadow_test.cc
  vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_suppressions_test.cc
  vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt
  vendor/compiler-rt/dist/lib/ubsan/Makefile.mk
  vendor/compiler-rt/dist/lib/ubsan/lit_tests/CMakeLists.txt
  vendor/compiler-rt/dist/lib/ubsan/lit_tests/Float/cast-overflow.cpp
  vendor/compiler-rt/dist/lib/ubsan/lit_tests/TypeCheck/vptr.cpp
  vendor/compiler-rt/dist/lib/ubsan/lit_tests/lit.cfg
  vendor/compiler-rt/dist/lib/ubsan/lit_tests/lit.site.cfg.in
  vendor/compiler-rt/dist/lib/ubsan/ubsan_diag.cc
  vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.cc
  vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers.h
  vendor/compiler-rt/dist/lib/ubsan/ubsan_handlers_cxx.cc
  vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash.cc
  vendor/compiler-rt/dist/lib/ubsan/ubsan_value.cc
  vendor/compiler-rt/dist/lib/ubsan/ubsan_value.h
  vendor/compiler-rt/dist/make/AppleBI.mk
  vendor/compiler-rt/dist/make/platform/clang_darwin.mk
  vendor/compiler-rt/dist/make/platform/clang_linux.mk
  vendor/compiler-rt/dist/make/platform/darwin_bni.mk

Modified: vendor/compiler-rt/dist/CMakeLists.txt
==============================================================================
--- vendor/compiler-rt/dist/CMakeLists.txt	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/CMakeLists.txt	Mon May 27 18:27:12 2013	(r251034)
@@ -15,6 +15,19 @@ include(LLVMParseArguments)
 # runtime libraries.
 cmake_minimum_required(VERSION 2.8.8)
 
+# Compute the Clang version from the LLVM version.
+# FIXME: We should be able to reuse CLANG_VERSION variable calculated
+#        in Clang cmake files, instead of copying the rules here.
+string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
+       ${PACKAGE_VERSION})
+# Setup the paths where compiler-rt runtimes and headers should be stored.
+set(LIBCLANG_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
+string(TOLOWER ${CMAKE_SYSTEM_NAME} LIBCLANG_OS_DIR)
+set(CLANG_RESOURCE_DIR ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION})
+set(COMPILER_RT_LIBRARY_OUTPUT_DIR ${CLANG_RESOURCE_DIR}/lib/${LIBCLANG_OS_DIR})
+set(COMPILER_RT_LIBRARY_INSTALL_DIR
+  ${LIBCLANG_INSTALL_PATH}/lib/${LIBCLANG_OS_DIR})
+
 # Add path for custom modules
 set(CMAKE_MODULE_PATH
   ${CMAKE_MODULE_PATH}
@@ -23,6 +36,9 @@ set(CMAKE_MODULE_PATH
 include(AddCompilerRT)
 
 set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
+# Setup custom SDK sysroots.
+set(COMPILER_RT_DARWIN_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/darwin)
+set(COMPILER_RT_LINUX_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/linux)
 
 # Detect whether the current target platform is 32-bit or 64-bit, and setup
 # the correct commandline flags needed to attempt to target 32-bit and 64-bit.
@@ -37,15 +53,8 @@ else()
   set(TARGET_32_BIT_CFLAGS "-m32")
 endif()
 
-# FIXME: Below we assume that the target build of LLVM/Clang is x86, which is
-# not at all valid. Much of this can be fixed just by switching to use
-# a just-built-clang binary for the compiles.
-
-set(TARGET_x86_64_CFLAGS ${TARGET_64_BIT_CFLAGS})
-set(TARGET_i386_CFLAGS ${TARGET_32_BIT_CFLAGS})
-
-set(COMPILER_RT_SUPPORTED_ARCH
-  x86_64 i386)
+# List of architectures we can target.
+set(COMPILER_RT_SUPPORTED_ARCH)
 
 function(get_target_flags_for_arch arch out_var)
   list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX)
@@ -60,27 +69,45 @@ endfunction()
 # platform. We use the results of these tests to build only the various target
 # runtime libraries supported by our current compilers cross-compiling
 # abilities.
-set(SIMPLE_SOURCE64 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple64.c)
-file(WRITE ${SIMPLE_SOURCE64} "#include <stdlib.h>\nint main() {}")
-try_compile(CAN_TARGET_x86_64 ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE64}
-            COMPILE_DEFINITIONS "${TARGET_x86_64_CFLAGS}"
-            CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_x86_64_CFLAGS}")
-
-set(SIMPLE_SOURCE32 ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple32.c)
-file(WRITE ${SIMPLE_SOURCE32} "#include <stdlib.h>\nint main() {}")
-try_compile(CAN_TARGET_i386 ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE32}
-            COMPILE_DEFINITIONS "${TARGET_i386_CFLAGS}"
-            CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_i386_CFLAGS}")
+set(SIMPLE_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.c)
+file(WRITE ${SIMPLE_SOURCE} "#include <stdlib.h>\nint main() {}")
+
+# test_target_arch(<arch> <target flags...>)
+# Sets the target flags for a given architecture and determines if this
+# architecture is supported by trying to build a simple file.
+macro(test_target_arch arch)
+  set(TARGET_${arch}_CFLAGS ${ARGN})
+  try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE}
+              COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}"
+              CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_${arch}_CFLAGS}")
+  if(${CAN_TARGET_${arch}})
+    list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch})
+  endif()
+endmacro()
+
+if("${LLVM_NATIVE_ARCH}" STREQUAL "X86")
+  test_target_arch(x86_64 ${TARGET_64_BIT_CFLAGS})
+  test_target_arch(i386 ${TARGET_32_BIT_CFLAGS})
+elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC")
+  # Explicitly set -m flag on powerpc, because on ppc64 defaults for gcc and
+  # clang are different.
+  test_target_arch(powerpc64 "-m64")
+  test_target_arch(powerpc "-m32")
+endif()
 
 # We only support running instrumented tests when we're not cross compiling
 # and target a unix-like system. On Android we define the rules for building
 # unit tests, but don't execute them.
 if("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND UNIX AND NOT ANDROID)
-  set(COMPILER_RT_CAN_EXECUTE_TESTS TRUE)
+  option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" ON)
 else()
-  set(COMPILER_RT_CAN_EXECUTE_TESTS FALSE)
+  option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" OFF)
 endif()
-    
+
+# Check if compiler-rt is built with libc++.
+find_flag_in_string("${CMAKE_CXX_FLAGS}" "-stdlib=libc++"
+                    COMPILER_RT_USES_LIBCXX)
+
 function(filter_available_targets out_var)
   set(archs)
   foreach(arch ${ARGN})
@@ -99,6 +126,8 @@ set(SANITIZER_COMMON_CFLAGS
   -fno-exceptions
   -fomit-frame-pointer
   -funwind-tables
+  -fno-stack-protector
+  -Wno-gnu  # Variadic macros with 0 arguments for ...
   -O3
   )
 if(NOT WIN32)
@@ -120,51 +149,36 @@ check_cxx_compiler_flag(-Wno-c99-extensi
 if(SUPPORTS_NO_C99_EXTENSIONS_FLAG)
   list(APPEND SANITIZER_COMMON_CFLAGS -Wno-c99-extensions)
 endif()
+# Sanitizer may not have libstdc++, so we can have problems with virtual
+# destructors.
+check_cxx_compiler_flag(-Wno-non-virtual-dtor SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG)
+if (SUPPORTS_NO_NON_VIRTUAL_DTOR_FLAG)
+  list(APPEND SANITIZER_COMMON_CFLAGS -Wno-non-virtual-dtor)
+endif()
+
+# Setup min Mac OS X version.
 if(APPLE)
-  list(APPEND SANITIZER_COMMON_CFLAGS -mmacosx-version-min=10.5)
+  if(COMPILER_RT_USES_LIBCXX)
+    set(SANITIZER_MIN_OSX_VERSION 10.7)
+  else()
+    set(SANITIZER_MIN_OSX_VERSION 10.5)
+  endif()
+  list(APPEND SANITIZER_COMMON_CFLAGS
+    -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION})
 endif()
 
 # Architectures supported by Sanitizer runtimes. Specific sanitizers may
 # support only subset of these (e.g. TSan works on x86_64 only).
 filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH
-  x86_64 i386)
-
-# Compute the Clang version from the LLVM version.
-# FIXME: We should be able to reuse CLANG_VERSION variable calculated
-#        in Clang cmake files, instead of copying the rules here.
-string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" CLANG_VERSION
-       ${PACKAGE_VERSION})
-# Setup the paths where compiler-rt runtimes and headers should be stored.
-set(LIBCLANG_INSTALL_PATH lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION})
-string(TOLOWER ${CMAKE_SYSTEM_NAME} LIBCLANG_OS_DIR)
-
-# Install compiler-rt headers.
-install(DIRECTORY include/
-  DESTINATION ${LIBCLANG_INSTALL_PATH}/include
-  FILES_MATCHING
-  PATTERN "*.h"
-  PATTERN ".svn" EXCLUDE
-  )
-
-# Call add_clang_compiler_rt_libraries to make sure that targets are built
-# and installed in the directories where Clang driver expects to find them.
-macro(add_clang_compiler_rt_libraries)
-  # Setup output directories so that clang in build tree works.
-  set_target_properties(${ARGN} PROPERTIES
-    ARCHIVE_OUTPUT_DIRECTORY
-      ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/${LIBCLANG_OS_DIR}
-    LIBRARY_OUTPUT_DIRECTORY
-      ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/${LIBCLANG_OS_DIR}
-    )
-  # Add installation command.
-  install(TARGETS ${ARGN}
-    ARCHIVE DESTINATION ${LIBCLANG_INSTALL_PATH}/lib/${LIBCLANG_OS_DIR}
-    LIBRARY DESTINATION ${LIBCLANG_INSTALL_PATH}/lib/${LIBCLANG_OS_DIR}
-    )
-endmacro(add_clang_compiler_rt_libraries)
+  x86_64 i386 powerpc64 powerpc)
 
 # Add the public header's directory to the includes for all of compiler-rt.
 include_directories(include)
+add_subdirectory(include)
+
+set(SANITIZER_COMMON_LIT_TEST_DEPS
+  clang clang-headers FileCheck count not llvm-nm llvm-symbolizer
+  compiler-rt-headers)
 
 add_subdirectory(lib)
 

Modified: vendor/compiler-rt/dist/Makefile
==============================================================================
--- vendor/compiler-rt/dist/Makefile	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/Makefile	Mon May 27 18:27:12 2013	(r251034)
@@ -255,10 +255,10 @@ $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.S $
 	$(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c -o $$@ $$<
 $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.c $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir
 	$(Summary) "  COMPILE:   $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<"
-	$(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c $(COMMON_CFLAGS) -o $$@ $$<
+	$(Verb) $(Tmp.CC) $(COMMON_CFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$<
 $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.cc $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir
 	$(Summary) "  COMPILE:   $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<"
-	$(Verb) $(Tmp.CC) $(Tmp.CFLAGS) -c $(COMMON_CXXFLAGS) -o $$@ $$<
+	$(Verb) $(Tmp.CC) $(COMMON_CXXFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$<
 .PRECIOUS: $(Tmp.ObjPath)/.dir
 
 endef

Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/fcntl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/fcntl.h	Mon May 27 18:27:12 2013	(r251034)
@@ -0,0 +1,17 @@
+/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------===
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===-----------------------------------------------------------------------===
+ *
+ * This is a stub SDK header file. This file is not part of the interface of
+ * this library nor an official version of the appropriate SDK header. It is
+ * intended only to stub the features of this header required by compiler-rt.
+ *
+ * ===-----------------------------------------------------------------------===
+ */
+
+#include <sys/fcntl.h>

Modified: vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h
==============================================================================
--- vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h	Mon May 27 18:27:12 2013	(r251034)
@@ -24,15 +24,18 @@ extern "C" {
 typedef struct __sFILE FILE;
 typedef __SIZE_TYPE__ size_t;
 
-/* Determine the appropriate fopen() and fwrite() functions. */
+/* Determine the appropriate fdopen, fopen(), and fwrite() functions. */
 #if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
 #  if defined(__i386)
+#    define __FDOPEN_NAME  "_fdopen$UNIX2003"
 #    define __FOPEN_NAME "_fopen$UNIX2003"
 #    define __FWRITE_NAME "_fwrite$UNIX2003"
 #  elif defined(__x86_64__)
+#    define __FDOPEN_NAME  "_fdopen"
 #    define __FOPEN_NAME "_fopen"
 #    define __FWRITE_NAME "_fwrite"
 #  elif defined(__arm)
+#    define __FDOPEN_NAME  "_fdopen"
 #    define __FOPEN_NAME "_fopen"
 #    define __FWRITE_NAME "_fwrite"
 #  else
@@ -40,9 +43,11 @@ typedef __SIZE_TYPE__ size_t;
 #  endif
 #elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
 #  if defined(__i386) || defined (__x86_64)
+#    define __FDOPEN_NAME  "_fdopen"
 #    define __FOPEN_NAME "_fopen"
 #    define __FWRITE_NAME "_fwrite"
 #  elif defined(__arm)
+#    define __FDOPEN_NAME  "_fdopen"
 #    define __FOPEN_NAME "_fopen"
 #    define __FWRITE_NAME "_fwrite"
 #  else
@@ -68,13 +73,13 @@ extern FILE *__stderrp;
 int fclose(FILE *);
 int fflush(FILE *);
 FILE *fopen(const char * __restrict, const char * __restrict) __asm(__FOPEN_NAME);
+FILE *fdopen(int, const char *) __asm(__FDOPEN_NAME);
 int fprintf(FILE * __restrict, const char * __restrict, ...);
 size_t fwrite(const void * __restrict, size_t, size_t, FILE * __restrict)
   __asm(__FWRITE_NAME);
 size_t fread(void * __restrict, size_t, size_t, FILE * __restrict);
 long ftell(FILE *);
 int fseek(FILE *, long, int);
-
 int snprintf(char * __restrict, size_t, const char * __restrict, ...);
 
 #if defined(__cplusplus)

Modified: vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h
==============================================================================
--- vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdlib.h	Mon May 27 18:27:12 2013	(r251034)
@@ -22,9 +22,11 @@
 typedef __SIZE_TYPE__ size_t;
 
 void abort(void) __attribute__((__noreturn__));
+int atexit(void (*)(void));
 int atoi(const char *);
 void free(void *);
 char *getenv(const char *);
 void *malloc(size_t);
+void *realloc(void *, size_t);
 
 #endif /* __STDLIB_H__ */

Modified: vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h
==============================================================================
--- vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/string.h	Mon May 27 18:27:12 2013	(r251034)
@@ -21,6 +21,7 @@ typedef __SIZE_TYPE__ size_t;
 
 int memcmp(const void *, const void *, size_t);
 void *memcpy(void *, const void *, size_t);
+void *memset(void *, int, size_t);
 char *strcat(char *, const char *);
 char *strcpy(char *, const char *);
 char *strdup(const char *);

Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/fcntl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/fcntl.h	Mon May 27 18:27:12 2013	(r251034)
@@ -0,0 +1,52 @@
+/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------===
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===-----------------------------------------------------------------------===
+ *
+ * This is a stub SDK header file. This file is not part of the interface of
+ * this library nor an official version of the appropriate SDK header. It is
+ * intended only to stub the features of this header required by compiler-rt.
+ *
+ * ===-----------------------------------------------------------------------===
+ */
+
+#ifndef _SYS_FCNTL_H_
+#define _SYS_FCNTL_H_
+
+/* Determine the appropriate open function. */
+#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__)
+#  if defined(__i386)
+#    define __OPEN_NAME  "_open$UNIX2003"
+#  elif defined(__x86_64__)
+#    define __OPEN_NAME  "_open"
+#  elif defined(__arm)
+#    define __OPEN_NAME  "_open"
+#  else
+#    error "unrecognized architecture for targetting OS X"
+#  endif
+#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__)
+#  if defined(__i386) || defined (__x86_64)
+#    define __OPEN_NAME  "_open"
+#  elif defined(__arm)
+#    define __OPEN_NAME  "_open"
+#  else
+#    error "unrecognized architecture for targetting iOS"
+#  endif
+#else
+#  error "unrecognized architecture for targetting Darwin"
+#endif
+
+#define O_RDONLY   0x0000    /* open for reading only */
+#define O_WRONLY   0x0001    /* open for writing only */
+#define O_RDWR     0x0002    /* open for reading and writing */
+#define O_ACCMODE  0x0003    /* mask for above modes */
+
+#define O_CREAT    0x0200    /* create if nonexistant */
+
+int open(const char *, int, ...) __asm(__OPEN_NAME);
+
+#endif /* !_SYS_FCNTL_H_ */

Added: vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/mman.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/sys/mman.h	Mon May 27 18:27:12 2013	(r251034)
@@ -0,0 +1,42 @@
+/* ===-- mman.h - stub SDK header for compiler-rt ---------------------------===
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===-----------------------------------------------------------------------===
+ *
+ * This is a stub SDK header file. This file is not part of the interface of
+ * this library nor an official version of the appropriate SDK header. It is
+ * intended only to stub the features of this header required by compiler-rt.
+ *
+ * ===-----------------------------------------------------------------------===
+ */
+
+#ifndef __SYS_MMAN_H__
+#define __SYS_MMAN_H__
+
+typedef __SIZE_TYPE__ size_t;
+
+#define PROT_NONE     0x00
+#define PROT_READ     0x01
+#define PROT_WRITE    0x02
+#define PROT_EXEC     0x04
+
+#define MAP_SHARED    0x0001
+#define MAP_PRIVATE   0x0002
+
+#define MAP_FILE      0x0000
+#define MAP_ANON      0x1000
+
+#define MS_ASYNC      0x0001
+#define MS_INVALIDATE 0x0002
+#define MS_SYNC       0x0010
+
+void *mmap(void *addr, size_t len, int prot, int flags, int fd,
+           long long offset);
+int munmap(void *addr, size_t len);
+int msync(void *addr, size_t len, int flags);
+
+#endif /* __SYS_MMAN_H__ */

Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/fcntl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/SDKs/linux/usr/include/fcntl.h	Mon May 27 18:27:12 2013	(r251034)
@@ -0,0 +1,17 @@
+/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------===
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===-----------------------------------------------------------------------===
+ *
+ * This is a stub SDK header file. This file is not part of the interface of
+ * this library nor an official version of the appropriate SDK header. It is
+ * intended only to stub the features of this header required by compiler-rt.
+ *
+ * ===-----------------------------------------------------------------------===
+ */
+
+#include <sys/fcntl.h>

Modified: vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h
==============================================================================
--- vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h	Mon May 27 18:27:12 2013	(r251034)
@@ -33,6 +33,7 @@ extern struct _IO_FILE *stderr;
 extern int fclose(FILE *);
 extern int fflush(FILE *);
 extern FILE *fopen(const char * restrict, const char * restrict);
+extern FILE *fdopen(int, const char * restrict);
 extern int fprintf(FILE * restrict, const char * restrict, ...);
 extern size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict);
 extern size_t fread(void * restrict, size_t, size_t, FILE * restrict);

Modified: vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h
==============================================================================
--- vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/SDKs/linux/usr/include/stdlib.h	Mon May 27 18:27:12 2013	(r251034)
@@ -22,6 +22,7 @@
 typedef __SIZE_TYPE__ size_t;
 
 void abort(void) __attribute__((__nothrow__)) __attribute__((__noreturn__));
+int atexit(void (*)(void)) __attribute__((__nothrow__));
 int atoi(const char *) __attribute__((__nothrow__));
 void free(void *) __attribute__((__nothrow__));
 char *getenv(const char *) __attribute__((__nothrow__))
@@ -29,5 +30,7 @@ char *getenv(const char *) __attribute__
   __attribute__((__warn_unused_result__));
 void *malloc(size_t) __attribute__((__nothrow__)) __attribute((__malloc__))
      __attribute__((__warn_unused_result__));
+void *realloc(void *, size_t) __attribute__((__nothrow__)) __attribute((__malloc__))
+     __attribute__((__warn_unused_result__));
 
 #endif /* __STDLIB_H__ */

Modified: vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h
==============================================================================
--- vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/SDKs/linux/usr/include/string.h	Mon May 27 18:27:12 2013	(r251034)
@@ -21,6 +21,7 @@ typedef __SIZE_TYPE__ size_t;
 
 int memcmp(const void *, const void *, size_t);
 void *memcpy(void *, const void *, size_t);
+void *memset(void *, int, size_t);
 char *strcat(char *, const char *);
 char *strcpy(char *, const char *);
 char *strdup(const char *);

Added: vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/fcntl.h
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/fcntl.h	Mon May 27 18:27:12 2013	(r251034)
@@ -0,0 +1,29 @@
+/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------===
+ *
+ *                     The LLVM Compiler Infrastructure
+ *
+ * This file is dual licensed under the MIT and the University of Illinois Open
+ * Source Licenses. See LICENSE.TXT for details.
+ *
+ * ===-----------------------------------------------------------------------===
+ *
+ * This is a stub SDK header file. This file is not part of the interface of
+ * this library nor an official version of the appropriate SDK header. It is
+ * intended only to stub the features of this header required by compiler-rt.
+ *
+ * ===-----------------------------------------------------------------------===
+ */
+
+#ifndef _SYS_FCNTL_H_
+#define _SYS_FCNTL_H_
+
+#define O_RDONLY   0x0000
+#define O_WRONLY   0x0001
+#define O_RDWR     0x0002
+#define O_ACCMODE  0x0003
+
+#define O_CREAT    0x0200
+
+int open(const char *, int, ...);
+
+#endif /* _SYS_FCNTL_H_ */

Modified: vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h
==============================================================================
--- vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/SDKs/linux/usr/include/sys/mman.h	Mon May 27 18:27:12 2013	(r251034)
@@ -19,10 +19,28 @@
 
 typedef __SIZE_TYPE__ size_t;
 
-#define PROT_READ 0x1
-#define PROT_WRITE 0x2
-#define PROT_EXEC 0x4
+#define PROT_NONE     0x00
+#define PROT_READ     0x01
+#define PROT_WRITE    0x02
+#define PROT_EXEC     0x04
 
+#define MAP_SHARED    0x0001
+#define MAP_PRIVATE   0x0002
+
+#define MAP_FILE      0x0000
+#define MAP_ANON      0x1000
+
+#define MS_ASYNC      0x0001
+#define MS_INVALIDATE 0x0002
+#define MS_SYNC       0x0010
+
+extern void *mmap(void *addr, size_t len, int prot, int flags, int fd,
+                  long long offset)
+  __attribute__((__nothrow__));
+extern int munmap(void *addr, size_t len)
+  __attribute__((__nothrow__));
+extern int msync(void *addr, size_t len, int flags)
+  __attribute__((__nothrow__));
 extern int mprotect (void *__addr, size_t __len, int __prot)
   __attribute__((__nothrow__));
 

Modified: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake
==============================================================================
--- vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake	Mon May 27 18:27:12 2013	(r251034)
@@ -18,6 +18,92 @@ macro(add_compiler_rt_object_library nam
   endif()
 endmacro()
 
+# Same as above, but adds universal osx library with name "<name>.osx"
+# targeting multiple architectures.
+# add_compiler_rt_osx_object_library(<name> ARCH <architectures>
+#                                           SOURCES <source files>
+#                                           CFLAGS <compile flags>)
+macro(add_compiler_rt_osx_object_library name)
+  parse_arguments(LIB "ARCH;SOURCES;CFLAGS" "" ${ARGN})
+  set(libname "${name}.osx")
+  add_library(${libname} OBJECT ${LIB_SOURCES})
+  set_target_compile_flags(${libname} ${LIB_CFLAGS})
+  set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCH}")
+endmacro()
+
+# Adds static runtime for a given architecture and puts it in the proper
+# directory in the build and install trees.
+# add_compiler_rt_static_runtime(<name> <arch>
+#                                SOURCES <source files>
+#                                CFLAGS <compile flags>
+#                                DEFS <compile definitions>
+#                                SYMS <symbols file>)
+macro(add_compiler_rt_static_runtime name arch)
+  if(CAN_TARGET_${arch})
+    parse_arguments(LIB "SOURCES;CFLAGS;DEFS;SYMS" "" ${ARGN})
+    add_library(${name} STATIC ${LIB_SOURCES})
+    # Setup compile flags and definitions.
+    set_target_compile_flags(${name}
+      ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS})
+    set_property(TARGET ${name} APPEND PROPERTY
+      COMPILE_DEFINITIONS ${LIB_DEFS})
+    # Setup correct output directory in the build tree.
+    set_target_properties(${name} PROPERTIES
+      ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
+    # Add installation command.
+    install(TARGETS ${name}
+      ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+    # Generate the .syms file if possible.
+    if(LIB_SYMS)
+      get_target_property(libfile ${name} LOCATION)
+      configure_file(${LIB_SYMS} ${libfile}.syms)
+      install(FILES ${libfile}.syms
+        DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+    endif(LIB_SYMS)
+  else()
+    message(FATAL_ERROR "Archtecture ${arch} can't be targeted")
+  endif()
+endmacro()
+
+# Same as add_compiler_rt_static_runtime, but creates a universal library
+# for several architectures.
+# add_compiler_rt_osx_static_runtime(<name> ARCH <architectures>
+#                                    SOURCES <source files>
+#                                    CFLAGS <compile flags>
+#                                    DEFS <compile definitions>)
+macro(add_compiler_rt_osx_static_runtime name)
+  parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN})
+  add_library(${name} STATIC ${LIB_SOURCES})
+  set_target_compile_flags(${name} ${LIB_CFLAGS})
+  set_property(TARGET ${name} APPEND PROPERTY
+    COMPILE_DEFINITIONS ${LIB_DEFS})
+  set_target_properties(${name} PROPERTIES
+    OSX_ARCHITECTURES "${LIB_ARCH}"
+    ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
+  install(TARGETS ${name}
+    ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+endmacro()
+
+# Adds dynamic runtime library on osx, which supports multiple architectures.
+# add_compiler_rt_osx_dynamic_runtime(<name> ARCH <architectures>
+#                                     SOURCES <source files>
+#                                     CFLAGS <compile flags>
+#                                     DEFS <compile definitions>
+#                                     LINKFLAGS <link flags>)
+macro(add_compiler_rt_osx_dynamic_runtime name)
+  parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS;LINKFLAGS" "" ${ARGN})
+  add_library(${name} SHARED ${LIB_SOURCES})
+  set_target_compile_flags(${name} ${LIB_CFLAGS})
+  set_target_link_flags(${name} ${LIB_LINKFLAGS})
+  set_property(TARGET ${name} APPEND PROPERTY
+    COMPILE_DEFINITIONS ${LIB_DEFS})
+  set_target_properties(${name} PROPERTIES
+    OSX_ARCHITECTURES "${LIB_ARCH}"
+    LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR})
+  install(TARGETS ${name}
+    LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR})
+endmacro()
+
 # Unittests support.
 set(COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest)
 set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/gtest-all.cc)
@@ -35,15 +121,21 @@ set(COMPILER_RT_GTEST_INCLUDE_CFLAGS
 #                      LINK_FLAGS <link flags>)
 macro(add_compiler_rt_test test_suite test_name)
   parse_arguments(TEST "OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN})
-  get_unittest_directory(OUTPUT_DIR)
-  file(MAKE_DIRECTORY ${OUTPUT_DIR})
-  set(output_bin "${OUTPUT_DIR}/${test_name}")
-  add_custom_command(
-    OUTPUT ${output_bin}
+  set(output_bin "${CMAKE_CURRENT_BINARY_DIR}/${test_name}")
+  add_custom_target(${test_name}
     COMMAND clang ${TEST_OBJECTS} -o "${output_bin}"
             ${TEST_LINK_FLAGS}
     DEPENDS clang ${TEST_DEPS})
-  add_custom_target(${test_name} DEPENDS ${output_bin})
   # Make the test suite depend on the binary.
   add_dependencies(${test_suite} ${test_name})
 endmacro()
+
+macro(add_compiler_rt_resource_file target_name file_name)
+  set(src_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_name}")
+  set(dst_file "${CLANG_RESOURCE_DIR}/${file_name}")
+  add_custom_target(${target_name}
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src_file} ${dst_file}
+    DEPENDS ${file_name})
+  # Install in Clang resource directory.
+  install(FILES ${file_name} DESTINATION ${LIBCLANG_INSTALL_PATH})
+endmacro()

Modified: vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake
==============================================================================
--- vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake	Mon May 27 18:27:12 2013	(r251034)
@@ -15,3 +15,14 @@ function(set_target_link_flags target)
   set_property(TARGET ${target} PROPERTY LINK_FLAGS "${argstring}")
 endfunction()
 
+# Check if a given flag is present in a space-separated flag_string.
+# Store the result in out_var.
+function(find_flag_in_string flag_string flag out_var)
+  string(REPLACE " " ";" flag_list ${flag_string})
+  list(FIND flag_list ${flag} flag_pos)
+  if(NOT flag_pos EQUAL -1)
+    set(${out_var} TRUE PARENT_SCOPE)
+  else()
+    set(${out_var} FALSE PARENT_SCOPE)
+  endif()
+endfunction()

Added: vendor/compiler-rt/dist/include/CMakeLists.txt
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/compiler-rt/dist/include/CMakeLists.txt	Mon May 27 18:27:12 2013	(r251034)
@@ -0,0 +1,39 @@
+set(SANITIZER_HEADERS
+  sanitizer/asan_interface.h
+  sanitizer/common_interface_defs.h
+  sanitizer/linux_syscall_hooks.h
+  sanitizer/msan_interface.h)
+
+set(output_dir ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/include)
+
+if(MSVC_IDE OR XCODE)
+   set(other_output_dir ${LLVM_BINARY_DIR}/bin/lib/clang/${CLANG_VERSION}/include)
+endif()
+
+# Copy compiler-rt headers to the build tree.
+set(out_files)
+foreach( f ${SANITIZER_HEADERS} )
+  set( src ${CMAKE_CURRENT_SOURCE_DIR}/${f} )
+  set( dst ${output_dir}/${f} )
+  add_custom_command(OUTPUT ${dst}
+    DEPENDS ${src}
+    COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${dst}
+    COMMENT "Copying compiler-rt's ${f}...")
+  list(APPEND out_files ${dst})
+
+  if(other_output_dir)
+   set(other_dst ${other_output_dir}/${f})
+    add_custom_command(OUTPUT ${other_dst}
+      DEPENDS ${src}
+      COMMAND ${CMAKE_COMMAND} -E copy_if_different ${src} ${other_dst}
+      COMMENT "Copying compiler-rt's ${f}...")    
+    list(APPEND out_files ${other_dst})
+  endif()
+endforeach( f )
+
+add_custom_target(compiler-rt-headers ALL DEPENDS ${out_files})
+
+# Install sanitizer headers.
+install(FILES ${SANITIZER_HEADERS}
+  PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
+  DESTINATION ${LIBCLANG_INSTALL_PATH}/include/sanitizer)

Modified: vendor/compiler-rt/dist/include/sanitizer/asan_interface.h
==============================================================================
--- vendor/compiler-rt/dist/include/sanitizer/asan_interface.h	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/include/sanitizer/asan_interface.h	Mon May 27 18:27:12 2013	(r251034)
@@ -7,69 +7,18 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file is a part of AddressSanitizer, an address sanity checker.
+// This file is a part of AddressSanitizer.
 //
-// This header can be included by the instrumented program to fetch
-// data (mostly allocator statistics) from ASan runtime library.
+// Public interface header.
 //===----------------------------------------------------------------------===//
 #ifndef SANITIZER_ASAN_INTERFACE_H
 #define SANITIZER_ASAN_INTERFACE_H
 
 #include <sanitizer/common_interface_defs.h>
 
-// ----------- ATTENTION -------------
-// This header should NOT include any other headers from ASan runtime.
-// All functions in this header are extern "C" and start with __asan_.
-
-using __sanitizer::uptr;
-
+#ifdef __cplusplus
 extern "C" {
-  // This function should be called at the very beginning of the process,
-  // before any instrumented code is executed and before any call to malloc.
-  void __asan_init() SANITIZER_INTERFACE_ATTRIBUTE;
-
-  // This structure describes an instrumented global variable.
-  struct __asan_global {
-    uptr beg;                // The address of the global.
-    uptr size;               // The original size of the global.
-    uptr size_with_redzone;  // The size with the redzone.
-    const char *name;        // Name as a C string.
-    uptr has_dynamic_init;   // Non-zero if the global has dynamic initializer.
-  };
-
-  // These two functions should be called by the instrumented code.
-  // 'globals' is an array of structures describing 'n' globals.
-  void __asan_register_globals(__asan_global *globals, uptr n)
-      SANITIZER_INTERFACE_ATTRIBUTE;
-  void __asan_unregister_globals(__asan_global *globals, uptr n)
-      SANITIZER_INTERFACE_ATTRIBUTE;
-
-  // These two functions should be called before and after dynamic initializers
-  // run, respectively.  They should be called with parameters describing all
-  // dynamically initialized globals defined in the calling TU.
-  void __asan_before_dynamic_init(uptr first_addr, uptr last_addr)
-      SANITIZER_INTERFACE_ATTRIBUTE;
-  void __asan_after_dynamic_init()
-      SANITIZER_INTERFACE_ATTRIBUTE;
-
-  // These two functions are used by the instrumented code in the
-  // use-after-return mode. __asan_stack_malloc allocates size bytes of
-  // fake stack and __asan_stack_free poisons it. real_stack is a pointer to
-  // the real stack region.
-  uptr __asan_stack_malloc(uptr size, uptr real_stack)
-      SANITIZER_INTERFACE_ATTRIBUTE;
-  void __asan_stack_free(uptr ptr, uptr size, uptr real_stack)
-      SANITIZER_INTERFACE_ATTRIBUTE;
-
-  // These two functions are used by instrumented code in the
-  // use-after-scope mode. They mark memory for local variables as
-  // unaddressable when they leave scope and addressable before the
-  // function exits.
-  void __asan_poison_stack_memory(uptr addr, uptr size)
-      SANITIZER_INTERFACE_ATTRIBUTE;
-  void __asan_unpoison_stack_memory(uptr addr, uptr size)
-      SANITIZER_INTERFACE_ATTRIBUTE;
-
+#endif
   // Marks memory region [addr, addr+size) as unaddressable.
   // This memory must be previously allocated by the user program. Accessing
   // addresses in this region from instrumented code is forbidden until
@@ -78,8 +27,7 @@ extern "C" {
   // to ASan alignment restrictions.
   // Method is NOT thread-safe in the sense that no two threads can
   // (un)poison memory in the same memory region simultaneously.
-  void __asan_poison_memory_region(void const volatile *addr, uptr size)
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  void __asan_poison_memory_region(void const volatile *addr, size_t size);
   // Marks memory region [addr, addr+size) as addressable.
   // This memory must be previously allocated by the user program. Accessing
   // addresses in this region is allowed until this region is poisoned again.
@@ -87,15 +35,10 @@ extern "C" {
   // ASan alignment restrictions.
   // Method is NOT thread-safe in the sense that no two threads can
   // (un)poison memory in the same memory region simultaneously.
-  void __asan_unpoison_memory_region(void const volatile *addr, uptr size)
-      SANITIZER_INTERFACE_ATTRIBUTE;
-
-  // Performs cleanup before a NoReturn function. Must be called before things
-  // like _exit and execl to avoid false positives on stack.
-  void __asan_handle_no_return() SANITIZER_INTERFACE_ATTRIBUTE;
+  void __asan_unpoison_memory_region(void const volatile *addr, size_t size);
 
-// User code should use macro instead of functions.
-#if __has_feature(address_sanitizer)
+// User code should use macros instead of functions.
+#if __has_feature(address_sanitizer) || defined(__SANITIZE_ADDRESS__)
 #define ASAN_POISON_MEMORY_REGION(addr, size) \
   __asan_poison_memory_region((addr), (size))
 #define ASAN_UNPOISON_MEMORY_REGION(addr, size) \
@@ -109,104 +52,86 @@ extern "C" {
 
   // Returns true iff addr is poisoned (i.e. 1-byte read/write access to this
   // address will result in error report from AddressSanitizer).
-  bool __asan_address_is_poisoned(void const volatile *addr)
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  bool __asan_address_is_poisoned(void const volatile *addr);
 
   // If at least on byte in [beg, beg+size) is poisoned, return the address
   // of the first such byte. Otherwise return 0.
-  uptr __asan_region_is_poisoned(uptr beg, uptr size)
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  void *__asan_region_is_poisoned(void *beg, size_t size);
 
   // Print the description of addr (useful when debugging in gdb).
-  void __asan_describe_address(uptr addr)
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  void __asan_describe_address(void *addr);
 
   // This is an internal function that is called to report an error.
   // However it is still a part of the interface because users may want to
   // set a breakpoint on this function in a debugger.
-  void __asan_report_error(uptr pc, uptr bp, uptr sp,
-                           uptr addr, bool is_write, uptr access_size)
-    SANITIZER_INTERFACE_ATTRIBUTE;
+  void __asan_report_error(void *pc, void *bp, void *sp,
+                           void *addr, bool is_write, size_t access_size);
 
   // Sets the exit code to use when reporting an error.
   // Returns the old value.
-  int __asan_set_error_exit_code(int exit_code)
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  int __asan_set_error_exit_code(int exit_code);
 
   // Sets the callback to be called right before death on error.
   // Passing 0 will unset the callback.
-  void __asan_set_death_callback(void (*callback)(void))
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  void __asan_set_death_callback(void (*callback)(void));
 
-  void __asan_set_error_report_callback(void (*callback)(const char*))
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  void __asan_set_error_report_callback(void (*callback)(const char*));
 
   // User may provide function that would be called right when ASan detects
   // an error. This can be used to notice cases when ASan detects an error, but
   // the program crashes before ASan report is printed.
-  /* OPTIONAL */ void __asan_on_error()
-      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+  void __asan_on_error();
 
   // User may provide its own implementation for symbolization function.
   // It should print the description of instruction at address "pc" to
   // "out_buffer". Description should be at most "out_size" bytes long.
   // User-specified function should return true if symbolization was
   // successful.
-  /* OPTIONAL */ bool __asan_symbolize(const void *pc, char *out_buffer,
-                                       int out_size)
-      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+  bool __asan_symbolize(const void *pc, char *out_buffer,
+                                       int out_size);
 
   // Returns the estimated number of bytes that will be reserved by allocator
   // for request of "size" bytes. If ASan allocator can't allocate that much
   // memory, returns the maximal possible allocation size, otherwise returns
   // "size".
-  uptr __asan_get_estimated_allocated_size(uptr size)
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  size_t __asan_get_estimated_allocated_size(size_t size);
   // Returns true if p was returned by the ASan allocator and
   // is not yet freed.
-  bool __asan_get_ownership(const void *p)
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  bool __asan_get_ownership(const void *p);
   // Returns the number of bytes reserved for the pointer p.
   // Requires (get_ownership(p) == true) or (p == 0).
-  uptr __asan_get_allocated_size(const void *p)
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  size_t __asan_get_allocated_size(const void *p);
   // Number of bytes, allocated and not yet freed by the application.
-  uptr __asan_get_current_allocated_bytes()
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  size_t __asan_get_current_allocated_bytes();
   // Number of bytes, mmaped by asan allocator to fulfill allocation requests.
   // Generally, for request of X bytes, allocator can reserve and add to free
   // lists a large number of chunks of size X to use them for future requests.
   // All these chunks count toward the heap size. Currently, allocator never
   // releases memory to OS (instead, it just puts freed chunks to free lists).
-  uptr __asan_get_heap_size()
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  size_t __asan_get_heap_size();
   // Number of bytes, mmaped by asan allocator, which can be used to fulfill
   // allocation requests. When a user program frees memory chunk, it can first
   // fall into quarantine and will count toward __asan_get_free_bytes() later.
-  uptr __asan_get_free_bytes()
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  size_t __asan_get_free_bytes();
   // Number of bytes in unmapped pages, that are released to OS. Currently,
   // always returns 0.
-  uptr __asan_get_unmapped_bytes()
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  size_t __asan_get_unmapped_bytes();
   // Prints accumulated stats to stderr. Used for debugging.
-  void __asan_print_accumulated_stats()
-      SANITIZER_INTERFACE_ATTRIBUTE;
+  void __asan_print_accumulated_stats();
 
   // This function may be optionally provided by user and should return
   // a string containing ASan runtime options. See asan_flags.h for details.
-  /* OPTIONAL */ const char* __asan_default_options()
-      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+  const char* __asan_default_options();
 
   // Malloc hooks that may be optionally provided by user.
   // __asan_malloc_hook(ptr, size) is called immediately after
   //   allocation of "size" bytes, which returned "ptr".
   // __asan_free_hook(ptr) is called immediately before
   //   deallocation of "ptr".
-  /* OPTIONAL */ void __asan_malloc_hook(void *ptr, uptr size)
-      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
-  /* OPTIONAL */ void __asan_free_hook(void *ptr)
-      SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE;
+  void __asan_malloc_hook(void *ptr, size_t size);
+  void __asan_free_hook(void *ptr);
+#ifdef __cplusplus
 }  // extern "C"
+#endif
 
 #endif  // SANITIZER_ASAN_INTERFACE_H

Modified: vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h
==============================================================================
--- vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h	Mon May 27 18:26:08 2013	(r251033)
+++ vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h	Mon May 27 18:27:12 2013	(r251034)
@@ -7,86 +7,52 @@
 //
 //===----------------------------------------------------------------------===//
 //
-// This file is shared between AddressSanitizer and ThreadSanitizer.
-// It contains basic macro and types.
-// NOTE: This file may be included into user code.
+// Common part of the public sanitizer interface.
 //===----------------------------------------------------------------------===//
 
 #ifndef SANITIZER_COMMON_INTERFACE_DEFS_H
 #define SANITIZER_COMMON_INTERFACE_DEFS_H
 
-// ----------- ATTENTION -------------
-// This header should NOT include any other headers to avoid portability issues.
+#include <stddef.h>
+#include <stdint.h>
 
-#if defined(_WIN32)
-// FIXME find out what we need on Windows. __declspec(dllexport) ?
-# define SANITIZER_INTERFACE_ATTRIBUTE
-# define SANITIZER_WEAK_ATTRIBUTE
-#elif defined(SANITIZER_GO)
-# define SANITIZER_INTERFACE_ATTRIBUTE
-# define SANITIZER_WEAK_ATTRIBUTE
-#else
-# define SANITIZER_INTERFACE_ATTRIBUTE __attribute__((visibility("default")))
-# define SANITIZER_WEAK_ATTRIBUTE  __attribute__((weak))
-#endif
-
-#ifdef __linux__
-# define SANITIZER_SUPPORTS_WEAK_HOOKS 1
-#else
-# define SANITIZER_SUPPORTS_WEAK_HOOKS 0
-#endif
-
-// __has_feature
+// GCC does not understand __has_feature.
 #if !defined(__has_feature)
 # define __has_feature(x) 0
 #endif
 
-// For portability reasons we do not include stddef.h, stdint.h or any other
-// system header, but we do need some basic types that are not defined
-// in a portable way by the language itself.
-namespace __sanitizer {
-
-#if defined(_WIN64)
-// 64-bit Windows uses LLP64 data model.
-typedef unsigned long long uptr;  // NOLINT
-typedef signed   long long sptr;  // NOLINT
-#else
-typedef unsigned long uptr;  // NOLINT
-typedef signed   long sptr;  // NOLINT
-#endif  // defined(_WIN64)
-#if defined(__x86_64__)
-// Since x32 uses ILP32 data model in 64-bit hardware mode,  we must use
-// 64-bit pointer to unwind stack frame.

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201305271827.r4RIRCJp005145>