Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 10 Sep 2015 20:35:48 +0000 (UTC)
From:      Dimitry Andric <dim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r287626 - in projects/clang370-import: contrib/compiler-rt contrib/compiler-rt/include/sanitizer contrib/compiler-rt/lib/asan contrib/compiler-rt/lib/asan/scripts contrib/compiler-rt/li...
Message-ID:  <201509102035.t8AKZm4J082868@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dim
Date: Thu Sep 10 20:35:47 2015
New Revision: 287626
URL: https://svnweb.freebsd.org/changeset/base/287626

Log:
  Update compiler-rt to 3.7.0 release.  This also includes the sanitizer
  and profile libraries.

Added:
  projects/clang370-import/contrib/compiler-rt/lib/builtins/atomic_flag_clear.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/atomic_flag_clear.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/atomic_flag_clear_explicit.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/atomic_flag_clear_explicit.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/atomic_flag_test_and_set.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/atomic_flag_test_and_set.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/atomic_flag_test_and_set_explicit.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/atomic_flag_test_and_set_explicit.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/atomic_signal_fence.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/atomic_signal_fence.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/atomic_thread_fence.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/atomic_thread_fence.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/extendhfsf2.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/extendhfsf2.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/i386/chkstk.S
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/i386/chkstk.S
  projects/clang370-import/contrib/compiler-rt/lib/builtins/truncdfhf2.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/truncdfhf2.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/truncsfhf2.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/truncsfhf2.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/x86_64/chkstk.S
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/x86_64/chkstk.S
  projects/clang370-import/contrib/compiler-rt/lib/profile/InstrProfilingUtil.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/profile/InstrProfilingUtil.c
  projects/clang370-import/contrib/compiler-rt/lib/profile/InstrProfilingUtil.h
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/profile/InstrProfilingUtil.h
  projects/clang370-import/contrib/compiler-rt/lib/safestack/
     - copied from r287599, vendor/compiler-rt/dist/lib/safestack/
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.h
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_posix.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_internal.h
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_internal.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_mac.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.h
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_mac.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_process_libcdep.cc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_process_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.h
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_win.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors.h
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interceptors.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_new_delete.cc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/tsan/rtl/tsan_new_delete.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_init_standalone.cc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/ubsan/ubsan_init_standalone.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_platform.h
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/ubsan/ubsan_platform.h
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_itanium.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_type_hash_win.cc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash_win.cc
  projects/clang370-import/lib/libclang_rt/asan-preinit/
  projects/clang370-import/lib/libclang_rt/asan-preinit/Makefile   (contents, props changed)
  projects/clang370-import/lib/libclang_rt/ubsan_standalone/
     - copied from r287599, projects/clang370-import/lib/libclang_rt/ubsan/
  projects/clang370-import/lib/libclang_rt/ubsan_standalone_cxx/
     - copied from r287599, projects/clang370-import/lib/libclang_rt/ubsan_cxx/
Replaced:
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixtfdi.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/fixtfdi.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixtfsi.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/fixtfsi.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixtfti.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/fixtfti.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixunstfdi.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/fixunstfdi.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixunstfsi.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/fixunstfsi.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixunstfti.c
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/fixunstfti.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fp_fixint_impl.inc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/fp_fixint_impl.inc
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fp_fixuint_impl.inc
     - copied unchanged from r287599, vendor/compiler-rt/dist/lib/builtins/fp_fixuint_impl.inc
Deleted:
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_unwind_posix_libcdep.cc
  projects/clang370-import/lib/libclang_rt/san/
  projects/clang370-import/lib/libclang_rt/ubsan/
  projects/clang370-import/lib/libclang_rt/ubsan_cxx/
Modified:
  projects/clang370-import/contrib/compiler-rt/LICENSE.TXT
  projects/clang370-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h
  projects/clang370-import/contrib/compiler-rt/include/sanitizer/dfsan_interface.h
  projects/clang370-import/contrib/compiler-rt/include/sanitizer/lsan_interface.h
  projects/clang370-import/contrib/compiler-rt/include/sanitizer/msan_interface.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_allocator.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_allocator.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_fake_stack.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_flags.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_globals.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interceptors.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interceptors.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interface_internal.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_internal.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_linux.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_mac.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_mapping.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_poisoning.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_poisoning.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_posix.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_report.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_report.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_rtl.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_stats.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_stats.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_suppressions.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_suppressions.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_thread.h
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_win.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_win_dll_thunk.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/asan_win_dynamic_runtime_thunk.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/scripts/asan_symbolize.py
  projects/clang370-import/contrib/compiler-rt/lib/asan/tests/asan_asm_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/tests/asan_str_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/asan/tests/asan_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/builtins/clear_cache.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/enable_execute_stack.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixdfdi.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixsfdi.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixunsdfdi.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixunsdfti.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fixunssfdi.c
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fp_extend.h
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fp_extend_impl.inc
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fp_trunc.h
  projects/clang370-import/contrib/compiler-rt/lib/builtins/fp_trunc_impl.inc
  projects/clang370-import/contrib/compiler-rt/lib/builtins/int_endianness.h
  projects/clang370-import/contrib/compiler-rt/lib/builtins/int_lib.h
  projects/clang370-import/contrib/compiler-rt/lib/dfsan/dfsan.cc
  projects/clang370-import/contrib/compiler-rt/lib/dfsan/dfsan_custom.cc
  projects/clang370-import/contrib/compiler-rt/lib/dfsan/done_abilist.txt
  projects/clang370-import/contrib/compiler-rt/lib/dfsan/scripts/check_custom_wrappers.sh
  projects/clang370-import/contrib/compiler-rt/lib/interception/interception.h
  projects/clang370-import/contrib/compiler-rt/lib/interception/interception_win.cc
  projects/clang370-import/contrib/compiler-rt/lib/lsan/lsan_common.cc
  projects/clang370-import/contrib/compiler-rt/lib/lsan/lsan_common.h
  projects/clang370-import/contrib/compiler-rt/lib/lsan/lsan_common_linux.cc
  projects/clang370-import/contrib/compiler-rt/lib/lsan/lsan_interceptors.cc
  projects/clang370-import/contrib/compiler-rt/lib/lsan/lsan_thread.h
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan.cc
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan.h
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan.syms.extra
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan_allocator.cc
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan_interceptors.cc
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan_interface_internal.h
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan_linux.cc
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan_new_delete.cc
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan_origin.h
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan_poisoning.cc
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan_report.cc
  projects/clang370-import/contrib/compiler-rt/lib/msan/msan_thread.cc
  projects/clang370-import/contrib/compiler-rt/lib/msan/tests/msan_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/profile/GCDAProfiling.c
  projects/clang370-import/contrib/compiler-rt/lib/profile/InstrProfiling.h
  projects/clang370-import/contrib/compiler-rt/lib/profile/InstrProfilingFile.c
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_allocator.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_atomic.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_atomic_msvc.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors_ioctl.inc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_common_syscalls.inc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_coverage_mapping_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_deadlock_detector1.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flags.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_libc.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_libignore.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_mac.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_interceptors.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_platform_limits_posix.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_posix_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_mac.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_stoptheworld_linux_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_suppressions.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libbacktrace.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_posix_libcdep.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_win.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_tls_get_addr.h
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/sanitizer_win.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/scripts/check_lint.sh
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/scripts/cpplint.py
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/scripts/gen_dynamic_list.py
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/scripts/litlint.py
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/scripts/sancov.py
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/tests/sanitizer_posix_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/tests/sanitizer_procmaps_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/sanitizer_common/tests/sanitizer_stoptheworld_test.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/dd/dd_rtl.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/go/buildgo.sh
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan.syms.extra
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_defs.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_fd.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_fd.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_flags.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interceptors.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interface.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interface.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_interface_inl.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_mman.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_linux.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_platform_mac.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_report.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_mutex.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_rtl_thread.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_suppressions.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_suppressions.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_symbolize.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_symbolize.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_sync.cc
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_sync.h
  projects/clang370-import/contrib/compiler-rt/lib/tsan/rtl/tsan_update_shadow_word_inl.h
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_diag.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_diag.h
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_flags.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_flags.h
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_handlers.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_handlers_cxx.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_handlers_cxx.h
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_init.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_init.h
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_type_hash.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_type_hash.h
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_value.cc
  projects/clang370-import/contrib/compiler-rt/lib/ubsan/ubsan_value.h
  projects/clang370-import/lib/libclang_rt/Makefile
  projects/clang370-import/lib/libclang_rt/Makefile.inc
  projects/clang370-import/lib/libclang_rt/asan/Makefile
  projects/clang370-import/lib/libclang_rt/asan_cxx/Makefile
  projects/clang370-import/lib/libclang_rt/profile/Makefile
  projects/clang370-import/lib/libclang_rt/ubsan_standalone/Makefile
  projects/clang370-import/lib/libclang_rt/ubsan_standalone_cxx/Makefile
  projects/clang370-import/lib/libcompiler_rt/Makefile
Directory Properties:
  projects/clang370-import/contrib/compiler-rt/   (props changed)

Modified: projects/clang370-import/contrib/compiler-rt/LICENSE.TXT
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/LICENSE.TXT	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/LICENSE.TXT	Thu Sep 10 20:35:47 2015	(r287626)
@@ -14,7 +14,7 @@ Full text of the relevant licenses is in
 University of Illinois/NCSA
 Open Source License
 
-Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
+Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
 
 All rights reserved.
 
@@ -55,7 +55,7 @@ SOFTWARE.
 
 ==============================================================================
 
-Copyright (c) 2009-2014 by the contributors listed in CREDITS.TXT
+Copyright (c) 2009-2015 by the contributors listed in CREDITS.TXT
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal

Modified: projects/clang370-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/include/sanitizer/coverage_interface.h	Thu Sep 10 20:35:47 2015	(r287626)
@@ -39,6 +39,23 @@ extern "C" {
   // Some of the entries in *data will be zero.
   uintptr_t __sanitizer_get_coverage_guards(uintptr_t **data);
 
+  // The coverage instrumentation may optionally provide imprecise counters.
+  // Rather than exposing the counter values to the user we instead map
+  // the counters to a bitset.
+  // Every counter is associated with 8 bits in the bitset.
+  // We define 8 value ranges: 1, 2, 3, 4-7, 8-15, 16-31, 32-127, 128+
+  // The i-th bit is set to 1 if the counter value is in the i-th range.
+  // This counter-based coverage implementation is *not* thread-safe.
+
+  // Returns the number of registered coverage counters.
+  uintptr_t __sanitizer_get_number_of_counters();
+  // Updates the counter 'bitset', clears the counters and returns the number of
+  // new bits in 'bitset'.
+  // If 'bitset' is nullptr, only clears the counters.
+  // Otherwise 'bitset' should be at least
+  // __sanitizer_get_number_of_counters bytes long and 8-aligned.
+  uintptr_t
+  __sanitizer_update_counter_bitset_and_clear_counters(uint8_t *bitset);
 #ifdef __cplusplus
 }  // extern "C"
 #endif

Modified: projects/clang370-import/contrib/compiler-rt/include/sanitizer/dfsan_interface.h
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/include/sanitizer/dfsan_interface.h	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/include/sanitizer/dfsan_interface.h	Thu Sep 10 20:35:47 2015	(r287626)
@@ -91,6 +91,16 @@ void dfsan_set_write_callback(dfsan_writ
 /// <label> <parent label 1> <parent label 2> <label description if any>
 void dfsan_dump_labels(int fd);
 
+/// Whenever a dfsan's custom function is called the corresponding
+/// hook is called it non-zero. The hooks should be defined by the user.
+/// The primary use case is taint-guided fuzzing, where the fuzzer
+/// needs to see the parameters of the function and the labels.
+/// FIXME: implement more hooks.
+
+/// memcmp hook.
+void dfsan_weak_hook_memcmp(void *caller_pc, const void *s1, const void *s2,
+                            size_t n, dfsan_label s1_label,
+                            dfsan_label s2_label, dfsan_label n_label);
 #ifdef __cplusplus
 }  // extern "C"
 

Modified: projects/clang370-import/contrib/compiler-rt/include/sanitizer/lsan_interface.h
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/include/sanitizer/lsan_interface.h	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/include/sanitizer/lsan_interface.h	Thu Sep 10 20:35:47 2015	(r287626)
@@ -41,14 +41,25 @@ extern "C" {
   void __lsan_register_root_region(const void *p, size_t size);
   void __lsan_unregister_root_region(const void *p, size_t size);
 
-  // Calling this function makes LSan enter the leak checking phase immediately.
-  // Use this if normal end-of-process leak checking happens too late (e.g. if
-  // you have intentional memory leaks in your shutdown code). Calling this
-  // function overrides end-of-process leak checking; it must be called at
-  // most once per process. This function will terminate the process if there
-  // are memory leaks and the exit_code flag is non-zero.
+  // Check for leaks now. This function behaves identically to the default
+  // end-of-process leak check. In particular, it will terminate the process if
+  // leaks are found and the exit_code flag is non-zero.
+  // Subsequent calls to this function will have no effect and end-of-process
+  // leak check will not run. Effectively, end-of-process leak check is moved to
+  // the time of first invocation of this function.
+  // By calling this function early during process shutdown, you can instruct
+  // LSan to ignore shutdown-only leaks which happen later on.
   void __lsan_do_leak_check();
 
+  // Check for leaks now. Returns zero if no leaks have been found or if leak
+  // detection is disabled, non-zero otherwise.
+  // This function may be called repeatedly, e.g. to periodically check a
+  // long-running process. It prints a leak report if appropriate, but does not
+  // terminate the process. It does not affect the behavior of
+  // __lsan_do_leak_check() or the end-of-process leak check, and is not
+  // affected by them.
+  int __lsan_do_recoverable_leak_check();
+
   // The user may optionally provide this function to disallow leak checking
   // for the program it is linked into (if the return value is non-zero). This
   // function must be defined as returning a constant value; any behavior beyond

Modified: projects/clang370-import/contrib/compiler-rt/include/sanitizer/msan_interface.h
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/include/sanitizer/msan_interface.h	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/include/sanitizer/msan_interface.h	Thu Sep 10 20:35:47 2015	(r287626)
@@ -25,6 +25,11 @@ extern "C" {
   /* Get raw origin for an address. */
   uint32_t __msan_get_origin(const volatile void *a);
 
+  /* Test that this_id is a descendant of prev_id (or they are simply equal).
+   * "descendant" here means they are part of the same chain, created with
+   * __msan_chain_origin. */
+  int __msan_origin_is_descendant_or_same(uint32_t this_id, uint32_t prev_id);
+
   /* Returns non-zero if tracking origins. */
   int __msan_get_track_origins();
 

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_allocator.cc
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_allocator.cc	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_allocator.cc	Thu Sep 10 20:35:47 2015	(r287626)
@@ -223,7 +223,7 @@ void AllocatorOptions::CopyTo(Flags *f, 
 
 struct Allocator {
   static const uptr kMaxAllowedMallocSize =
-      FIRST_32_SECOND_64(3UL << 30, 64UL << 30);
+      FIRST_32_SECOND_64(3UL << 30, 1UL << 40);
   static const uptr kMaxThreadLocalQuarantine =
       FIRST_32_SECOND_64(1 << 18, 1 << 20);
 
@@ -354,7 +354,7 @@ struct Allocator {
     }
     CHECK(IsAligned(needed_size, min_alignment));
     if (size > kMaxAllowedMallocSize || needed_size > kMaxAllowedMallocSize) {
-      Report("WARNING: AddressSanitizer failed to allocate %p bytes\n",
+      Report("WARNING: AddressSanitizer failed to allocate 0x%zx bytes\n",
              (void*)size);
       return allocator.ReturnNullOrDie();
     }
@@ -437,11 +437,10 @@ struct Allocator {
     thread_stats.mallocs++;
     thread_stats.malloced += size;
     thread_stats.malloced_redzones += needed_size - size;
-    uptr class_id =
-        Min(kNumberOfSizeClasses, SizeClassMap::ClassID(needed_size));
-    thread_stats.malloced_by_size[class_id]++;
     if (needed_size > SizeClassMap::kMaxSize)
       thread_stats.malloc_large++;
+    else
+      thread_stats.malloced_by_size[SizeClassMap::ClassID(needed_size)]++;
 
     void *res = reinterpret_cast<void *>(user_beg);
     if (can_fill && fl.max_malloc_fill_size) {

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_allocator.h
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_allocator.h	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_allocator.h	Thu Sep 10 20:35:47 2015	(r287626)
@@ -29,7 +29,6 @@ enum AllocType {
   FROM_NEW_BR = 3   // Memory block came from operator new [ ]
 };
 
-static const uptr kNumberOfSizeClasses = 255;
 struct AsanChunk;
 
 struct AllocatorOptions {
@@ -137,6 +136,7 @@ typedef SizeClassAllocator32<0, SANITIZE
   AsanMapUnmapCallback> PrimaryAllocator;
 #endif  // SANITIZER_CAN_USE_ALLOCATOR64
 
+static const uptr kNumberOfSizeClasses = SizeClassMap::kNumClasses;
 typedef SizeClassAllocatorLocalCache<PrimaryAllocator> AllocatorCache;
 typedef LargeMmapAllocator<AsanMapUnmapCallback> SecondaryAllocator;
 typedef CombinedAllocator<PrimaryAllocator, AllocatorCache,

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_fake_stack.cc
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_fake_stack.cc	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_fake_stack.cc	Thu Sep 10 20:35:47 2015	(r287626)
@@ -22,6 +22,9 @@ static const u64 kMagic2 = (kMagic1 << 8
 static const u64 kMagic4 = (kMagic2 << 16) | kMagic2;
 static const u64 kMagic8 = (kMagic4 << 32) | kMagic4;
 
+static const u64 kAllocaRedzoneSize = 32UL;
+static const u64 kAllocaRedzoneMask = 31UL;
+
 // For small size classes inline PoisonShadow for better performance.
 ALWAYS_INLINE void SetShadow(uptr ptr, uptr size, uptr class_id, u64 magic) {
   CHECK_EQ(SHADOW_SCALE, 3);  // This code expects SHADOW_SCALE=3.
@@ -253,4 +256,24 @@ void *__asan_addr_is_in_fake_stack(void 
   if (end) *end = reinterpret_cast<void*>(frame_end);
   return reinterpret_cast<void*>(frame->real_stack);
 }
+
+SANITIZER_INTERFACE_ATTRIBUTE
+void __asan_alloca_poison(uptr addr, uptr size) {
+  uptr LeftRedzoneAddr = addr - kAllocaRedzoneSize;
+  uptr PartialRzAddr = addr + size;
+  uptr RightRzAddr = (PartialRzAddr + kAllocaRedzoneMask) & ~kAllocaRedzoneMask;
+  uptr PartialRzAligned = PartialRzAddr & ~(SHADOW_GRANULARITY - 1);
+  FastPoisonShadow(LeftRedzoneAddr, kAllocaRedzoneSize, kAsanAllocaLeftMagic);
+  FastPoisonShadowPartialRightRedzone(
+      PartialRzAligned, PartialRzAddr % SHADOW_GRANULARITY,
+      RightRzAddr - PartialRzAligned, kAsanAllocaRightMagic);
+  FastPoisonShadow(RightRzAddr, kAllocaRedzoneSize, kAsanAllocaRightMagic);
+}
+
+SANITIZER_INTERFACE_ATTRIBUTE
+void __asan_allocas_unpoison(uptr top, uptr bottom) {
+  if ((!top) || (top > bottom)) return;
+  REAL(memset)(reinterpret_cast<void*>(MemToShadow(top)), 0,
+               (bottom - top) / SHADOW_GRANULARITY);
+}
 }  // extern "C"

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_flags.cc
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_flags.cc	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_flags.cc	Thu Sep 10 20:35:47 2015	(r287626)
@@ -20,6 +20,8 @@
 #include "sanitizer_common/sanitizer_common.h"
 #include "sanitizer_common/sanitizer_flags.h"
 #include "sanitizer_common/sanitizer_flag_parser.h"
+#include "ubsan/ubsan_flags.h"
+#include "ubsan/ubsan_platform.h"
 
 namespace __asan {
 
@@ -72,8 +74,8 @@ void InitializeFlags() {
   RegisterAsanFlags(&asan_parser, f);
   RegisterCommonFlags(&asan_parser);
 
-  // Set the default values and prepare for parsing LSan flags (which can also
-  // overwrite common flags).
+  // Set the default values and prepare for parsing LSan and UBSan flags
+  // (which can also overwrite common flags).
 #if CAN_SANITIZE_LEAKS
   __lsan::Flags *lf = __lsan::flags();
   lf->SetDefaults();
@@ -83,6 +85,15 @@ void InitializeFlags() {
   RegisterCommonFlags(&lsan_parser);
 #endif
 
+#if CAN_SANITIZE_UB
+  __ubsan::Flags *uf = __ubsan::flags();
+  uf->SetDefaults();
+
+  FlagParser ubsan_parser;
+  __ubsan::RegisterUbsanFlags(&ubsan_parser, uf);
+  RegisterCommonFlags(&ubsan_parser);
+#endif
+
   // Override from ASan compile definition.
   const char *asan_compile_def = MaybeUseAsanDefaultOptionsCompileDefinition();
   asan_parser.ParseString(asan_compile_def);
@@ -90,12 +101,19 @@ void InitializeFlags() {
   // Override from user-specified string.
   const char *asan_default_options = MaybeCallAsanDefaultOptions();
   asan_parser.ParseString(asan_default_options);
+#if CAN_SANITIZE_UB
+  const char *ubsan_default_options = __ubsan::MaybeCallUbsanDefaultOptions();
+  ubsan_parser.ParseString(ubsan_default_options);
+#endif
 
   // Override from command line.
   asan_parser.ParseString(GetEnv("ASAN_OPTIONS"));
 #if CAN_SANITIZE_LEAKS
   lsan_parser.ParseString(GetEnv("LSAN_OPTIONS"));
 #endif
+#if CAN_SANITIZE_UB
+  ubsan_parser.ParseString(GetEnv("UBSAN_OPTIONS"));
+#endif
 
   // Let activation flags override current settings. On Android they come
   // from a system property. On other platforms this is no-op.

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_globals.cc
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_globals.cc	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_globals.cc	Thu Sep 10 20:35:47 2015	(r287626)
@@ -18,6 +18,7 @@
 #include "asan_report.h"
 #include "asan_stack.h"
 #include "asan_stats.h"
+#include "asan_suppressions.h"
 #include "asan_thread.h"
 #include "sanitizer_common/sanitizer_common.h"
 #include "sanitizer_common/sanitizer_mutex.h"
@@ -73,7 +74,7 @@ ALWAYS_INLINE void PoisonRedZones(const 
 
 const uptr kMinimalDistanceFromAnotherGlobal = 64;
 
-bool IsAddressNearGlobal(uptr addr, const __asan_global &g) {
+static bool IsAddressNearGlobal(uptr addr, const __asan_global &g) {
   if (addr <= g.beg - kMinimalDistanceFromAnotherGlobal) return false;
   if (addr >= g.beg + g.size_with_redzone) return false;
   return true;
@@ -90,36 +91,40 @@ static void ReportGlobal(const Global &g
   }
 }
 
-static bool DescribeOrGetInfoIfGlobal(uptr addr, uptr size, bool print,
-                                      Global *output_global) {
-  if (!flags()->report_globals) return false;
+static u32 FindRegistrationSite(const Global *g) {
+  mu_for_globals.CheckLocked();
+  CHECK(global_registration_site_vector);
+  for (uptr i = 0, n = global_registration_site_vector->size(); i < n; i++) {
+    GlobalRegistrationSite &grs = (*global_registration_site_vector)[i];
+    if (g >= grs.g_first && g <= grs.g_last)
+      return grs.stack_id;
+  }
+  return 0;
+}
+
+int GetGlobalsForAddress(uptr addr, Global *globals, u32 *reg_sites,
+                         int max_globals) {
+  if (!flags()->report_globals) return 0;
   BlockingMutexLock lock(&mu_for_globals);
-  bool res = false;
+  int res = 0;
   for (ListOfGlobals *l = list_of_all_globals; l; l = l->next) {
     const Global &g = *l->g;
-    if (print) {
-      if (flags()->report_globals >= 2)
-        ReportGlobal(g, "Search");
-      res |= DescribeAddressRelativeToGlobal(addr, size, g);
-    } else {
-      if (IsAddressNearGlobal(addr, g)) {
-        CHECK(output_global);
-        *output_global = g;
-        return true;
-      }
+    if (flags()->report_globals >= 2)
+      ReportGlobal(g, "Search");
+    if (IsAddressNearGlobal(addr, g)) {
+      globals[res] = g;
+      if (reg_sites)
+        reg_sites[res] = FindRegistrationSite(&g);
+      res++;
+      if (res == max_globals) break;
     }
   }
   return res;
 }
 
-bool DescribeAddressIfGlobal(uptr addr, uptr size) {
-  return DescribeOrGetInfoIfGlobal(addr, size, /* print */ true,
-                                   /* output_global */ nullptr);
-}
-
 bool GetInfoForAddressIfGlobal(uptr addr, AddressDescription *descr) {
   Global g = {};
-  if (DescribeOrGetInfoIfGlobal(addr, /* size */ 1, /* print */ false, &g)) {
+  if (GetGlobalsForAddress(addr, &g, nullptr, 1)) {
     internal_strncpy(descr->name, g.name, descr->name_size);
     descr->region_address = g.beg;
     descr->region_size = g.size;
@@ -129,16 +134,6 @@ bool GetInfoForAddressIfGlobal(uptr addr
   return false;
 }
 
-u32 FindRegistrationSite(const Global *g) {
-  CHECK(global_registration_site_vector);
-  for (uptr i = 0, n = global_registration_site_vector->size(); i < n; i++) {
-    GlobalRegistrationSite &grs = (*global_registration_site_vector)[i];
-    if (g >= grs.g_first && g <= grs.g_last)
-      return grs.stack_id;
-  }
-  return 0;
-}
-
 // Register a global variable.
 // This function may be called more than once for every global
 // so we store the globals in a map.
@@ -158,7 +153,8 @@ static void RegisterGlobal(const Global 
       // the entire redzone of the second global may be within the first global.
       for (ListOfGlobals *l = list_of_all_globals; l; l = l->next) {
         if (g->beg == l->g->beg &&
-            (flags()->detect_odr_violation >= 2 || g->size != l->g->size))
+            (flags()->detect_odr_violation >= 2 || g->size != l->g->size) &&
+            !IsODRViolationSuppressed(g->name))
           ReportODRViolation(g, FindRegistrationSite(g),
                              l->g, FindRegistrationSite(l->g));
       }
@@ -210,20 +206,6 @@ void StopInitOrderChecking() {
   }
 }
 
-#if SANITIZER_WINDOWS  // Should only be called on Windows.
-SANITIZER_INTERFACE_ATTRIBUTE
-void UnregisterGlobalsInRange(void *beg, void *end) {
-  if (!flags()->report_globals)
-    return;
-  BlockingMutexLock lock(&mu_for_globals);
-  for (ListOfGlobals *l = list_of_all_globals; l; l = l->next) {
-    void *address = (void *)l->g->beg;
-    if (beg <= address && address < end)
-      UnregisterGlobal(l->g);
-  }
-}
-#endif
-
 }  // namespace __asan
 
 // ---------------------- Interface ---------------- {{{1
@@ -232,7 +214,7 @@ using namespace __asan;  // NOLINT
 // Register an array of globals.
 void __asan_register_globals(__asan_global *globals, uptr n) {
   if (!flags()->report_globals) return;
-  GET_STACK_TRACE_FATAL_HERE;
+  GET_STACK_TRACE_MALLOC;
   u32 stack_id = StackDepotPut(stack);
   BlockingMutexLock lock(&mu_for_globals);
   if (!global_registration_site_vector)

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interceptors.cc
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interceptors.cc	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interceptors.cc	Thu Sep 10 20:35:47 2015	(r287626)
@@ -23,6 +23,10 @@
 #include "asan_suppressions.h"
 #include "sanitizer_common/sanitizer_libc.h"
 
+#if SANITIZER_POSIX
+#include "sanitizer_common/sanitizer_posix.h"
+#endif
+
 namespace __asan {
 
 // Return true if we can quickly decide that the region is unpoisoned.
@@ -65,7 +69,7 @@ struct AsanInterceptorContext {
       }                                                                 \
       if (!suppressed) {                                                \
         GET_CURRENT_PC_BP_SP;                                           \
-        __asan_report_error(pc, bp, sp, __bad, isWrite, __size);        \
+        __asan_report_error(pc, bp, sp, __bad, isWrite, __size, 0);     \
       }                                                                 \
     }                                                                   \
   } while (0)
@@ -75,6 +79,13 @@ struct AsanInterceptorContext {
 #define ASAN_WRITE_RANGE(ctx, offset, size) \
   ACCESS_MEMORY_RANGE(ctx, offset, size, true)
 
+#define ASAN_READ_STRING_OF_LEN(ctx, s, len, n)                 \
+  ASAN_READ_RANGE((ctx), (s),                                   \
+    common_flags()->strict_string_checks ? (len) + 1 : (n))
+
+#define ASAN_READ_STRING(ctx, s, n)                             \
+  ASAN_READ_STRING_OF_LEN((ctx), (s), REAL(strlen)(s), (n))
+
 // Behavior of functions like "memcpy" or "strcpy" is undefined
 // if memory intervals overlap. We report error in this case.
 // Macro is used to avoid creation of new frames.
@@ -120,17 +131,6 @@ using namespace __asan;  // NOLINT
 DECLARE_REAL_AND_INTERCEPTOR(void *, malloc, uptr)
 DECLARE_REAL_AND_INTERCEPTOR(void, free, void *)
 
-#if !SANITIZER_MAC
-#define ASAN_INTERCEPT_FUNC(name)                                        \
-  do {                                                                   \
-    if ((!INTERCEPT_FUNCTION(name) || !REAL(name)))                      \
-      VReport(1, "AddressSanitizer: failed to intercept '" #name "'\n"); \
-  } while (0)
-#else
-// OS X interceptors don't need to be initialized with INTERCEPT_FUNCTION.
-#define ASAN_INTERCEPT_FUNC(name)
-#endif  // SANITIZER_MAC
-
 #define ASAN_INTERCEPTOR_ENTER(ctx, func)                                      \
   AsanInterceptorContext _ctx = {#func};                                       \
   ctx = (void *)&_ctx;                                                         \
@@ -171,11 +171,24 @@ DECLARE_REAL_AND_INTERCEPTOR(void, free,
   do {                                                         \
   } while (false)
 #define COMMON_INTERCEPTOR_BLOCK_REAL(name) REAL(name)
+// Strict init-order checking is dlopen-hostile:
+// https://code.google.com/p/address-sanitizer/issues/detail?id=178
+#define COMMON_INTERCEPTOR_ON_DLOPEN(filename, flag)                           \
+  if (flags()->strict_init_order) {                                            \
+    StopInitOrderChecking();                                                   \
+  }
 #define COMMON_INTERCEPTOR_ON_EXIT(ctx) OnExit()
 #define COMMON_INTERCEPTOR_LIBRARY_LOADED(filename, handle) \
   CoverageUpdateMapping()
 #define COMMON_INTERCEPTOR_LIBRARY_UNLOADED() CoverageUpdateMapping()
 #define COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED (!asan_inited)
+#define COMMON_INTERCEPTOR_GET_TLS_RANGE(begin, end)                           \
+  if (AsanThread *t = GetCurrentThread()) {                                    \
+    *begin = t->tls_begin();                                                   \
+    *end = t->tls_end();                                                       \
+  } else {                                                                     \
+    *begin = *end = 0;                                                         \
+  }
 #include "sanitizer_common/sanitizer_common_interceptors.inc"
 
 // Syscall interceptors don't have contexts, we don't support suppressions
@@ -200,12 +213,6 @@ struct ThreadStartParam {
 };
 
 static thread_return_t THREAD_CALLING_CONV asan_thread_start(void *arg) {
-#if SANITIZER_WINDOWS
-  // FIXME: this is a bandaid fix for PR22025.
-  AsanThread *t = (AsanThread*)arg;
-  SetCurrentThread(t);
-  return t->ThreadStart(GetTid(), /* signal_thread_is_registered */ nullptr);
-#else
   ThreadStartParam *param = reinterpret_cast<ThreadStartParam *>(arg);
   AsanThread *t = nullptr;
   while ((t = reinterpret_cast<AsanThread *>(
@@ -213,7 +220,6 @@ static thread_return_t THREAD_CALLING_CO
     internal_sched_yield();
   SetCurrentThread(t);
   return t->ThreadStart(GetTid(), &param->is_registered);
-#endif
 }
 
 #if ASAN_INTERCEPT_PTHREAD_CREATE
@@ -302,7 +308,7 @@ static void ClearShadowMemoryForContextS
   ssize += stack - bottom;
   ssize = RoundUpTo(ssize, PageSize);
   static const uptr kMaxSaneContextStackSize = 1 << 22;  // 4 Mb
-  if (ssize && ssize <= kMaxSaneContextStackSize) {
+  if (AddrIsInMem(bottom) && ssize && ssize <= kMaxSaneContextStackSize) {
     PoisonShadow(bottom, ssize, 0);
   }
 }
@@ -357,30 +363,6 @@ INTERCEPTOR(void, __cxa_throw, void *a, 
 }
 #endif
 
-#if SANITIZER_WINDOWS
-INTERCEPTOR_WINAPI(void, RaiseException, void *a, void *b, void *c, void *d) {
-  CHECK(REAL(RaiseException));
-  __asan_handle_no_return();
-  REAL(RaiseException)(a, b, c, d);
-}
-
-INTERCEPTOR(int, _except_handler3, void *a, void *b, void *c, void *d) {
-  CHECK(REAL(_except_handler3));
-  __asan_handle_no_return();
-  return REAL(_except_handler3)(a, b, c, d);
-}
-
-#if ASAN_DYNAMIC
-// This handler is named differently in -MT and -MD CRTs.
-#define _except_handler4 _except_handler4_common
-#endif
-INTERCEPTOR(int, _except_handler4, void *a, void *b, void *c, void *d) {
-  CHECK(REAL(_except_handler4));
-  __asan_handle_no_return();
-  return REAL(_except_handler4)(a, b, c, d);
-}
-#endif
-
 static inline int CharCmp(unsigned char c1, unsigned char c2) {
   return (c1 == c2) ? 0 : (c1 < c2) ? -1 : 1;
 }
@@ -511,8 +493,9 @@ INTERCEPTOR(char*, strchr, const char *s
   ENSURE_ASAN_INITED();
   char *result = REAL(strchr)(str, c);
   if (flags()->replace_str) {
-    uptr bytes_read = (result ? result - str : REAL(strlen)(str)) + 1;
-    ASAN_READ_RANGE(ctx, str, bytes_read);
+    uptr len = REAL(strlen)(str);
+    uptr bytes_read = (result ? result - str : len) + 1;
+    ASAN_READ_STRING_OF_LEN(ctx, str, len, bytes_read);
   }
   return result;
 }
@@ -541,7 +524,7 @@ INTERCEPTOR(char*, strcat, char *to, con
     uptr from_length = REAL(strlen)(from);
     ASAN_READ_RANGE(ctx, from, from_length + 1);
     uptr to_length = REAL(strlen)(to);
-    ASAN_READ_RANGE(ctx, to, to_length);
+    ASAN_READ_STRING_OF_LEN(ctx, to, to_length, to_length);
     ASAN_WRITE_RANGE(ctx, to + to_length, from_length + 1);
     // If the copying actually happens, the |from| string should not overlap
     // with the resulting string starting at |to|, which has a length of
@@ -563,7 +546,7 @@ INTERCEPTOR(char*, strncat, char *to, co
     uptr copy_length = Min(size, from_length + 1);
     ASAN_READ_RANGE(ctx, from, copy_length);
     uptr to_length = REAL(strlen)(to);
-    ASAN_READ_RANGE(ctx, to, to_length);
+    ASAN_READ_STRING_OF_LEN(ctx, to, to_length, to_length);
     ASAN_WRITE_RANGE(ctx, to + to_length, from_length + 1);
     if (from_length > 0) {
       CHECK_RANGES_OVERLAP("strncat", to, to_length + copy_length + 1,
@@ -665,23 +648,6 @@ INTERCEPTOR(uptr, strnlen, const char *s
 }
 #endif  // ASAN_INTERCEPT_STRNLEN
 
-static inline bool IsValidStrtolBase(int base) {
-  return (base == 0) || (2 <= base && base <= 36);
-}
-
-static inline void FixRealStrtolEndptr(const char *nptr, char **endptr) {
-  CHECK(endptr);
-  if (nptr == *endptr) {
-    // No digits were found at strtol call, we need to find out the last
-    // symbol accessed by strtoll on our own.
-    // We get this symbol by skipping leading blanks and optional +/- sign.
-    while (IsSpace(*nptr)) nptr++;
-    if (*nptr == '+' || *nptr == '-') nptr++;
-    *endptr = const_cast<char *>(nptr);
-  }
-  CHECK(*endptr >= nptr);
-}
-
 INTERCEPTOR(long, strtol, const char *nptr,  // NOLINT
             char **endptr, int base) {
   void *ctx;
@@ -692,13 +658,7 @@ INTERCEPTOR(long, strtol, const char *np
   }
   char *real_endptr;
   long result = REAL(strtol)(nptr, &real_endptr, base);  // NOLINT
-  if (endptr != 0) {
-    *endptr = real_endptr;
-  }
-  if (IsValidStrtolBase(base)) {
-    FixRealStrtolEndptr(nptr, &real_endptr);
-    ASAN_READ_RANGE(ctx, nptr, (real_endptr - nptr) + 1);
-  }
+  StrtolFixAndCheck(ctx, nptr, endptr, real_endptr, base);
   return result;
 }
 
@@ -719,7 +679,7 @@ INTERCEPTOR(int, atoi, const char *nptr)
   // different from int). So, we just imitate this behavior.
   int result = REAL(strtol)(nptr, &real_endptr, 10);
   FixRealStrtolEndptr(nptr, &real_endptr);
-  ASAN_READ_RANGE(ctx, nptr, (real_endptr - nptr) + 1);
+  ASAN_READ_STRING(ctx, nptr, (real_endptr - nptr) + 1);
   return result;
 }
 
@@ -736,7 +696,7 @@ INTERCEPTOR(long, atol, const char *nptr
   char *real_endptr;
   long result = REAL(strtol)(nptr, &real_endptr, 10);  // NOLINT
   FixRealStrtolEndptr(nptr, &real_endptr);
-  ASAN_READ_RANGE(ctx, nptr, (real_endptr - nptr) + 1);
+  ASAN_READ_STRING(ctx, nptr, (real_endptr - nptr) + 1);
   return result;
 }
 
@@ -751,16 +711,7 @@ INTERCEPTOR(long long, strtoll, const ch
   }
   char *real_endptr;
   long long result = REAL(strtoll)(nptr, &real_endptr, base);  // NOLINT
-  if (endptr != 0) {
-    *endptr = real_endptr;
-  }
-  // If base has unsupported value, strtoll can exit with EINVAL
-  // without reading any characters. So do additional checks only
-  // if base is valid.
-  if (IsValidStrtolBase(base)) {
-    FixRealStrtolEndptr(nptr, &real_endptr);
-    ASAN_READ_RANGE(ctx, nptr, (real_endptr - nptr) + 1);
-  }
+  StrtolFixAndCheck(ctx, nptr, endptr, real_endptr, base);
   return result;
 }
 
@@ -774,7 +725,7 @@ INTERCEPTOR(long long, atoll, const char
   char *real_endptr;
   long long result = REAL(strtoll)(nptr, &real_endptr, 10);  // NOLINT
   FixRealStrtolEndptr(nptr, &real_endptr);
-  ASAN_READ_RANGE(ctx, nptr, (real_endptr - nptr) + 1);
+  ASAN_READ_STRING(ctx, nptr, (real_endptr - nptr) + 1);
   return result;
 }
 #endif  // ASAN_INTERCEPT_ATOLL_AND_STRTOLL
@@ -807,36 +758,6 @@ INTERCEPTOR(int, fork, void) {
 }
 #endif  // ASAN_INTERCEPT_FORK
 
-#if SANITIZER_WINDOWS
-INTERCEPTOR_WINAPI(DWORD, CreateThread,
-                   void* security, uptr stack_size,
-                   DWORD (__stdcall *start_routine)(void*), void* arg,
-                   DWORD thr_flags, void* tid) {
-  // Strict init-order checking is thread-hostile.
-  if (flags()->strict_init_order)
-    StopInitOrderChecking();
-  GET_STACK_TRACE_THREAD;
-  // FIXME: The CreateThread interceptor is not the same as a pthread_create
-  // one.  This is a bandaid fix for PR22025.
-  bool detached = false;  // FIXME: how can we determine it on Windows?
-  u32 current_tid = GetCurrentTidOrInvalid();
-  AsanThread *t =
-        AsanThread::Create(start_routine, arg, current_tid, &stack, detached);
-  return REAL(CreateThread)(security, stack_size,
-                            asan_thread_start, t, thr_flags, tid);
-}
-
-namespace __asan {
-void InitializeWindowsInterceptors() {
-  ASAN_INTERCEPT_FUNC(CreateThread);
-  ASAN_INTERCEPT_FUNC(RaiseException);
-  ASAN_INTERCEPT_FUNC(_except_handler3);
-  ASAN_INTERCEPT_FUNC(_except_handler4);
-}
-
-}  // namespace __asan
-#endif
-
 // ---------------------- InitializeAsanInterceptors ---------------- {{{1
 namespace __asan {
 void InitializeAsanInterceptors() {
@@ -919,10 +840,7 @@ void InitializeAsanInterceptors() {
   ASAN_INTERCEPT_FUNC(fork);
 #endif
 
-  // Some Windows-specific interceptors.
-#if SANITIZER_WINDOWS
-  InitializeWindowsInterceptors();
-#endif
+  InitializePlatformInterceptors();
 
   VReport(1, "AddressSanitizer: libc interceptors initialized\n");
 }

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interceptors.h
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interceptors.h	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interceptors.h	Thu Sep 10 20:35:47 2015	(r287626)
@@ -92,9 +92,21 @@ struct sigaction;
 DECLARE_REAL(int, sigaction, int signum, const struct sigaction *act,
                              struct sigaction *oldact)
 
+#if !SANITIZER_MAC
+#define ASAN_INTERCEPT_FUNC(name)                                        \
+  do {                                                                   \
+    if ((!INTERCEPT_FUNCTION(name) || !REAL(name)))                      \
+      VReport(1, "AddressSanitizer: failed to intercept '" #name "'\n"); \
+  } while (0)
+#else
+// OS X interceptors don't need to be initialized with INTERCEPT_FUNCTION.
+#define ASAN_INTERCEPT_FUNC(name)
+#endif  // SANITIZER_MAC
+
 namespace __asan {
 
 void InitializeAsanInterceptors();
+void InitializePlatformInterceptors();
 
 #define ENSURE_ASAN_INITED() do { \
   CHECK(!asan_init_is_running); \

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interface_internal.h
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interface_internal.h	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_interface_internal.h	Thu Sep 10 20:35:47 2015	(r287626)
@@ -128,7 +128,7 @@ extern "C" {
 
   SANITIZER_INTERFACE_ATTRIBUTE
   void __asan_report_error(uptr pc, uptr bp, uptr sp,
-                           uptr addr, int is_write, uptr access_size);
+                           uptr addr, int is_write, uptr access_size, u32 exp);
 
   SANITIZER_INTERFACE_ATTRIBUTE
   int __asan_set_error_exit_code(int exit_code);
@@ -165,6 +165,21 @@ extern "C" {
   SANITIZER_INTERFACE_ATTRIBUTE void __asan_loadN(uptr p, uptr size);
   SANITIZER_INTERFACE_ATTRIBUTE void __asan_storeN(uptr p, uptr size);
 
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load1(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load2(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load4(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load8(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_load16(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store1(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store2(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store4(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store8(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_store16(uptr p, u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_loadN(uptr p, uptr size,
+                                                      u32 exp);
+  SANITIZER_INTERFACE_ATTRIBUTE void __asan_exp_storeN(uptr p, uptr size,
+                                                       u32 exp);
+
   SANITIZER_INTERFACE_ATTRIBUTE
       void* __asan_memcpy(void *dst, const void *src, uptr size);
   SANITIZER_INTERFACE_ATTRIBUTE
@@ -180,6 +195,10 @@ extern "C" {
   void __asan_poison_intra_object_redzone(uptr p, uptr size);
   SANITIZER_INTERFACE_ATTRIBUTE
   void __asan_unpoison_intra_object_redzone(uptr p, uptr size);
+  SANITIZER_INTERFACE_ATTRIBUTE
+  void __asan_alloca_poison(uptr addr, uptr size);
+  SANITIZER_INTERFACE_ATTRIBUTE
+  void __asan_allocas_unpoison(uptr top, uptr bottom);
 }  // extern "C"
 
 #endif  // ASAN_INTERFACE_INTERNAL_H

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_internal.h
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_internal.h	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_internal.h	Thu Sep 10 20:35:47 2015	(r287626)
@@ -62,21 +62,6 @@ namespace __asan {
 class AsanThread;
 using __sanitizer::StackTrace;
 
-struct SignalContext {
-  void *context;
-  uptr addr;
-  uptr pc;
-  uptr sp;
-  uptr bp;
-
-  SignalContext(void *context, uptr addr, uptr pc, uptr sp, uptr bp) :
-      context(context), addr(addr), pc(pc), sp(sp), bp(bp) {
-  }
-
-  // Creates signal context in a platform-specific manner.
-  static SignalContext Create(void *siginfo, void *context);
-};
-
 void AsanInitFromRtl();
 
 // asan_rtl.cc
@@ -90,7 +75,6 @@ void *AsanDoesNotSupportStaticLinkage();
 void AsanCheckDynamicRTPrereqs();
 void AsanCheckIncompatibleRT();
 
-void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp);
 void AsanOnSIGSEGV(int, void *siginfo, void *context);
 
 void DisableReexec();
@@ -109,7 +93,7 @@ void AppendToErrorMessageBuffer(const ch
 
 void *AsanDlSymNext(const char *sym);
 
-void ReserveShadowMemoryRange(uptr beg, uptr end);
+void ReserveShadowMemoryRange(uptr beg, uptr end, const char *name);
 
 // Platform-specific options.
 #if SANITIZER_MAC

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_linux.cc
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_linux.cc	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_linux.cc	Thu Sep 10 20:35:47 2015	(r287626)
@@ -68,6 +68,8 @@ asan_rt_version_t  __asan_rt_version;
 
 namespace __asan {
 
+void InitializePlatformInterceptors() {}
+
 void DisableReexec() {
   // No need to re-exec on Linux.
 }
@@ -111,6 +113,9 @@ static void ReportIncompatibleRT() {
 }
 
 void AsanCheckDynamicRTPrereqs() {
+  if (!ASAN_DYNAMIC)
+    return;
+
   // Ensure that dynamic RT is the first DSO in the list
   const char *first_dso_name = 0;
   dl_iterate_phdr(FindFirstDSOCallback, &first_dso_name);
@@ -152,78 +157,6 @@ void AsanCheckIncompatibleRT() {
 }
 #endif  // SANITIZER_ANDROID
 
-void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
-#if defined(__arm__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.arm_pc;
-  *bp = ucontext->uc_mcontext.arm_fp;
-  *sp = ucontext->uc_mcontext.arm_sp;
-#elif defined(__aarch64__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.pc;
-  *bp = ucontext->uc_mcontext.regs[29];
-  *sp = ucontext->uc_mcontext.sp;
-#elif defined(__hppa__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.sc_iaoq[0];
-  /* GCC uses %r3 whenever a frame pointer is needed.  */
-  *bp = ucontext->uc_mcontext.sc_gr[3];
-  *sp = ucontext->uc_mcontext.sc_gr[30];
-#elif defined(__x86_64__)
-# if SANITIZER_FREEBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.mc_rip;
-  *bp = ucontext->uc_mcontext.mc_rbp;
-  *sp = ucontext->uc_mcontext.mc_rsp;
-# else
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.gregs[REG_RIP];
-  *bp = ucontext->uc_mcontext.gregs[REG_RBP];
-  *sp = ucontext->uc_mcontext.gregs[REG_RSP];
-# endif
-#elif defined(__i386__)
-# if SANITIZER_FREEBSD
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.mc_eip;
-  *bp = ucontext->uc_mcontext.mc_ebp;
-  *sp = ucontext->uc_mcontext.mc_esp;
-# else
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.gregs[REG_EIP];
-  *bp = ucontext->uc_mcontext.gregs[REG_EBP];
-  *sp = ucontext->uc_mcontext.gregs[REG_ESP];
-# endif
-#elif defined(__powerpc__) || defined(__powerpc64__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.regs->nip;
-  *sp = ucontext->uc_mcontext.regs->gpr[PT_R1];
-  // The powerpc{,64}-linux ABIs do not specify r31 as the frame
-  // pointer, but GCC always uses r31 when we need a frame pointer.
-  *bp = ucontext->uc_mcontext.regs->gpr[PT_R31];
-#elif defined(__sparc__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  uptr *stk_ptr;
-# if defined (__arch64__)
-  *pc = ucontext->uc_mcontext.mc_gregs[MC_PC];
-  *sp = ucontext->uc_mcontext.mc_gregs[MC_O6];
-  stk_ptr = (uptr *) (*sp + 2047);
-  *bp = stk_ptr[15];
-# else
-  *pc = ucontext->uc_mcontext.gregs[REG_PC];
-  *sp = ucontext->uc_mcontext.gregs[REG_O6];
-  stk_ptr = (uptr *) *sp;
-  *bp = stk_ptr[15];
-# endif
-#elif defined(__mips__)
-  ucontext_t *ucontext = (ucontext_t*)context;
-  *pc = ucontext->uc_mcontext.gregs[31];
-  *bp = ucontext->uc_mcontext.gregs[30];
-  *sp = ucontext->uc_mcontext.gregs[29];
-#else
-# error "Unsupported arch"
-#endif
-}
-
 void AsanPlatformThreadInit() {
   // Nothing here for now.
 }

Modified: projects/clang370-import/contrib/compiler-rt/lib/asan/asan_mac.cc
==============================================================================
--- projects/clang370-import/contrib/compiler-rt/lib/asan/asan_mac.cc	Thu Sep 10 17:46:48 2015	(r287625)
+++ projects/clang370-import/contrib/compiler-rt/lib/asan/asan_mac.cc	Thu Sep 10 20:35:47 2015	(r287626)
@@ -24,7 +24,14 @@
 #include "sanitizer_common/sanitizer_libc.h"
 #include "sanitizer_common/sanitizer_mac.h"
 
-#include <crt_externs.h>  // for _NSGetArgv
+#if !SANITIZER_IOS
+#include <crt_externs.h>  // for _NSGetArgv and _NSGetEnviron
+#else
+extern "C" {
+  extern char ***_NSGetArgv(void);
+}
+#endif
+
 #include <dlfcn.h>  // for dladdr()
 #include <mach-o/dyld.h>
 #include <mach-o/loader.h>
@@ -40,19 +47,7 @@
 
 namespace __asan {
 
-void GetPcSpBp(void *context, uptr *pc, uptr *sp, uptr *bp) {
-  ucontext_t *ucontext = (ucontext_t*)context;
-# if SANITIZER_WORDSIZE == 64
-  *pc = ucontext->uc_mcontext->__ss.__rip;
-  *bp = ucontext->uc_mcontext->__ss.__rbp;
-  *sp = ucontext->uc_mcontext->__ss.__rsp;
-# else
-  *pc = ucontext->uc_mcontext->__ss.__eip;
-  *bp = ucontext->uc_mcontext->__ss.__ebp;
-  *sp = ucontext->uc_mcontext->__ss.__esp;
-# endif  // SANITIZER_WORDSIZE
-}
-
+void InitializePlatformInterceptors() {}
 
 bool PlatformHasDifferentMemcpyAndMemmove() {
   // On OS X 10.7 memcpy() and memmove() are both resolved
@@ -74,30 +69,27 @@ LowLevelAllocator allocator_for_env;
 // otherwise the corresponding "NAME=value" string is replaced with
 // |name_value|.
 void LeakyResetEnv(const char *name, const char *name_value) {
-  char ***env_ptr = _NSGetEnviron();
-  CHECK(env_ptr);
-  char **environ = *env_ptr;
-  CHECK(environ);
+  char **env = GetEnviron();
   uptr name_len = internal_strlen(name);
-  while (*environ != 0) {
-    uptr len = internal_strlen(*environ);
+  while (*env != 0) {
+    uptr len = internal_strlen(*env);
     if (len > name_len) {
-      const char *p = *environ;
+      const char *p = *env;
       if (!internal_memcmp(p, name, name_len) && p[name_len] == '=') {
         // Match.
         if (name_value) {
           // Replace the old value with the new one.
-          *environ = const_cast<char*>(name_value);
+          *env = const_cast<char*>(name_value);
         } else {
           // Shift the subsequent pointers back.
-          char **del = environ;
+          char **del = env;
           do {
             del[0] = del[1];
           } while (*del++);
         }
       }
     }
-    environ++;
+    env++;
   }
 }
 
@@ -107,6 +99,23 @@ void DisableReexec() {
   reexec_disabled = true;
 }
 
+bool DyldNeedsEnvVariable() {
+// If running on OS X 10.11+ or iOS 9.0+, dyld will interpose even if
+// DYLD_INSERT_LIBRARIES is not set.
+
+#if SANITIZER_IOSSIM
+  // GetMacosVersion will not work for the simulator, whose kernel version
+  // is tied to the host. Use a weak linking hack for the simulator.
+  // This API was introduced in the same version of the OS as the dyld
+  // optimization.
+

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



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