From owner-svn-src-all@FreeBSD.ORG Fri Jan 18 20:06:49 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 34A836E0; Fri, 18 Jan 2013 20:06:49 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 1E24A303; Fri, 18 Jan 2013 20:06:49 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.5/8.14.5) with ESMTP id r0IK6nqa024782; Fri, 18 Jan 2013 20:06:49 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.5/8.14.5/Submit) id r0IK6kkr024763; Fri, 18 Jan 2013 20:06:46 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201301182006.r0IK6kkr024763@svn.freebsd.org> From: Andrew Turner Date: Fri, 18 Jan 2013 20:06:46 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-vendor@freebsd.org Subject: svn commit: r245614 - in vendor/compiler-rt/dist: . SDKs/darwin/usr/include SDKs/linux/usr/include cmake/Modules include include/sanitizer lib lib/arm lib/asan lib/asan/dynamic lib/asan/lit_tests l... X-SVN-Group: vendor MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Jan 2013 20:06:49 -0000 Author: andrew Date: Fri Jan 18 20:06:45 2013 New Revision: 245614 URL: http://svnweb.freebsd.org/changeset/base/245614 Log: Import compiler-rt r172839. Added: vendor/compiler-rt/dist/.arcconfig vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake vendor/compiler-rt/dist/cmake/Modules/CompilerRTCompile.cmake vendor/compiler-rt/dist/cmake/Modules/CompilerRTLink.cmake vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake vendor/compiler-rt/dist/include/ vendor/compiler-rt/dist/include/sanitizer/ 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/asan/asan_allocator2.cc vendor/compiler-rt/dist/lib/asan/asan_fake_stack.cc vendor/compiler-rt/dist/lib/asan/asan_intercepted_functions.h vendor/compiler-rt/dist/lib/asan/asan_report.cc vendor/compiler-rt/dist/lib/asan/asan_report.h vendor/compiler-rt/dist/lib/asan/dynamic/ vendor/compiler-rt/dist/lib/asan/dynamic/Makefile.mk vendor/compiler-rt/dist/lib/asan/dynamic/asan_interceptors_dynamic.cc vendor/compiler-rt/dist/lib/asan/lit_tests/ vendor/compiler-rt/dist/lib/asan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/ vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/blacklist-extra.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-blacklist-extra.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-blacklist.txt vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-bug-extra.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-bug-extra2.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/initialization-nobug-extra.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Helpers/lit.local.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/ vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/clone_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/initialization-bug-any-order.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/interception_failure_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/interception_malloc_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/interception_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Linux/lit.local.cfg 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/SharedLibs/ vendor/compiler-rt/dist/lib/asan/lit_tests/SharedLibs/dlclose-test-so.cc vendor/compiler-rt/dist/lib/asan/lit_tests/SharedLibs/lit.local.cfg vendor/compiler-rt/dist/lib/asan/lit_tests/SharedLibs/shared-lib-test-so.cc vendor/compiler-rt/dist/lib/asan/lit_tests/Unit/ 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/blacklist.cc vendor/compiler-rt/dist/lib/asan/lit_tests/deep_stack_uaf.cc vendor/compiler-rt/dist/lib/asan/lit_tests/deep_tail_call.cc vendor/compiler-rt/dist/lib/asan/lit_tests/deep_thread_stack.cc 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/force_inline_opt0.cc vendor/compiler-rt/dist/lib/asan/lit_tests/global-overflow.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/interface_symbols.c 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/log-path_test.cc 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/lit_tests/malloc_hook.cc vendor/compiler-rt/dist/lib/asan/lit_tests/memcmp_test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/null_deref.cc vendor/compiler-rt/dist/lib/asan/lit_tests/on_error_callback.cc vendor/compiler-rt/dist/lib/asan/lit_tests/sanity_check_pure_c.c vendor/compiler-rt/dist/lib/asan/lit_tests/shared-lib-test.cc vendor/compiler-rt/dist/lib/asan/lit_tests/sleep_before_dying.c 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/stack-use-after-return.cc vendor/compiler-rt/dist/lib/asan/lit_tests/strip_path_prefix.c vendor/compiler-rt/dist/lib/asan/lit_tests/strncpy-overflow.cc vendor/compiler-rt/dist/lib/asan/lit_tests/symbolize_callback.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/tests/asan_test_main.cc vendor/compiler-rt/dist/lib/lit.common.cfg vendor/compiler-rt/dist/lib/lit.common.unit.cfg vendor/compiler-rt/dist/lib/msan/ 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_allocator.cc 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_platform_limits_posix.cc vendor/compiler-rt/dist/lib/msan/msan_platform_limits_posix.h vendor/compiler-rt/dist/lib/msan/msan_report.cc vendor/compiler-rt/dist/lib/msan/tests/ vendor/compiler-rt/dist/lib/msan/tests/CMakeLists.txt 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/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/sanitizer_common/sanitizer_allocator.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_lfstack.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_platform_interceptors.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.cc 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_itanium.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer_linux.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/scripts/ vendor/compiler-rt/dist/lib/sanitizer_common/scripts/check_lint.sh (contents, props changed) 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_testlib.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_printf_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_scanf_interceptor_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_stackdepot_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_main.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_test_utils.h vendor/compiler-rt/dist/lib/sanitizer_common/tests/standalone_malloc_test.cc vendor/compiler-rt/dist/lib/tsan/check_cmake.sh (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/ vendor/compiler-rt/dist/lib/tsan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/lit_tests/Helpers/ vendor/compiler-rt/dist/lib/tsan/lit_tests/Helpers/blacklist.txt vendor/compiler-rt/dist/lib/tsan/lit_tests/Helpers/lit.local.cfg vendor/compiler-rt/dist/lib/tsan/lit_tests/Unit/ 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/blacklist.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_close_norace.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_dup_norace.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_location.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_pipe_norace.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_pipe_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_socket_connect_norace.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_socket_norace.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_socketpair_norace.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/fd_stdout_race.cc 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/global_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/heap_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/ignore_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java.h vendor/compiler-rt/dist/lib/tsan/lit_tests/java_alloc.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java_lock.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java_lock_move.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/java_race_move.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/mop_with_offset.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mop_with_offset2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutex_destroy_locked.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset1.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset3.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset4.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset5.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset6.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/mutexset7.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_barrier.c vendor/compiler-rt/dist/lib/tsan/lit_tests/race_on_barrier2.c 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/race_on_read.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/race_with_finished_thread.cc 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.c vendor/compiler-rt/dist/lib/tsan/lit_tests/simple_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/simple_stack.c vendor/compiler-rt/dist/lib/tsan/lit_tests/simple_stack2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/sleep_sync.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/sleep_sync2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/stack_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/stack_race2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/static_init1.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/static_init2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/static_init3.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/static_init4.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/static_init5.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/static_init6.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/suppress_same_address.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/suppress_same_stacks.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/test_output.sh (contents, props changed) vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak.c vendor/compiler-rt/dist/lib/tsan/lit_tests/thread_leak2.c 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/tiny_race.c vendor/compiler-rt/dist/lib/tsan/lit_tests/tls_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/tls_race2.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/user_fopen.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/user_malloc.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/virtual_inheritance_compile_bug.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/vptr_benign_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/vptr_harmful_race.cc vendor/compiler-rt/dist/lib/tsan/lit_tests/write_in_reader_lock.cc vendor/compiler-rt/dist/lib/tsan/rtl/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/rtl/tsan_fd.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_fd.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_mutexset.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_mutexset.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_platform_windows.cc vendor/compiler-rt/dist/lib/tsan/tests/ vendor/compiler-rt/dist/lib/tsan/tests/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/tests/rtl/ vendor/compiler-rt/dist/lib/tsan/tests/rtl/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_bench.cc vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_mop.cc vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_mutex.cc vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_posix.cc vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_string.cc vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_test.cc vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_test_util.h vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_test_util_linux.cc vendor/compiler-rt/dist/lib/tsan/tests/rtl/tsan_thread.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/ vendor/compiler-rt/dist/lib/tsan/tests/unit/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_clock_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_flags_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_mman_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_mutex_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_mutexset_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_platform_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_shadow_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_stack_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_suppressions_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_sync_test.cc vendor/compiler-rt/dist/lib/tsan/tests/unit/tsan_vector_test.cc vendor/compiler-rt/dist/lib/ubsan/ vendor/compiler-rt/dist/lib/ubsan/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/Makefile.mk vendor/compiler-rt/dist/lib/ubsan/lit_tests/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/CMakeLists.txt vendor/compiler-rt/dist/lib/ubsan/lit_tests/Float/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/Float/cast-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/add-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/div-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/div-zero.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/incdec-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/mul-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/negate-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/no-recover.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/shift.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/sub-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/uadd-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/uincdec-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/umul-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Integer/usub-overflow.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/bool.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/deduplication.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/enum.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/missing_return.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/unreachable.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/Misc/vla.c vendor/compiler-rt/dist/lib/ubsan/lit_tests/TypeCheck/ vendor/compiler-rt/dist/lib/ubsan/lit_tests/TypeCheck/misaligned.cpp vendor/compiler-rt/dist/lib/ubsan/lit_tests/TypeCheck/null.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_diag.h 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_handlers_cxx.h vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_type_hash.h vendor/compiler-rt/dist/lib/ubsan/ubsan_value.cc vendor/compiler-rt/dist/lib/ubsan/ubsan_value.h vendor/compiler-rt/dist/make/platform/clang_linux_test_input.c Deleted: vendor/compiler-rt/dist/lib/asan/Makefile.old vendor/compiler-rt/dist/lib/asan/asan_interface.h vendor/compiler-rt/dist/lib/asan/asan_printf.cc vendor/compiler-rt/dist/lib/asan/output_tests/ vendor/compiler-rt/dist/lib/asan/tests/asan_break_optimization.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_allocator64.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_interface_defs.h vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_allocator64_test.cc vendor/compiler-rt/dist/lib/sanitizer_common/tests/sanitizer_allocator64_testlib.cc vendor/compiler-rt/dist/lib/tsan/output_tests/ vendor/compiler-rt/dist/lib/tsan/rtl/tsan_printf.cc vendor/compiler-rt/dist/lib/tsan/rtl_tests/ vendor/compiler-rt/dist/lib/tsan/unit_tests/ Modified: vendor/compiler-rt/dist/CMakeLists.txt vendor/compiler-rt/dist/LICENSE.TXT vendor/compiler-rt/dist/Makefile vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h vendor/compiler-rt/dist/lib/CMakeLists.txt vendor/compiler-rt/dist/lib/Makefile.mk vendor/compiler-rt/dist/lib/arm/Makefile.mk vendor/compiler-rt/dist/lib/arm/divsi3.S vendor/compiler-rt/dist/lib/arm/udivsi3.S vendor/compiler-rt/dist/lib/asan/CMakeLists.txt vendor/compiler-rt/dist/lib/asan/Makefile.mk vendor/compiler-rt/dist/lib/asan/README.txt vendor/compiler-rt/dist/lib/asan/asan_allocator.cc vendor/compiler-rt/dist/lib/asan/asan_allocator.h 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_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_lock.h 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_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_thread_registry.cc vendor/compiler-rt/dist/lib/asan/asan_thread_registry.h vendor/compiler-rt/dist/lib/asan/asan_win.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_benchmarks_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_globals_test.cc vendor/compiler-rt/dist/lib/asan/tests/asan_mac_test.mm 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.ignore 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/cmpdi2.c vendor/compiler-rt/dist/lib/fixsfdi.c vendor/compiler-rt/dist/lib/int_endianness.h vendor/compiler-rt/dist/lib/interception/CMakeLists.txt vendor/compiler-rt/dist/lib/interception/interception.h vendor/compiler-rt/dist/lib/interception/interception_linux.cc vendor/compiler-rt/dist/lib/interception/interception_linux.h vendor/compiler-rt/dist/lib/interception/interception_mac.cc vendor/compiler-rt/dist/lib/interception/interception_mac.h vendor/compiler-rt/dist/lib/interception/interception_win.cc vendor/compiler-rt/dist/lib/interception/interception_win.h vendor/compiler-rt/dist/lib/interception/mach_override/mach_override.c 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_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_flags.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_internal_defs.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_list.h 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_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_symbolizer.cc vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_symbolizer.h vendor/compiler-rt/dist/lib/sanitizer_common/sanitizer_win.cc 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_list_test.cc vendor/compiler-rt/dist/lib/tsan/CMakeLists.txt vendor/compiler-rt/dist/lib/tsan/Makefile.old 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/rtl/Makefile.mk vendor/compiler-rt/dist/lib/tsan/rtl/Makefile.old vendor/compiler-rt/dist/lib/tsan/rtl/tsan_clock.cc vendor/compiler-rt/dist/lib/tsan/rtl/tsan_clock.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_defs.h 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.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_atomic.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_interface_inl.h 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_mutex.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_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_trace.h vendor/compiler-rt/dist/lib/tsan/rtl/tsan_update_shadow_word_inl.h vendor/compiler-rt/dist/lib/ucmpdi2.c vendor/compiler-rt/dist/make/AppleBI.mk vendor/compiler-rt/dist/make/config.mk vendor/compiler-rt/dist/make/lib_info.mk vendor/compiler-rt/dist/make/options.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 vendor/compiler-rt/dist/test/Unit/endianness.h Added: vendor/compiler-rt/dist/.arcconfig ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/.arcconfig Fri Jan 18 20:06:45 2013 (r245614) @@ -0,0 +1,4 @@ +{ + "project_id" : "compiler-rt", + "conduit_uri" : "http://llvm-reviews.chandlerc.com/" +} Modified: vendor/compiler-rt/dist/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/CMakeLists.txt Fri Jan 18 19:42:08 2013 (r245613) +++ vendor/compiler-rt/dist/CMakeLists.txt Fri Jan 18 20:06:45 2013 (r245614) @@ -15,49 +15,157 @@ include(LLVMParseArguments) # runtime libraries. cmake_minimum_required(VERSION 2.8.8) -# 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. +# Add path for custom modules +set(CMAKE_MODULE_PATH + ${CMAKE_MODULE_PATH} + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules" + ) +include(AddCompilerRT) + +set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) # 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. -if(CMAKE_SIZEOF_VOID_P EQUAL 4) - set(TARGET_X86_64_CFLAGS "-m64") - set(TARGET_I386_CFLAGS "") +if(CMAKE_SIZEOF_VOID_P EQUAL 4 OR LLVM_BUILD_32_BITS) + set(TARGET_64_BIT_CFLAGS "-m64") + set(TARGET_32_BIT_CFLAGS "") else() if(NOT CMAKE_SIZEOF_VOID_P EQUAL 8) message(FATAL_ERROR "Please use a sane architecture with 4 or 8 byte pointers.") endif() - set(TARGET_X86_64_CFLAGS "") - set(TARGET_I386_CFLAGS "-m32") + set(TARGET_64_BIT_CFLAGS "") + 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) + +function(get_target_flags_for_arch arch out_var) + list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) + if(ARCH_INDEX EQUAL -1) + message(FATAL_ERROR "Unsupported architecture: ${arch}") + else() + set(${out_var} ${TARGET_${arch}_CFLAGS} PARENT_SCOPE) + endif() +endfunction() + # Try to compile a very simple source file to ensure we can target the given # 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 \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}") +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 \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}") - -# Because compiler-rt spends a lot of time setting up custom compile flags, -# define a handy helper function for it. The compile flags setting in CMake -# has serious issues that make its syntax challenging at best. -function(set_target_compile_flags target) - foreach(arg ${ARGN}) - set(argstring "${argstring} ${arg}") +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}") + +# 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) +else() + set(COMPILER_RT_CAN_EXECUTE_TESTS FALSE) +endif() + +function(filter_available_targets out_var) + set(archs) + foreach(arch ${ARGN}) + list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) + if(NOT (ARCH_INDEX EQUAL -1) AND CAN_TARGET_${arch}) + list(APPEND archs ${arch}) + endif() endforeach() - set_property(TARGET ${target} PROPERTY COMPILE_FLAGS "${argstring}") + set(${out_var} ${archs} PARENT_SCOPE) endfunction() +# Provide some common commmandline flags for Sanitizer runtimes. +set(SANITIZER_COMMON_CFLAGS + -fPIC + -fno-builtin + -fno-exceptions + -fomit-frame-pointer + -funwind-tables + -O3 + ) +if(NOT WIN32) + list(APPEND SANITIZER_COMMON_CFLAGS -fvisibility=hidden) +endif() +# Build sanitizer runtimes with debug info. +check_cxx_compiler_flag(-gline-tables-only SUPPORTS_GLINE_TABLES_ONLY_FLAG) +if(SUPPORTS_GLINE_TABLES_ONLY_FLAG) + list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) +else() + list(APPEND SANITIZER_COMMON_CFLAGS -g) +endif() +# Warnings suppressions. +check_cxx_compiler_flag(-Wno-variadic-macros SUPPORTS_NO_VARIADIC_MACROS_FLAG) +if(SUPPORTS_NO_VARIADIC_MACROS_FLAG) + list(APPEND SANITIZER_COMMON_CFLAGS -Wno-variadic-macros) +endif() +check_cxx_compiler_flag(-Wno-c99-extensions SUPPORTS_NO_C99_EXTENSIONS_FLAG) +if(SUPPORTS_NO_C99_EXTENSIONS_FLAG) + list(APPEND SANITIZER_COMMON_CFLAGS -Wno-c99-extensions) +endif() +if(APPLE) + list(APPEND SANITIZER_COMMON_CFLAGS -mmacosx-version-min=10.5) +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) + +# Add the public header's directory to the includes for all of compiler-rt. +include_directories(include) + add_subdirectory(lib) if(LLVM_INCLUDE_TESTS) Modified: vendor/compiler-rt/dist/LICENSE.TXT ============================================================================== --- vendor/compiler-rt/dist/LICENSE.TXT Fri Jan 18 19:42:08 2013 (r245613) +++ vendor/compiler-rt/dist/LICENSE.TXT Fri Jan 18 20:06:45 2013 (r245614) @@ -14,7 +14,7 @@ Full text of the relevant licenses is in University of Illinois/NCSA Open Source License -Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2013 by the contributors listed in CREDITS.TXT All rights reserved. @@ -55,7 +55,7 @@ SOFTWARE. ============================================================================== -Copyright (c) 2009-2012 by the contributors listed in CREDITS.TXT +Copyright (c) 2009-2013 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: vendor/compiler-rt/dist/Makefile ============================================================================== --- vendor/compiler-rt/dist/Makefile Fri Jan 18 19:42:08 2013 (r245613) +++ vendor/compiler-rt/dist/Makefile Fri Jan 18 20:06:45 2013 (r245614) @@ -92,7 +92,7 @@ test: %/.dir: $(Summary) " MKDIR: $*" $(Verb) $(MKDIR) $* > /dev/null - $(Verb) $(DATE) > $@ + $(Verb) echo 'Created.' > $@ # Remove directories %/.remove: @@ -117,7 +117,7 @@ $(call Set,Tmp.Configs,$($(Tmp.Key).Conf $(call Set,Tmp.ObjPath,$(ProjObjRoot)/$(Tmp.Name)) # Top-Level Platform Target -$(Tmp.Name):: $(Tmp.Configs:%=$(Tmp.ObjPath)/%/libcompiler_rt.a) +$(Tmp.Name):: $(Tmp.Configs:%=$(Tmp.Name)-%) .PHONY: $(Tmp.Name) clean:: @@ -131,6 +131,15 @@ endef define PerPlatformConfig_template $(call Set,Tmp.Config,$(1)) $(call Set,Tmp.ObjPath,$(ProjObjRoot)/$(Tmp.Name)/$(Tmp.Config)) +$(call Set,Tmp.SHARED_LIBRARY,$(strip \ + $(call GetCNAVar,SHARED_LIBRARY,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) +$(call Set,Tmp.SHARED_LIBRARY_SUFFIX,$(strip \ + $(call GetCNAVar,SHARED_LIBRARY_SUFFIX,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) + +# Compute the library suffix. +$(if $(call streq,1,$(Tmp.SHARED_LIBRARY)), + $(call Set,Tmp.LibrarySuffix,$(Tmp.SHARED_LIBRARY_SUFFIX)), + $(call Set,Tmp.LibrarySuffix,a)) # Compute the archs to build, depending on whether this is a universal build or # not. @@ -142,8 +151,8 @@ $(call Set,Tmp.ArchsToBuild,\ $(call VarOrDefault,$(Tmp.Key).Arch.$(Tmp.Config),$($(Tmp.Key).Arch)))) # Copy or lipo to create the per-config library. -$(call Set,Tmp.Inputs,$(Tmp.ArchsToBuild:%=$(Tmp.ObjPath)/%/libcompiler_rt.a)) -$(Tmp.ObjPath)/libcompiler_rt.a: $(Tmp.Inputs) $(Tmp.ObjPath)/.dir +$(call Set,Tmp.Inputs,$(Tmp.ArchsToBuild:%=$(Tmp.ObjPath)/%/libcompiler_rt.$(Tmp.LibrarySuffix))) +$(Tmp.ObjPath)/libcompiler_rt.$(Tmp.LibrarySuffix): $(Tmp.Inputs) $(Tmp.ObjPath)/.dir $(Summary) " FINAL-ARCHIVE: $(Tmp.Name)/$(Tmp.Config): $$@" -$(Verb) $(RM) $$@ $(if $(call streq,1,$(words $(Tmp.ArchsToBuild))), \ @@ -152,7 +161,7 @@ $(Tmp.ObjPath)/libcompiler_rt.a: $(Tmp.I .PRECIOUS: $(Tmp.ObjPath)/.dir # Per-Config Targets -$(Tmp.Name)-$(Tmp.Config):: $(Tmp.ObjPath)/libcompiler_rt.a +$(Tmp.Name)-$(Tmp.Config):: $(Tmp.ObjPath)/libcompiler_rt.$(Tmp.LibrarySuffix) .PHONY: $(Tmp.Name)-$(Tmp.Config) # Per-Config-Arch Libraries @@ -172,10 +181,21 @@ $(call Set,Tmp.AR,$(strip \ $(call GetCNAVar,AR,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) $(call Set,Tmp.ARFLAGS,$(strip \ $(call GetCNAVar,ARFLAGS,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) +$(call Set,Tmp.CC,$(strip \ + $(call GetCNAVar,CC,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) +$(call Set,Tmp.LDFLAGS,$(strip \ + $(call GetCNAVar,LDFLAGS,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) $(call Set,Tmp.RANLIB,$(strip \ $(call GetCNAVar,RANLIB,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) $(call Set,Tmp.RANLIBFLAGS,$(strip \ $(call GetCNAVar,RANLIBFLAGS,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) +$(call Set,Tmp.SHARED_LIBRARY,$(strip \ + $(call GetCNAVar,SHARED_LIBRARY,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) + +# Compute the library suffix. +$(if $(call streq,1,$(Tmp.SHARED_LIBRARY)), + $(call Set,Tmp.LibrarySuffix,$(Tmp.SHARED_LIBRARY_SUFFIX)), + $(call Set,Tmp.LibrarySuffix,a)) # Compute the object inputs for this library. $(call Set,Tmp.Inputs,\ @@ -188,10 +208,18 @@ $(Tmp.ObjPath)/libcompiler_rt.a: $(Tmp.I -$(Verb) $(RM) $$@ $(Verb) $(Tmp.AR) $(Tmp.ARFLAGS) $$@ $(Tmp.Inputs) $(Verb) $(Tmp.RANLIB) $(Tmp.RANLIBFLAGS) $$@ +$(Tmp.ObjPath)/libcompiler_rt.dylib: $(Tmp.Inputs) $(Tmp.ObjPath)/.dir + $(Summary) " DYLIB: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$@" + $(Verb) $(Tmp.CC) -arch $(Tmp.Arch) -dynamiclib -o $$@ \ + $(Tmp.Inputs) $(Tmp.LDFLAGS) +$(Tmp.ObjPath)/libcompiler_rt.so: $(Tmp.Inputs) $(Tmp.ObjPath)/.dir + $(Summary) " SO: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$@" + $(Verb) $(Tmp.CC) -shared -o $$@ \ + $(Tmp.Inputs) $(Tmp.LDFLAGS) .PRECIOUS: $(Tmp.ObjPath)/.dir # Per-Config-Arch Targets -$(Tmp.Name)-$(Tmp.Config)-$(Tmp.Arch):: $(Tmp.ObjPath)/libcompiler_rt.a +$(Tmp.Name)-$(Tmp.Config)-$(Tmp.Arch):: $(Tmp.ObjPath)/libcompiler_rt.$(Tmp.LibrarySuffix) .PHONY: $(Tmp.Name)-$(Tmp.Config)-$(Tmp.Arch) # Per-Config-Arch-SubDir Objects Modified: vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h Fri Jan 18 19:42:08 2013 (r245613) +++ vendor/compiler-rt/dist/SDKs/darwin/usr/include/stdio.h Fri Jan 18 20:06:45 2013 (r245614) @@ -17,6 +17,10 @@ #ifndef __STDIO_H__ #define __STDIO_H__ +#if defined(__cplusplus) +extern "C" { +#endif + typedef struct __sFILE FILE; typedef __SIZE_TYPE__ size_t; @@ -51,11 +55,30 @@ typedef __SIZE_TYPE__ size_t; # define stderr __stderrp extern FILE *__stderrp; +#ifndef SEEK_SET +#define SEEK_SET 0 /* set file offset to offset */ +#endif +#ifndef SEEK_CUR +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#endif +#ifndef SEEK_END +#define SEEK_END 2 /* set file offset to EOF plus offset */ +#endif + int fclose(FILE *); int fflush(FILE *); -FILE *fopen(const char * restrict, const char * restrict) __asm(__FOPEN_NAME); -int fprintf(FILE * restrict, const char * restrict, ...); -size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict) +FILE *fopen(const char * __restrict, const char * __restrict) __asm(__FOPEN_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) +} +#endif #endif /* __STDIO_H__ */ Modified: vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h ============================================================================== --- vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h Fri Jan 18 19:42:08 2013 (r245613) +++ vendor/compiler-rt/dist/SDKs/linux/usr/include/stdio.h Fri Jan 18 20:06:45 2013 (r245614) @@ -26,10 +26,17 @@ extern struct _IO_FILE *stdin; extern struct _IO_FILE *stdout; extern struct _IO_FILE *stderr; +#define SEEK_SET 0 /* set file offset to offset */ +#define SEEK_CUR 1 /* set file offset to current plus offset */ +#define SEEK_END 2 /* set file offset to EOF plus offset */ + extern int fclose(FILE *); extern int fflush(FILE *); extern FILE *fopen(const char * restrict, 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); +extern long ftell(FILE *); +extern int fseek(FILE *, long, int); #endif /* __STDIO_H__ */ Added: vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/cmake/Modules/AddCompilerRT.cmake Fri Jan 18 20:06:45 2013 (r245614) @@ -0,0 +1,49 @@ +include(AddLLVM) +include(LLVMParseArguments) +include(CompilerRTUtils) + +# Tries to add "object library" target for a given architecture +# with name "." if architecture can be targeted. +# add_compiler_rt_object_library( +# SOURCES +# CFLAGS ) +macro(add_compiler_rt_object_library name arch) + if(CAN_TARGET_${arch}) + parse_arguments(LIB "SOURCES;CFLAGS" "" ${ARGN}) + add_library(${name}.${arch} OBJECT ${LIB_SOURCES}) + set_target_compile_flags(${name}.${arch} + ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) + else() + message(FATAL_ERROR "Archtecture ${arch} can't be targeted") + endif() +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) +set(COMPILER_RT_GTEST_INCLUDE_CFLAGS + -DGTEST_NO_LLVM_RAW_OSTREAM=1 + -I${COMPILER_RT_GTEST_PATH}/include +) + +# Use Clang to link objects into a single executable with just-built +# Clang, using specific link flags. Make executable a part of provided +# test_suite. +# add_compiler_rt_test( +# OBJECTS +# DEPS +# 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} + 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() Added: vendor/compiler-rt/dist/cmake/Modules/CompilerRTCompile.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTCompile.cmake Fri Jan 18 20:06:45 2013 (r245614) @@ -0,0 +1,16 @@ +include(LLVMParseArguments) + +# Compile a source into an object file with just-built Clang using +# a provided compile flags and dependenices. +# clang_compile( +# CFLAGS +# DEPS ) +macro(clang_compile object_file source) + parse_arguments(SOURCE "CFLAGS;DEPS" "" ${ARGN}) + get_filename_component(source_rpath ${source} REALPATH) + add_custom_command( + OUTPUT ${object_file} + COMMAND clang ${SOURCE_CFLAGS} -c -o "${object_file}" ${source_rpath} + MAIN_DEPENDENCY ${source} + DEPENDS clang ${SOURCE_DEPS}) +endmacro() Added: vendor/compiler-rt/dist/cmake/Modules/CompilerRTLink.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTLink.cmake Fri Jan 18 20:06:45 2013 (r245614) @@ -0,0 +1,14 @@ +include(LLVMParseArguments) + +# Link a shared library with just-built Clang. +# clang_link_shared( +# OBJECTS +# LINKFLAGS +# DEPS ) +macro(clang_link_shared so_file) + parse_arguments(SOURCE "OBJECTS;LINKFLAGS;DEPS" "" ${ARGN}) + add_custom_command( + OUTPUT ${so_file} + COMMAND clang -o "${so_file}" -shared ${SOURCE_LINKFLAGS} ${SOURCE_OBJECTS} + DEPENDS clang ${SOURCE_DEPS}) +endmacro() Added: vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/cmake/Modules/CompilerRTUtils.cmake Fri Jan 18 20:06:45 2013 (r245614) @@ -0,0 +1,17 @@ +# Because compiler-rt spends a lot of time setting up custom compile flags, +# define a handy helper function for it. The compile flags setting in CMake +# has serious issues that make its syntax challenging at best. +function(set_target_compile_flags target) + foreach(arg ${ARGN}) + set(argstring "${argstring} ${arg}") + endforeach() + set_property(TARGET ${target} PROPERTY COMPILE_FLAGS "${argstring}") +endfunction() + +function(set_target_link_flags target) + foreach(arg ${ARGN}) + set(argstring "${argstring} ${arg}") + endforeach() + set_property(TARGET ${target} PROPERTY LINK_FLAGS "${argstring}") +endfunction() + Added: vendor/compiler-rt/dist/include/sanitizer/asan_interface.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/include/sanitizer/asan_interface.h Fri Jan 18 20:06:45 2013 (r245614) @@ -0,0 +1,212 @@ +//===-- sanitizer/asan_interface.h ------------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of AddressSanitizer, an address sanity checker. +// +// This header can be included by the instrumented program to fetch +// data (mostly allocator statistics) from ASan runtime library. +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_ASAN_INTERFACE_H +#define SANITIZER_ASAN_INTERFACE_H + +#include + +// ----------- 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; + +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; + + // 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 + // this region is unpoisoned. This function is not guaranteed to poison + // the whole region - it may poison only subregion of [addr, addr+size) due + // 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; + // 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. + // This function may unpoison a superregion of [addr, addr+size) due 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_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; + +// User code should use macro instead of functions. +#if __has_feature(address_sanitizer) +#define ASAN_POISON_MEMORY_REGION(addr, size) \ + __asan_poison_memory_region((addr), (size)) +#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \ + __asan_unpoison_memory_region((addr), (size)) +#else +#define ASAN_POISON_MEMORY_REGION(addr, size) \ + ((void)(addr), (void)(size)) +#define ASAN_UNPOISON_MEMORY_REGION(addr, size) \ + ((void)(addr), (void)(size)) +#endif + + // 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; + + // 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; + + // Print the description of addr (useful when debugging in gdb). + void __asan_describe_address(uptr addr) + SANITIZER_INTERFACE_ATTRIBUTE; + + // 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; + + // 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; + + // 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_error_report_callback(void (*callback)(const char*)) + SANITIZER_INTERFACE_ATTRIBUTE; + + // 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; + + // 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; + + // 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; + // 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; + // 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; + // Number of bytes, allocated and not yet freed by the application. + uptr __asan_get_current_allocated_bytes() + SANITIZER_INTERFACE_ATTRIBUTE; + // 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; + // 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; + // Number of bytes in unmapped pages, that are released to OS. Currently, + // always returns 0. + uptr __asan_get_unmapped_bytes() + SANITIZER_INTERFACE_ATTRIBUTE; + // Prints accumulated stats to stderr. Used for debugging. + void __asan_print_accumulated_stats() + SANITIZER_INTERFACE_ATTRIBUTE; + + // 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; + + // 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; +} // extern "C" + +#endif // SANITIZER_ASAN_INTERFACE_H Added: vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/include/sanitizer/common_interface_defs.h Fri Jan 18 20:06:45 2013 (r245614) @@ -0,0 +1,92 @@ +//===-- sanitizer/common_interface_defs.h -----------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is shared between AddressSanitizer and ThreadSanitizer. +// It contains basic macro and types. +// NOTE: This file may be included into user code. +//===----------------------------------------------------------------------===// + +#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. + +#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 +#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. +typedef unsigned long long uhwptr; // NOLINT +#else +typedef uptr uhwptr; // NOLINT +#endif +typedef unsigned char u8; +typedef unsigned short u16; // NOLINT +typedef unsigned int u32; +typedef unsigned long long u64; // NOLINT +typedef signed char s8; +typedef signed short s16; // NOLINT +typedef signed int s32; +typedef signed long long s64; // NOLINT + +} // namespace __sanitizer + +extern "C" { + // Tell the tools to write their reports to "path." instead of stderr. + void __sanitizer_set_report_path(const char *path) + SANITIZER_INTERFACE_ATTRIBUTE; + + // Tell the tools to write their reports to given file descriptor instead of + // stderr. + void __sanitizer_set_report_fd(int fd) + SANITIZER_INTERFACE_ATTRIBUTE; + + // Notify the tools that the sandbox is going to be turned on. The reserved + // parameter will be used in the future to hold a structure with functions + // that the tools may call to bypass the sandbox. + void __sanitizer_sandbox_on_notify(void *reserved) + SANITIZER_WEAK_ATTRIBUTE SANITIZER_INTERFACE_ATTRIBUTE; +} // extern "C" + +#endif // SANITIZER_COMMON_INTERFACE_DEFS_H Added: vendor/compiler-rt/dist/include/sanitizer/msan_interface.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ vendor/compiler-rt/dist/include/sanitizer/msan_interface.h Fri Jan 18 20:06:45 2013 (r245614) @@ -0,0 +1,124 @@ +//===-- msan_interface.h --------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// This file is a part of MemorySanitizer. +// +// Public interface header. +//===----------------------------------------------------------------------===// +#ifndef MSAN_INTERFACE_H +#define MSAN_INTERFACE_H + +#include + +using __sanitizer::uptr; +using __sanitizer::sptr; +using __sanitizer::u32; + +#ifdef __cplusplus +extern "C" { +#endif + +// FIXME: document all interface functions. + +SANITIZER_INTERFACE_ATTRIBUTE +int __msan_get_track_origins(); + +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_init(); + +// Print a warning and maybe return. +// This function can die based on flags()->exit_code. +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_warning(); + +// Print a warning and die. +// Intrumentation inserts calls to this function when building in "fast" mode +// (i.e. -mllvm -msan-keep-going) +SANITIZER_INTERFACE_ATTRIBUTE __attribute__((noreturn)) +void __msan_warning_noreturn(); + +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_unpoison(void *a, uptr size); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_clear_and_unpoison(void *a, uptr size); +SANITIZER_INTERFACE_ATTRIBUTE +void* __msan_memcpy(void *dst, const void *src, uptr size); +SANITIZER_INTERFACE_ATTRIBUTE +void* __msan_memset(void *s, int c, uptr n); +SANITIZER_INTERFACE_ATTRIBUTE +void* __msan_memmove(void* dest, const void* src, uptr n); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_copy_poison(void *dst, const void *src, uptr size); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_copy_origin(void *dst, const void *src, uptr size); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_move_poison(void *dst, const void *src, uptr size); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_poison(void *a, uptr size); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_poison_stack(void *a, uptr size); + +// Copy size bytes from src to dst and unpoison the result. +// Useful to implement unsafe loads. +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_load_unpoisoned(void *src, uptr size, void *dst); + +// Returns the offset of the first (at least partially) poisoned byte, +// or -1 if the whole range is good. +SANITIZER_INTERFACE_ATTRIBUTE +sptr __msan_test_shadow(const void *x, uptr size); + +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_set_origin(void *a, uptr size, u32 origin); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_set_alloca_origin(void *a, uptr size, const char *descr); +SANITIZER_INTERFACE_ATTRIBUTE +u32 __msan_get_origin(void *a); + +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_clear_on_return(); + +// Default: -1 (don't exit on error). +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_set_exit_code(int exit_code); + +SANITIZER_INTERFACE_ATTRIBUTE +int __msan_set_poison_in_malloc(int do_poison); + +// For testing. +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_set_expect_umr(int expect_umr); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_break_optimization(void *x); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_print_shadow(const void *x, uptr size); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_print_param_shadow(); +SANITIZER_INTERFACE_ATTRIBUTE +int __msan_has_dynamic_component(); + +// Returns x such that %fs:x is the first byte of __msan_retval_tls. +SANITIZER_INTERFACE_ATTRIBUTE +int __msan_get_retval_tls_offset(); +SANITIZER_INTERFACE_ATTRIBUTE +int __msan_get_param_tls_offset(); + +// For testing. +SANITIZER_INTERFACE_ATTRIBUTE +u32 __msan_get_origin_tls(); +SANITIZER_INTERFACE_ATTRIBUTE +const char *__msan_get_origin_descr_if_stack(u32 id); +SANITIZER_INTERFACE_ATTRIBUTE +void __msan_partial_poison(void* data, void* shadow, uptr size); + +#ifdef __cplusplus +} // extern "C" +#endif + +#endif Modified: vendor/compiler-rt/dist/lib/CMakeLists.txt ============================================================================== --- vendor/compiler-rt/dist/lib/CMakeLists.txt Fri Jan 18 19:42:08 2013 (r245613) +++ vendor/compiler-rt/dist/lib/CMakeLists.txt Fri Jan 18 20:06:45 2013 (r245614) @@ -1,34 +1,23 @@ -# 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}) - -# Call add_clang_runtime_static_library() to make -# sure that static is built in the directory -# where Clang driver expects to find it. -if (APPLE) - set(CLANG_RUNTIME_LIB_DIR - ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/darwin) -elseif (UNIX) - # Assume Linux. - set(CLANG_RUNTIME_LIB_DIR - ${LLVM_BINARY_DIR}/lib/clang/${CLANG_VERSION}/lib/linux) -endif() -function(add_clang_runtime_static_library target_name) - set_target_properties(${target_name} PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY ${CLANG_RUNTIME_LIB_DIR}) -endfunction() - # First, add the subdirectories which contain feature-based runtime libraries # and several convenience helper libraries. -add_subdirectory(asan) -add_subdirectory(interception) -add_subdirectory(sanitizer_common) +if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux") + # AddressSanitizer is supported on Linux and Mac OS X. + # Windows support is work in progress. + add_subdirectory(asan) + add_subdirectory(interception) + add_subdirectory(sanitizer_common) + if(NOT ANDROID) + add_subdirectory(ubsan) + endif() +endif() +if("${CMAKE_SYSTEM_NAME}" STREQUAL "Linux" AND NOT ANDROID) + # ThreadSanitizer and MemorySanitizer are supported on Linux only. + add_subdirectory(tsan) + add_subdirectory(msan) +endif() # FIXME: Add support for the profile library. - # The top-level lib directory contains a large amount of C code which provides # generic implementations of the core runtime library along with optimized # architecture-specific code in various subdirectories. @@ -163,7 +152,7 @@ set(GENERIC_SOURCES umodti3.c ) -if(CAN_TARGET_X86_64) +if(CAN_TARGET_x86_64) add_library(clang_rt.x86_64 STATIC x86_64/floatdidf.c x86_64/floatdisf.c @@ -173,9 +162,10 @@ if(CAN_TARGET_X86_64) x86_64/floatundixf.S ${GENERIC_SOURCES} ) - set_target_properties(clang_rt.x86_64 PROPERTIES COMPILE_FLAGS "-std=c99 ${TARGET_X86_64_CFLAGS}") + set_target_properties(clang_rt.x86_64 PROPERTIES COMPILE_FLAGS "-std=c99 ${TARGET_x86_64_CFLAGS}") + add_clang_compiler_rt_libraries(clang_rt.x86_64) endif() -if(CAN_TARGET_I386) +if(CAN_TARGET_i386) add_library(clang_rt.i386 STATIC i386/ashldi3.S i386/ashrdi3.S @@ -193,5 +183,6 @@ if(CAN_TARGET_I386) i386/umoddi3.S ${GENERIC_SOURCES} ) - set_target_properties(clang_rt.i386 PROPERTIES COMPILE_FLAGS "-std=c99 ${TARGET_I386_CFLAGS}") + set_target_properties(clang_rt.i386 PROPERTIES COMPILE_FLAGS "-std=c99 ${TARGET_i386_CFLAGS}") + add_clang_compiler_rt_libraries(clang_rt.i386) *** DIFF OUTPUT TRUNCATED AT 1000 LINES ***