From 92a42be040f16457c75b14472f3b63228e7cf6fa Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Fri, 22 Jan 2016 10:55:07 +0100 Subject: [PATCH] Imported Upstream version 1.6.0+dfsg1 --- AUTHORS.txt | 1365 ---- CONTRIBUTING.md | 3 + README.md | 22 +- RELEASES.md | 153 + configure | 85 +- man/rustc.1 | 9 +- mk/cfg/i686-pc-windows-gnu.mk | 3 + mk/cfg/x86_64-pc-windows-gnu.mk | 3 + mk/cfg/x86_64-unknown-linux-musl.mk | 6 +- mk/clean.mk | 3 +- mk/crates.mk | 16 +- mk/dist.mk | 2 +- mk/docs.mk | 12 +- mk/install.mk | 14 +- mk/llvm.mk | 6 +- mk/main.mk | 33 +- mk/platform.mk | 17 +- mk/prepare.mk | 30 +- mk/rt.mk | 43 +- mk/snap.mk | 4 +- mk/target.mk | 39 +- mk/tests.mk | 19 +- src/compiler-rt/CMakeLists.txt | 265 +- src/compiler-rt/CREDITS.TXT | 4 + src/compiler-rt/LICENSE.TXT | 4 +- src/compiler-rt/Makefile | 6 +- src/compiler-rt/README.txt | 332 - src/compiler-rt/SDKs/README.txt | 9 - src/compiler-rt/SDKs/darwin/README.txt | 3 - .../SDKs/darwin/usr/include/errno.h | 17 - .../SDKs/darwin/usr/include/fcntl.h | 17 - .../SDKs/darwin/usr/include/inttypes.h | 86 - .../SDKs/darwin/usr/include/limits.h | 23 - .../SDKs/darwin/usr/include/stdio.h | 90 - .../SDKs/darwin/usr/include/stdlib.h | 32 - .../SDKs/darwin/usr/include/string.h | 52 - .../SDKs/darwin/usr/include/sys/errno.h | 31 - .../SDKs/darwin/usr/include/sys/fcntl.h | 52 - .../SDKs/darwin/usr/include/sys/mman.h | 42 - .../SDKs/darwin/usr/include/sys/stat.h | 25 - .../SDKs/darwin/usr/include/sys/types.h | 20 - src/compiler-rt/SDKs/linux/README.txt | 2 - .../SDKs/linux/usr/include/endian.h | 29 - .../SDKs/linux/usr/include/fcntl.h | 17 - .../SDKs/linux/usr/include/limits.h | 23 - .../SDKs/linux/usr/include/stdio.h | 44 - .../SDKs/linux/usr/include/stdlib.h | 36 - .../SDKs/linux/usr/include/string.h | 31 - .../SDKs/linux/usr/include/sys/fcntl.h | 29 - .../SDKs/linux/usr/include/sys/mman.h | 47 - .../SDKs/linux/usr/include/sys/stat.h | 24 - .../SDKs/linux/usr/include/sys/types.h | 20 - .../SDKs/linux/usr/include/unistd.h | 26 - src/compiler-rt/android/README.LLVM | 9 - .../android/include/sys/ucontext.h | 154 - src/compiler-rt/android/include/ucontext.h | 36 - .../cmake/Modules/AddCompilerRT.cmake | 346 +- .../cmake/Modules/CompilerRTCompile.cmake | 98 +- .../cmake/Modules/CompilerRTDarwinUtils.cmake | 434 + .../cmake/Modules/CompilerRTLink.cmake | 4 +- .../cmake/Modules/CompilerRTUtils.cmake | 38 +- .../cmake/Modules/SanitizerUtils.cmake | 101 +- src/compiler-rt/cmake/config-ix.cmake | 539 +- src/compiler-rt/include/CMakeLists.txt | 2 + .../include/sanitizer/allocator_interface.h | 66 + .../include/sanitizer/asan_interface.h | 85 +- .../include/sanitizer/common_interface_defs.h | 50 +- .../include/sanitizer/coverage_interface.h | 65 + .../include/sanitizer/dfsan_interface.h | 18 + .../include/sanitizer/lsan_interface.h | 23 +- .../include/sanitizer/msan_interface.h | 74 +- src/compiler-rt/lib/CMakeLists.txt | 59 +- src/compiler-rt/lib/Makefile.mk | 3 - src/compiler-rt/lib/asan/CMakeLists.txt | 267 +- src/compiler-rt/lib/asan/Makefile.mk | 11 +- src/compiler-rt/lib/asan/README.txt | 19 +- src/compiler-rt/lib/asan/asan_activation.cc | 128 +- src/compiler-rt/lib/asan/asan_activation.h | 2 +- .../lib/asan/asan_activation_flags.inc | 35 + src/compiler-rt/lib/asan/asan_allocator.cc | 908 +++ src/compiler-rt/lib/asan/asan_allocator.h | 53 +- src/compiler-rt/lib/asan/asan_allocator2.cc | 797 -- .../lib/asan/asan_asm_instrumentation.S | 601 -- src/compiler-rt/lib/asan/asan_blacklist.txt | 3 + src/compiler-rt/lib/asan/asan_debugging.cc | 141 + src/compiler-rt/lib/asan/asan_dll_thunk.cc | 219 - src/compiler-rt/lib/asan/asan_fake_stack.cc | 70 +- src/compiler-rt/lib/asan/asan_flags.cc | 179 + src/compiler-rt/lib/asan/asan_flags.h | 47 +- src/compiler-rt/lib/asan/asan_flags.inc | 136 + src/compiler-rt/lib/asan/asan_globals.cc | 97 +- src/compiler-rt/lib/asan/asan_init_version.h | 34 + src/compiler-rt/lib/asan/asan_interceptors.cc | 529 +- src/compiler-rt/lib/asan/asan_interceptors.h | 32 +- .../lib/asan/asan_interface_internal.h | 115 +- src/compiler-rt/lib/asan/asan_internal.h | 35 +- src/compiler-rt/lib/asan/asan_linux.cc | 118 +- src/compiler-rt/lib/asan/asan_mac.cc | 224 +- src/compiler-rt/lib/asan/asan_malloc_linux.cc | 102 +- src/compiler-rt/lib/asan/asan_malloc_mac.cc | 370 +- src/compiler-rt/lib/asan/asan_malloc_win.cc | 117 +- src/compiler-rt/lib/asan/asan_mapping.h | 113 +- src/compiler-rt/lib/asan/asan_new_delete.cc | 44 +- src/compiler-rt/lib/asan/asan_poisoning.cc | 124 +- src/compiler-rt/lib/asan/asan_poisoning.h | 17 +- src/compiler-rt/lib/asan/asan_posix.cc | 50 +- src/compiler-rt/lib/asan/asan_preinit.cc | 16 +- src/compiler-rt/lib/asan/asan_report.cc | 529 +- src/compiler-rt/lib/asan/asan_report.h | 87 +- src/compiler-rt/lib/asan/asan_rtl.cc | 576 +- src/compiler-rt/lib/asan/asan_stack.cc | 15 + src/compiler-rt/lib/asan/asan_stack.h | 54 +- src/compiler-rt/lib/asan/asan_stats.cc | 22 +- src/compiler-rt/lib/asan/asan_stats.h | 8 +- src/compiler-rt/lib/asan/asan_suppressions.cc | 110 + src/compiler-rt/lib/asan/asan_suppressions.h | 30 + src/compiler-rt/lib/asan/asan_thread.cc | 67 +- src/compiler-rt/lib/asan/asan_thread.h | 55 +- src/compiler-rt/lib/asan/asan_win.cc | 199 +- .../lib/asan/asan_win_dll_thunk.cc | 422 + .../asan/asan_win_dynamic_runtime_thunk.cc | 98 + .../lib/asan/scripts/asan_device_setup | 341 +- .../lib/asan/scripts/asan_symbolize.py | 231 +- .../asan/scripts/gen_asm_instrumentation.sh | 266 - src/compiler-rt/lib/asan/tests/CMakeLists.txt | 172 +- .../lib/asan/tests/asan_asm_test.cc | 165 +- .../lib/asan/tests/asan_fake_stack_test.cc | 2 + .../lib/asan/tests/asan_interface_test.cc | 79 +- .../lib/asan/tests/asan_noinst_test.cc | 51 +- .../lib/asan/tests/asan_oob_test.cc | 4 +- .../lib/asan/tests/asan_str_test.cc | 81 +- src/compiler-rt/lib/asan/tests/asan_test.cc | 196 +- .../lib/asan/tests/asan_test_config.h | 12 +- .../lib/asan/tests/asan_test_main.cc | 13 + .../lib/asan/tests/asan_test_utils.h | 18 +- src/compiler-rt/lib/builtins/CMakeLists.txt | 192 +- .../builtins/Darwin-excludes/10.4-x86_64.txt | 35 + .../lib/builtins/Darwin-excludes/10.4.txt | 96 + .../builtins/Darwin-excludes/CMakeLists.txt | 4 + .../lib/builtins/Darwin-excludes/README.TXT | 11 + .../builtins/Darwin-excludes/ios-armv7.txt | 99 + .../builtins/Darwin-excludes/ios-armv7s.txt | 99 + .../lib/builtins/Darwin-excludes/ios.txt | 1 + .../builtins/Darwin-excludes/ios6-armv7.txt | 120 + .../builtins/Darwin-excludes/ios6-armv7s.txt | 120 + .../builtins/Darwin-excludes/ios7-arm64.txt | 16 + .../builtins/Darwin-excludes/iossim-i386.txt | 82 + .../Darwin-excludes/iossim-x86_64.txt | 12 + .../lib/builtins/Darwin-excludes/iossim.txt | 1 + .../lib/builtins/Darwin-excludes/osx-i386.txt | 82 + .../builtins/Darwin-excludes/osx-x86_64.txt | 12 + .../lib/builtins/Darwin-excludes/osx.txt | 1 + src/compiler-rt/lib/builtins/Makefile.mk | 5 +- src/compiler-rt/lib/builtins/README.txt | 345 + src/compiler-rt/lib/builtins/adddf3.c | 136 +- src/compiler-rt/lib/builtins/addsf3.c | 136 +- src/compiler-rt/lib/builtins/addtf3.c | 25 + src/compiler-rt/lib/builtins/addvdi3.c | 2 +- src/compiler-rt/lib/builtins/addvsi3.c | 2 +- src/compiler-rt/lib/builtins/addvti3.c | 2 +- src/compiler-rt/lib/builtins/arm/adddf3vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/addsf3vfp.S | 2 +- .../lib/builtins/arm/aeabi_cdcmp.S | 96 + .../builtins/arm/aeabi_cdcmpeq_check_nan.c | 16 + .../lib/builtins/arm/aeabi_cfcmp.S | 91 + .../builtins/arm/aeabi_cfcmpeq_check_nan.c | 16 + src/compiler-rt/lib/builtins/arm/aeabi_dcmp.S | 2 +- src/compiler-rt/lib/builtins/arm/aeabi_div0.c | 43 + .../lib/builtins/arm/aeabi_drsub.c | 19 + src/compiler-rt/lib/builtins/arm/aeabi_fcmp.S | 2 +- .../lib/builtins/arm/aeabi_frsub.c | 19 + .../lib/builtins/arm/aeabi_idivmod.S | 2 +- .../lib/builtins/arm/aeabi_ldivmod.S | 2 +- .../lib/builtins/arm/aeabi_memcmp.S | 2 +- .../lib/builtins/arm/aeabi_memcpy.S | 2 +- .../lib/builtins/arm/aeabi_memmove.S | 2 +- .../lib/builtins/arm/aeabi_memset.S | 2 +- .../lib/builtins/arm/aeabi_uidivmod.S | 2 +- .../lib/builtins/arm/aeabi_uldivmod.S | 2 +- src/compiler-rt/lib/builtins/arm/bswapdi2.S | 12 +- src/compiler-rt/lib/builtins/arm/bswapsi2.S | 12 +- src/compiler-rt/lib/builtins/arm/clzdi2.S | 12 +- src/compiler-rt/lib/builtins/arm/clzsi2.S | 11 +- src/compiler-rt/lib/builtins/arm/comparesf2.S | 8 +- src/compiler-rt/lib/builtins/arm/divdf3vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/divmodsi4.S | 17 +- src/compiler-rt/lib/builtins/arm/divsf3vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/divsi3.S | 17 +- src/compiler-rt/lib/builtins/arm/eqdf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/eqsf2vfp.S | 2 +- .../lib/builtins/arm/extendsfdf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/fixdfsivfp.S | 2 +- src/compiler-rt/lib/builtins/arm/fixsfsivfp.S | 2 +- .../lib/builtins/arm/fixunsdfsivfp.S | 2 +- .../lib/builtins/arm/fixunssfsivfp.S | 2 +- .../lib/builtins/arm/floatsidfvfp.S | 2 +- .../lib/builtins/arm/floatsisfvfp.S | 2 +- .../lib/builtins/arm/floatunssidfvfp.S | 2 +- .../lib/builtins/arm/floatunssisfvfp.S | 2 +- src/compiler-rt/lib/builtins/arm/gedf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/gesf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/gtdf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/gtsf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/ledf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/lesf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/ltdf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/ltsf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/modsi3.S | 16 +- src/compiler-rt/lib/builtins/arm/muldf3vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/mulsf3vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/nedf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/negdf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/negsf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/nesf2vfp.S | 2 +- .../builtins/arm/restore_vfp_d8_d15_regs.S | 4 +- .../lib/builtins/arm/save_vfp_d8_d15_regs.S | 4 +- src/compiler-rt/lib/builtins/arm/subdf3vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/subsf3vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/switch16.S | 4 +- src/compiler-rt/lib/builtins/arm/switch32.S | 5 +- src/compiler-rt/lib/builtins/arm/switch8.S | 5 +- src/compiler-rt/lib/builtins/arm/switchu8.S | 5 +- src/compiler-rt/lib/builtins/arm/sync-ops.h | 16 +- .../lib/builtins/arm/sync_fetch_and_add_8.S | 2 + .../lib/builtins/arm/sync_fetch_and_and_8.S | 2 + .../lib/builtins/arm/sync_fetch_and_max_8.S | 2 + .../lib/builtins/arm/sync_fetch_and_min_8.S | 2 + .../lib/builtins/arm/sync_fetch_and_nand_8.S | 2 + .../lib/builtins/arm/sync_fetch_and_or_8.S | 2 + .../lib/builtins/arm/sync_fetch_and_sub_8.S | 2 + .../lib/builtins/arm/sync_fetch_and_umax_8.S | 2 + .../lib/builtins/arm/sync_fetch_and_umin_8.S | 2 + .../lib/builtins/arm/sync_fetch_and_xor_8.S | 2 + .../lib/builtins/arm/sync_synchronize.S | 6 +- .../lib/builtins/arm/truncdfsf2vfp.S | 2 +- src/compiler-rt/lib/builtins/arm/udivmodsi4.S | 33 +- src/compiler-rt/lib/builtins/arm/udivsi3.S | 38 +- src/compiler-rt/lib/builtins/arm/umodsi3.S | 36 +- .../lib/builtins/arm/unorddf2vfp.S | 2 +- .../lib/builtins/arm/unordsf2vfp.S | 2 +- .../builtins/{aarch64 => arm64}/Makefile.mk | 6 +- .../lib/builtins/armv6m/Makefile.mk | 20 + src/compiler-rt/lib/builtins/assembly.h | 176 +- src/compiler-rt/lib/builtins/atomic.c | 32 +- .../lib/builtins/atomic_flag_clear.c | 27 + .../lib/builtins/atomic_flag_clear_explicit.c | 28 + .../lib/builtins/atomic_flag_test_and_set.c | 27 + .../atomic_flag_test_and_set_explicit.c | 28 + .../lib/builtins/atomic_signal_fence.c | 27 + .../lib/builtins/atomic_thread_fence.c | 27 + src/compiler-rt/lib/builtins/clear_cache.c | 91 +- src/compiler-rt/lib/builtins/comparedf2.c | 7 +- src/compiler-rt/lib/builtins/comparesf2.c | 7 +- src/compiler-rt/lib/builtins/comparetf2.c | 7 +- src/compiler-rt/lib/builtins/divdc3.c | 22 +- src/compiler-rt/lib/builtins/divdf3.c | 2 +- src/compiler-rt/lib/builtins/divsc3.c | 22 +- src/compiler-rt/lib/builtins/divtf3.c | 203 + src/compiler-rt/lib/builtins/divxc3.c | 22 +- src/compiler-rt/lib/builtins/emutls.c | 192 + .../lib/builtins/enable_execute_stack.c | 14 + src/compiler-rt/lib/builtins/extenddftf2.c | 23 + src/compiler-rt/lib/builtins/extendhfsf2.c | 25 + src/compiler-rt/lib/builtins/extendsfdf2.c | 129 +- src/compiler-rt/lib/builtins/extendsftf2.c | 23 + src/compiler-rt/lib/builtins/fixdfdi.c | 57 +- src/compiler-rt/lib/builtins/fixdfsi.c | 56 +- src/compiler-rt/lib/builtins/fixdfti.c | 33 +- src/compiler-rt/lib/builtins/fixsfdi.c | 54 +- src/compiler-rt/lib/builtins/fixsfsi.c | 53 +- src/compiler-rt/lib/builtins/fixsfti.c | 33 +- src/compiler-rt/lib/builtins/fixtfdi.c | 23 + src/compiler-rt/lib/builtins/fixtfsi.c | 23 + src/compiler-rt/lib/builtins/fixtfti.c | 23 + src/compiler-rt/lib/builtins/fixunsdfdi.c | 55 +- src/compiler-rt/lib/builtins/fixunsdfsi.c | 35 +- src/compiler-rt/lib/builtins/fixunsdfti.c | 36 +- src/compiler-rt/lib/builtins/fixunssfdi.c | 55 +- src/compiler-rt/lib/builtins/fixunssfsi.c | 32 +- src/compiler-rt/lib/builtins/fixunssfti.c | 37 +- src/compiler-rt/lib/builtins/fixunstfdi.c | 22 + src/compiler-rt/lib/builtins/fixunstfsi.c | 22 + src/compiler-rt/lib/builtins/fixunstfti.c | 22 + src/compiler-rt/lib/builtins/fixunsxfdi.c | 2 + src/compiler-rt/lib/builtins/fixunsxfsi.c | 3 +- src/compiler-rt/lib/builtins/fixunsxfti.c | 5 +- src/compiler-rt/lib/builtins/fixxfdi.c | 6 +- src/compiler-rt/lib/builtins/fixxfti.c | 8 +- src/compiler-rt/lib/builtins/floatdidf.c | 4 +- src/compiler-rt/lib/builtins/floatditf.c | 50 + src/compiler-rt/lib/builtins/floatsitf.c | 50 + src/compiler-rt/lib/builtins/floatundidf.c | 6 +- src/compiler-rt/lib/builtins/floatunditf.c | 40 + src/compiler-rt/lib/builtins/floatunsitf.c | 40 + src/compiler-rt/lib/builtins/fp_add_impl.inc | 144 + src/compiler-rt/lib/builtins/fp_extend.h | 89 + .../lib/builtins/fp_extend_impl.inc | 108 + .../lib/builtins/fp_fixint_impl.inc | 41 + .../lib/builtins/fp_fixuint_impl.inc | 39 + src/compiler-rt/lib/builtins/fp_lib.h | 34 +- src/compiler-rt/lib/builtins/fp_mul_impl.inc | 116 + src/compiler-rt/lib/builtins/fp_trunc.h | 76 + .../lib/builtins/fp_trunc_impl.inc | 135 + .../lib/builtins/gcc_personality_v0.c | 77 +- src/compiler-rt/lib/builtins/i386/ashldi3.S | 4 +- src/compiler-rt/lib/builtins/i386/ashrdi3.S | 4 +- src/compiler-rt/lib/builtins/i386/chkstk.S | 34 + src/compiler-rt/lib/builtins/i386/chkstk2.S | 40 + src/compiler-rt/lib/builtins/i386/divdi3.S | 2 +- src/compiler-rt/lib/builtins/i386/floatdidf.S | 13 +- src/compiler-rt/lib/builtins/i386/floatdisf.S | 2 +- src/compiler-rt/lib/builtins/i386/floatdixf.S | 2 +- .../lib/builtins/i386/floatundidf.S | 17 +- .../lib/builtins/i386/floatundisf.S | 32 +- .../lib/builtins/i386/floatundixf.S | 17 +- src/compiler-rt/lib/builtins/i386/lshrdi3.S | 4 +- src/compiler-rt/lib/builtins/i386/moddi3.S | 2 +- src/compiler-rt/lib/builtins/i386/muldi3.S | 2 +- src/compiler-rt/lib/builtins/i386/udivdi3.S | 2 +- src/compiler-rt/lib/builtins/i386/umoddi3.S | 2 +- src/compiler-rt/lib/builtins/int_endianness.h | 34 +- src/compiler-rt/lib/builtins/int_lib.h | 65 +- src/compiler-rt/lib/builtins/int_math.h | 59 +- src/compiler-rt/lib/builtins/int_types.h | 24 +- src/compiler-rt/lib/builtins/int_util.c | 8 +- src/compiler-rt/lib/builtins/int_util.h | 12 +- .../builtins/macho_embedded/CMakeLists.txt | 4 + .../lib/builtins/macho_embedded/arm.txt | 16 + .../lib/builtins/macho_embedded/common.txt | 92 + .../lib/builtins/macho_embedded/i386.txt | 7 + .../lib/builtins/macho_embedded/thumb2-64.txt | 10 + .../lib/builtins/macho_embedded/thumb2.txt | 14 + src/compiler-rt/lib/builtins/muldc3.c | 14 +- src/compiler-rt/lib/builtins/muldf3.c | 106 +- src/compiler-rt/lib/builtins/mulsc3.c | 14 +- src/compiler-rt/lib/builtins/mulsf3.c | 96 +- src/compiler-rt/lib/builtins/multc3.c | 68 + src/compiler-rt/lib/builtins/multf3.c | 25 + src/compiler-rt/lib/builtins/mulxc3.c | 14 +- src/compiler-rt/lib/builtins/ppc/DD.h | 30 +- src/compiler-rt/lib/builtins/ppc/fixtfdi.c | 2 +- src/compiler-rt/lib/builtins/subdf3.c | 1 - src/compiler-rt/lib/builtins/subsf3.c | 1 - src/compiler-rt/lib/builtins/subtf3.c | 27 + src/compiler-rt/lib/builtins/subvdi3.c | 2 +- src/compiler-rt/lib/builtins/subvsi3.c | 2 +- src/compiler-rt/lib/builtins/subvti3.c | 2 +- src/compiler-rt/lib/builtins/truncdfhf2.c | 18 + src/compiler-rt/lib/builtins/truncdfsf2.c | 160 +- src/compiler-rt/lib/builtins/truncsfhf2.c | 24 + src/compiler-rt/lib/builtins/trunctfdf2.c | 22 + src/compiler-rt/lib/builtins/trunctfsf2.c | 22 + src/compiler-rt/lib/builtins/x86_64/chkstk.S | 39 + src/compiler-rt/lib/builtins/x86_64/chkstk2.S | 42 + .../lib/builtins/x86_64/floatundidf.S | 17 +- .../lib/builtins/x86_64/floatundisf.S | 11 +- .../lib/builtins/x86_64/floatundixf.S | 24 +- src/compiler-rt/lib/cfi/CMakeLists.txt | 4 + src/compiler-rt/lib/cfi/cfi_blacklist.txt | 26 + src/compiler-rt/lib/dfsan/CMakeLists.txt | 31 +- src/compiler-rt/lib/dfsan/Makefile.mk | 23 - src/compiler-rt/lib/dfsan/dfsan.cc | 193 +- src/compiler-rt/lib/dfsan/dfsan.h | 25 +- src/compiler-rt/lib/dfsan/dfsan_custom.cc | 315 +- src/compiler-rt/lib/dfsan/dfsan_flags.inc | 32 + src/compiler-rt/lib/dfsan/done_abilist.txt | 73 +- ...bilist.txt => libc_ubuntu1404_abilist.txt} | 340 +- .../lib/dfsan/scripts/build-libc-list.py | 1 + .../dfsan/scripts/check_custom_wrappers.sh | 36 +- .../lib/interception/CMakeLists.txt | 24 +- .../lib/interception/interception.h | 23 +- .../lib/interception/interception_linux.h | 10 +- .../lib/interception/interception_win.cc | 228 +- .../lib/interception/interception_win.h | 36 +- src/compiler-rt/lib/lsan/CMakeLists.txt | 32 +- src/compiler-rt/lib/lsan/Makefile.mk | 3 - src/compiler-rt/lib/lsan/lsan.cc | 55 +- src/compiler-rt/lib/lsan/lsan.h | 20 + src/compiler-rt/lib/lsan/lsan_allocator.cc | 72 +- src/compiler-rt/lib/lsan/lsan_allocator.h | 2 +- src/compiler-rt/lib/lsan/lsan_common.cc | 275 +- src/compiler-rt/lib/lsan/lsan_common.h | 51 +- src/compiler-rt/lib/lsan/lsan_common_linux.cc | 47 +- src/compiler-rt/lib/lsan/lsan_flags.inc | 43 + src/compiler-rt/lib/lsan/lsan_interceptors.cc | 53 +- src/compiler-rt/lib/lsan/lsan_preinit.cc | 6 +- src/compiler-rt/lib/lsan/lsan_thread.cc | 10 +- src/compiler-rt/lib/lsan/lsan_thread.h | 4 +- src/compiler-rt/lib/msan/CMakeLists.txt | 46 +- src/compiler-rt/lib/msan/Makefile.mk | 24 - src/compiler-rt/lib/msan/msan.cc | 377 +- src/compiler-rt/lib/msan/msan.h | 263 +- src/compiler-rt/lib/msan/msan.syms.extra | 1 + src/compiler-rt/lib/msan/msan_allocator.cc | 149 +- .../lib/msan/msan_chained_origin_depot.cc | 132 + .../lib/msan/msan_chained_origin_depot.h | 29 + src/compiler-rt/lib/msan/msan_flags.h | 15 +- src/compiler-rt/lib/msan/msan_flags.inc | 35 + src/compiler-rt/lib/msan/msan_interceptors.cc | 899 ++- .../lib/msan/msan_interface_internal.h | 69 +- src/compiler-rt/lib/msan/msan_linux.cc | 189 +- src/compiler-rt/lib/msan/msan_new_delete.cc | 13 +- src/compiler-rt/lib/msan/msan_origin.h | 169 + src/compiler-rt/lib/msan/msan_poisoning.cc | 174 + src/compiler-rt/lib/msan/msan_poisoning.h | 59 + src/compiler-rt/lib/msan/msan_report.cc | 117 +- src/compiler-rt/lib/msan/msan_thread.cc | 22 +- src/compiler-rt/lib/msan/msan_thread.h | 2 +- src/compiler-rt/lib/msan/tests/CMakeLists.txt | 114 +- .../lib/msan/tests/msan_loadable.cc | 18 - src/compiler-rt/lib/msan/tests/msan_test.cc | 754 +- .../lib/msan/tests/msandr_test_so.cc | 38 - .../lib/msan/tests/msandr_test_so.h | 24 - src/compiler-rt/lib/msandr/CMakeLists.txt | 26 - src/compiler-rt/lib/msandr/README.txt | 40 - src/compiler-rt/lib/msandr/msandr.cc | 900 --- src/compiler-rt/lib/profile/CMakeLists.txt | 25 +- src/compiler-rt/lib/profile/GCDAProfiling.c | 51 +- src/compiler-rt/lib/profile/InstrProfiling.c | 7 +- src/compiler-rt/lib/profile/InstrProfiling.h | 47 +- .../lib/profile/InstrProfilingBuffer.c | 82 +- .../lib/profile/InstrProfilingFile.c | 218 +- .../lib/profile/InstrProfilingInternal.h | 40 + .../profile/InstrProfilingPlatformDarwin.c | 24 +- .../lib/profile/InstrProfilingPlatformLinux.c | 48 + .../lib/profile/InstrProfilingPlatformOther.c | 23 +- .../lib/profile/InstrProfilingRuntime.cc | 12 +- .../lib/profile/InstrProfilingUtil.c | 35 + .../lib/profile/InstrProfilingUtil.h | 16 + src/compiler-rt/lib/safestack/CMakeLists.txt | 34 + src/compiler-rt/lib/safestack/safestack.cc | 246 + .../lib/sanitizer_common/CMakeLists.txt | 96 +- .../lib/sanitizer_common/Makefile.mk | 2 + .../sanitizer_common/sanitizer_addrhashmap.h | 45 +- .../sanitizer_common/sanitizer_allocator.cc | 26 +- .../sanitizer_common/sanitizer_allocator.h | 180 +- .../sanitizer_allocator_interface.h | 38 + .../sanitizer_allocator_internal.h | 38 +- .../lib/sanitizer_common/sanitizer_atomic.h | 18 +- .../sanitizer_atomic_clang_other.h | 3 +- .../sanitizer_common/sanitizer_atomic_msvc.h | 92 +- .../lib/sanitizer_common/sanitizer_common.cc | 442 +- .../lib/sanitizer_common/sanitizer_common.h | 351 +- .../sanitizer_common_interceptors.inc | 1994 ++++- .../sanitizer_common_interceptors_format.inc | 22 +- .../sanitizer_common_interceptors_ioctl.inc | 32 +- .../sanitizer_common_libcdep.cc | 122 +- .../sanitizer_common_nolibc.cc | 26 + .../sanitizer_common_syscalls.inc | 20 +- .../sanitizer_common/sanitizer_coverage.cc | 128 - .../sanitizer_coverage_libcdep.cc | 951 +++ .../sanitizer_coverage_mapping_libcdep.cc | 127 + .../sanitizer_deadlock_detector.h | 6 +- .../sanitizer_deadlock_detector1.cc | 29 +- .../sanitizer_deadlock_detector2.cc | 3 +- .../sanitizer_deadlock_detector_interface.h | 6 +- .../sanitizer_common/sanitizer_flag_parser.cc | 171 + .../sanitizer_common/sanitizer_flag_parser.h | 122 + .../lib/sanitizer_common/sanitizer_flags.cc | 268 +- .../lib/sanitizer_common/sanitizer_flags.h | 64 +- .../lib/sanitizer_common/sanitizer_flags.inc | 194 + .../lib/sanitizer_common/sanitizer_freebsd.h | 137 + .../sanitizer_common/sanitizer_interception.h | 25 - .../sanitizer_interface_internal.h | 61 + .../sanitizer_internal_defs.h | 98 +- .../lib/sanitizer_common/sanitizer_lfstack.h | 8 +- .../lib/sanitizer_common/sanitizer_libc.cc | 73 +- .../lib/sanitizer_common/sanitizer_libc.h | 43 +- .../sanitizer_common/sanitizer_libignore.cc | 48 +- .../sanitizer_common/sanitizer_libignore.h | 9 +- .../lib/sanitizer_common/sanitizer_linux.cc | 535 +- .../lib/sanitizer_common/sanitizer_linux.h | 8 +- .../sanitizer_linux_libcdep.cc | 429 +- .../lib/sanitizer_common/sanitizer_list.h | 35 +- .../lib/sanitizer_common/sanitizer_mac.cc | 145 +- .../lib/sanitizer_common/sanitizer_mac.h | 7 +- .../sanitizer_common/sanitizer_malloc_mac.inc | 350 + .../lib/sanitizer_common/sanitizer_mutex.h | 6 + .../sanitizer_persistent_allocator.cc} | 14 +- .../sanitizer_persistent_allocator.h | 72 + .../lib/sanitizer_common/sanitizer_platform.h | 72 +- .../sanitizer_platform_interceptors.h | 137 +- .../sanitizer_platform_limits_linux.cc | 14 +- .../sanitizer_platform_limits_posix.cc | 192 +- .../sanitizer_platform_limits_posix.h | 152 +- .../lib/sanitizer_common/sanitizer_posix.cc | 309 +- .../lib/sanitizer_common/sanitizer_posix.h | 83 + .../sanitizer_posix_libcdep.cc | 220 +- .../lib/sanitizer_common/sanitizer_printf.cc | 43 +- .../lib/sanitizer_common/sanitizer_procmaps.h | 10 +- .../sanitizer_procmaps_common.cc | 181 + .../sanitizer_procmaps_freebsd.cc | 88 + .../sanitizer_procmaps_linux.cc | 224 +- .../sanitizer_procmaps_mac.cc | 20 +- .../sanitizer_common/sanitizer_quarantine.h | 24 +- .../sanitizer_report_decorator.h | 17 +- .../sanitizer_common/sanitizer_stackdepot.cc | 281 +- .../sanitizer_common/sanitizer_stackdepot.h | 38 +- .../sanitizer_stackdepotbase.h | 178 + .../sanitizer_common/sanitizer_stacktrace.cc | 96 +- .../sanitizer_common/sanitizer_stacktrace.h | 99 +- .../sanitizer_stacktrace_libcdep.cc | 56 +- .../sanitizer_stacktrace_printer.cc | 144 + .../sanitizer_stacktrace_printer.h | 64 + .../sanitizer_common/sanitizer_stoptheworld.h | 3 +- .../sanitizer_stoptheworld_linux_libcdep.cc | 293 +- .../sanitizer_suppressions.cc | 145 +- .../sanitizer_common/sanitizer_suppressions.h | 40 +- .../sanitizer_common/sanitizer_symbolizer.cc | 84 +- .../sanitizer_common/sanitizer_symbolizer.h | 155 +- .../sanitizer_symbolizer_internal.h | 151 + .../sanitizer_symbolizer_libbacktrace.cc | 93 +- .../sanitizer_symbolizer_libbacktrace.h | 12 +- .../sanitizer_symbolizer_libcdep.cc | 413 +- .../sanitizer_symbolizer_mac.cc | 153 + .../sanitizer_symbolizer_mac.h | 48 + .../sanitizer_symbolizer_posix_libcdep.cc | 725 +- .../sanitizer_symbolizer_win.cc | 307 +- .../sanitizer_syscall_generic.inc | 4 +- .../sanitizer_syscall_linux_aarch64.inc | 138 + .../sanitizer_thread_registry.cc | 3 +- .../sanitizer_thread_registry.h | 11 +- .../sanitizer_tls_get_addr.cc | 18 +- .../sanitizer_common/sanitizer_tls_get_addr.h | 7 +- .../sanitizer_unwind_linux_libcdep.cc | 158 + .../lib/sanitizer_common/sanitizer_win.cc | 530 +- .../sanitizer_common/scripts/check_lint.sh | 58 +- .../lib/sanitizer_common/scripts/cpplint.py | 6 +- .../scripts/gen_dynamic_list.py | 45 +- .../lib/sanitizer_common/scripts/litlint.py | 72 + .../sanitizer_common/scripts/litlint_test.py | 23 + .../lib/sanitizer_common/scripts/sancov.py | 215 +- .../lib/sanitizer_common/tests/CMakeLists.txt | 123 +- .../tests/sanitizer_allocator_test.cc | 78 +- .../tests/sanitizer_common_test.cc | 52 +- .../tests/sanitizer_deadlock_detector_test.cc | 5 + .../tests/sanitizer_flags_test.cc | 104 +- .../sanitizer_format_interceptor_test.cc | 1 + .../tests/sanitizer_ioctl_test.cc | 25 + .../tests/sanitizer_libc_test.cc | 129 +- .../tests/sanitizer_linux_test.cc | 10 +- .../tests/sanitizer_mutex_test.cc | 15 +- .../tests/sanitizer_posix_test.cc | 22 +- .../tests/sanitizer_printf_test.cc | 25 +- .../tests/sanitizer_procmaps_test.cc | 8 +- .../tests/sanitizer_pthread_wrappers.h | 66 + .../tests/sanitizer_stackdepot_test.cc | 87 +- .../sanitizer_stacktrace_printer_test.cc | 152 + .../tests/sanitizer_stacktrace_test.cc | 53 +- .../tests/sanitizer_stoptheworld_test.cc | 10 + .../tests/sanitizer_suppressions_test.cc | 99 +- .../tests/sanitizer_symbolizer_test.cc | 58 + .../tests/sanitizer_test_config.h | 30 + .../tests/sanitizer_test_main.cc | 2 + .../tests/sanitizer_test_utils.h | 50 +- .../tests/sanitizer_thread_registry_test.cc | 11 +- src/compiler-rt/lib/tsan/CMakeLists.txt | 116 +- src/compiler-rt/lib/tsan/Makefile.mk | 18 - src/compiler-rt/lib/tsan/Makefile.old | 7 +- src/compiler-rt/lib/tsan/check_analyze.sh | 33 +- src/compiler-rt/lib/tsan/check_cmake.sh | 8 +- src/compiler-rt/lib/tsan/check_memcpy.sh | 9 +- src/compiler-rt/lib/tsan/dd/CMakeLists.txt | 50 +- src/compiler-rt/lib/tsan/dd/dd_rtl.cc | 42 +- src/compiler-rt/lib/tsan/dd/dd_rtl.h | 5 +- src/compiler-rt/lib/tsan/go/build.bat | 4 +- src/compiler-rt/lib/tsan/go/buildgo.sh | 86 +- src/compiler-rt/lib/tsan/go/tsan_go.cc | 47 +- src/compiler-rt/lib/tsan/rtl/Makefile.mk | 25 - src/compiler-rt/lib/tsan/rtl/Makefile.old | 5 +- src/compiler-rt/lib/tsan/rtl/tsan.syms.extra | 1 + src/compiler-rt/lib/tsan/rtl/tsan_clock.cc | 195 +- src/compiler-rt/lib/tsan/rtl/tsan_clock.h | 53 +- src/compiler-rt/lib/tsan/rtl/tsan_defs.h | 83 +- .../lib/tsan/rtl/tsan_dense_alloc.h | 137 + src/compiler-rt/lib/tsan/rtl/tsan_fd.cc | 56 +- src/compiler-rt/lib/tsan/rtl/tsan_fd.h | 4 +- src/compiler-rt/lib/tsan/rtl/tsan_flags.cc | 128 +- src/compiler-rt/lib/tsan/rtl/tsan_flags.h | 74 +- src/compiler-rt/lib/tsan/rtl/tsan_flags.inc | 78 + .../lib/tsan/rtl/tsan_interceptors.cc | 1233 +-- .../lib/tsan/rtl/tsan_interceptors.h | 37 + .../lib/tsan/rtl/tsan_interface.cc | 81 +- src/compiler-rt/lib/tsan/rtl/tsan_interface.h | 27 +- .../lib/tsan/rtl/tsan_interface_ann.cc | 41 +- .../lib/tsan/rtl/tsan_interface_atomic.cc | 220 +- .../lib/tsan/rtl/tsan_interface_inl.h | 32 + .../lib/tsan/rtl/tsan_interface_java.cc | 192 +- .../lib/tsan/rtl/tsan_interface_java.h | 15 +- .../lib/tsan/rtl/tsan_malloc_mac.cc | 59 + src/compiler-rt/lib/tsan/rtl/tsan_md5.cc | 14 +- src/compiler-rt/lib/tsan/rtl/tsan_mman.cc | 195 +- src/compiler-rt/lib/tsan/rtl/tsan_mman.h | 12 +- src/compiler-rt/lib/tsan/rtl/tsan_mutex.cc | 40 +- src/compiler-rt/lib/tsan/rtl/tsan_mutex.h | 9 +- src/compiler-rt/lib/tsan/rtl/tsan_mutexset.h | 4 +- .../lib/tsan/rtl/tsan_new_delete.cc | 96 + src/compiler-rt/lib/tsan/rtl/tsan_platform.h | 410 +- .../lib/tsan/rtl/tsan_platform_linux.cc | 235 +- .../lib/tsan/rtl/tsan_platform_mac.cc | 145 +- .../lib/tsan/rtl/tsan_platform_posix.cc | 124 + .../lib/tsan/rtl/tsan_platform_windows.cc | 13 +- src/compiler-rt/lib/tsan/rtl/tsan_report.cc | 87 +- src/compiler-rt/lib/tsan/rtl/tsan_report.h | 31 +- src/compiler-rt/lib/tsan/rtl/tsan_rtl.cc | 516 +- src/compiler-rt/lib/tsan/rtl/tsan_rtl.h | 318 +- src/compiler-rt/lib/tsan/rtl/tsan_rtl_amd64.S | 22 +- .../lib/tsan/rtl/tsan_rtl_mutex.cc | 142 +- .../lib/tsan/rtl/tsan_rtl_report.cc | 475 +- .../lib/tsan/rtl/tsan_rtl_thread.cc | 68 +- .../lib/tsan/rtl/tsan_stack_trace.cc | 46 + .../lib/tsan/rtl/tsan_stack_trace.h | 39 + src/compiler-rt/lib/tsan/rtl/tsan_stat.cc | 13 +- src/compiler-rt/lib/tsan/rtl/tsan_stat.h | 4 +- .../lib/tsan/rtl/tsan_suppressions.cc | 161 +- .../lib/tsan/rtl/tsan_suppressions.h | 11 +- .../lib/tsan/rtl/tsan_symbolize.cc | 110 +- src/compiler-rt/lib/tsan/rtl/tsan_symbolize.h | 2 +- src/compiler-rt/lib/tsan/rtl/tsan_sync.cc | 468 +- src/compiler-rt/lib/tsan/rtl/tsan_sync.h | 88 +- src/compiler-rt/lib/tsan/rtl/tsan_trace.h | 30 +- .../tsan/rtl/tsan_update_shadow_word_inl.h | 16 +- src/compiler-rt/lib/tsan/rtl/tsan_vector.h | 6 +- src/compiler-rt/lib/tsan/tests/CMakeLists.txt | 41 +- .../lib/tsan/tests/rtl/tsan_posix.cc | 6 + .../lib/tsan/tests/rtl/tsan_string.cc | 4 - .../lib/tsan/tests/rtl/tsan_test_util.h | 2 +- .../tsan/tests/rtl/tsan_test_util_linux.cc | 11 +- .../lib/tsan/tests/unit/tsan_clock_test.cc | 133 +- .../tsan/tests/unit/tsan_dense_alloc_test.cc | 55 + .../lib/tsan/tests/unit/tsan_flags_test.cc | 82 - .../lib/tsan/tests/unit/tsan_mman_test.cc | 73 +- .../lib/tsan/tests/unit/tsan_mutex_test.cc | 2 +- .../lib/tsan/tests/unit/tsan_stack_test.cc | 99 +- .../lib/tsan/tests/unit/tsan_sync_test.cc | 139 +- src/compiler-rt/lib/ubsan/CMakeLists.txt | 116 +- src/compiler-rt/lib/ubsan/Makefile.mk | 4 +- src/compiler-rt/lib/ubsan/ubsan_checks.inc | 53 + src/compiler-rt/lib/ubsan/ubsan_diag.cc | 223 +- src/compiler-rt/lib/ubsan/ubsan_diag.h | 116 +- src/compiler-rt/lib/ubsan/ubsan_flags.cc | 88 + src/compiler-rt/lib/ubsan/ubsan_flags.h | 49 + src/compiler-rt/lib/ubsan/ubsan_flags.inc | 26 + src/compiler-rt/lib/ubsan/ubsan_handlers.cc | 461 +- src/compiler-rt/lib/ubsan/ubsan_handlers.h | 51 +- .../lib/ubsan/ubsan_handlers_cxx.cc | 76 +- .../lib/ubsan/ubsan_handlers_cxx.h | 13 + src/compiler-rt/lib/ubsan/ubsan_init.cc | 78 + src/compiler-rt/lib/ubsan/ubsan_init.h | 31 + .../lib/ubsan/ubsan_init_standalone.cc | 35 + src/compiler-rt/lib/ubsan/ubsan_platform.h | 27 + src/compiler-rt/lib/ubsan/ubsan_type_hash.cc | 234 +- src/compiler-rt/lib/ubsan/ubsan_type_hash.h | 5 +- .../lib/ubsan/ubsan_type_hash_itanium.cc | 251 + .../lib/ubsan/ubsan_type_hash_win.cc | 81 + src/compiler-rt/lib/ubsan/ubsan_value.cc | 14 +- src/compiler-rt/lib/ubsan/ubsan_value.h | 7 - src/compiler-rt/make/platform/clang_darwin.mk | 492 -- .../make/platform/clang_darwin_test_input.c | 6 - src/compiler-rt/make/platform/clang_linux.mk | 154 - .../make/platform/clang_linux_test_input.c | 4 - .../make/platform/clang_macho_embedded.mk | 288 - .../clang_macho_embedded_test_input.c | 0 src/compiler-rt/make/platform/darwin_bni.mk | 117 - src/compiler-rt/make/platform/darwin_fat.mk | 56 - src/compiler-rt/make/platform/multi_arch.mk | 15 - src/compiler-rt/make/platform/triple.mk | 14 +- src/compiler-rt/test/CMakeLists.txt | 37 +- src/compiler-rt/test/asan/CMakeLists.txt | 153 +- .../TestCases/Android/coverage-android.cc | 143 + .../test/asan/TestCases/Android/lit.local.cfg | 11 + .../asan/TestCases/Darwin/abort_on_error.cc | 17 + .../TestCases/Darwin/address-range-limit.mm | 38 + .../Darwin/atos-symbolizer-dyld-root-path.cc | 26 + .../asan/TestCases/Darwin/atos-symbolizer.cc | 24 + .../TestCases/Darwin/crashlog-stacktraces.c | 43 + .../TestCases/Darwin/dladdr-demangling.cc | 33 + .../Darwin/dyld_insert_libraries_reexec.cc | 46 + .../Darwin/dyld_insert_libraries_remove.cc | 39 + .../asan/TestCases/Darwin/empty-section.cc | 12 + .../Darwin/interception-in-shared-lib-test.cc | 32 - .../Darwin/interface_symbols_darwin.c | 22 +- .../test/asan/TestCases/Darwin/linked-only.cc | 33 + .../Darwin/mixing-global-constructors.cc | 42 + .../test/asan/TestCases/Darwin/objc-odr.mm | 23 + .../Darwin/reexec-insert-libraries-env.cc | 9 +- .../TestCases/Darwin/sandbox-symbolizer.cc | 29 + .../TestCases/Darwin/suppressions-darwin.cc | 34 + .../TestCases/Darwin/suppressions-sandbox.cc | 26 + .../Darwin/unset-insert-libraries-on-exec.cc | 9 +- .../init-order-pthread-create-extra.cc | 2 - .../asan/TestCases/Linux/abort_on_error.cc | 18 + .../TestCases/Linux/activation-options.cc | 71 + .../Linux/asan-asm-stacktrace-test.cc | 33 + .../Linux/asan_default_suppressions.cc | 7 + .../asan/TestCases/Linux/asan_dlopen_test.cc | 1 + .../asan/TestCases/Linux/asan_prelink_test.cc | 5 +- .../TestCases/Linux/asan_preload_test-1.cc | 5 +- .../TestCases/Linux/asan_preload_test-2.cc | 9 +- .../TestCases/Linux/asan_rt_confict_test-1.cc | 3 +- .../TestCases/Linux/asan_rt_confict_test-2.cc | 1 + .../asan/TestCases/Linux/clang_gcc_abi.cc | 45 + .../test/asan/TestCases/Linux/clone_test.cc | 1 + .../asan/TestCases/Linux/coverage-missing.cc | 82 + .../test/asan/TestCases/Linux/coverage.cc | 55 - .../asan/TestCases/Linux/heavy_uar_test.cc | 54 - .../asan/TestCases/Linux/init-order-dlopen.cc | 47 + .../TestCases/Linux/init_fini_sections.cc | 24 + .../Linux/initialization-bug-any-order.cc | 4 +- .../Linux/interception_readdir_r_test.cc | 3 + .../TestCases/Linux/interface_symbols_linux.c | 19 +- .../test/asan/TestCases/Linux/kernel-area.cc | 22 +- .../test/asan/TestCases/Linux/leak.cc | 8 +- .../asan/TestCases/Linux/leak_check_segv.cc | 23 + .../asan/TestCases/Linux/malloc-in-qsort.cc | 13 +- .../TestCases/Linux/malloc_delete_mismatch.cc | 10 +- .../asan/TestCases/Linux/nohugepage_test.cc | 107 + .../asan/TestCases/Linux/odr-violation.cc | 48 +- .../asan/TestCases/Linux/overflow-in-qsort.cc | 10 +- .../test/asan/TestCases/Linux/preinit_test.cc | 6 + .../TestCases/Linux/pthread_create_version.cc | 23 + .../test/asan/TestCases/Linux/ptrace.cc | 95 +- .../TestCases/Linux/quarantine_size_mb.cc | 24 + .../Linux/read_binary_name_regtest.c | 54 + .../test/asan/TestCases/Linux/shmctl.cc | 3 + .../Linux/signal_during_stop_the_world.cc | 60 + .../asan/TestCases/Linux/sized_delete_test.cc | 89 + .../TestCases/Linux/stack-overflow-sigbus.cc | 64 + .../TestCases/Linux/stack-trace-dlclose.cc | 45 + .../test/asan/TestCases/Linux/static_tls.cc | 29 + .../test/asan/TestCases/Linux/stress_dtls.c | 11 +- .../test/asan/TestCases/Linux/syscalls.cc | 3 + .../test/asan/TestCases/Linux/uar_signals.cc | 3 +- .../test/asan/TestCases/Linux/unpoison_tls.cc | 2 +- .../asan/TestCases/Posix/allow_user_segv.cc | 59 + .../Posix/asan-symbolize-bad-path.cc | 4 + .../{ => Posix}/asan-symbolize-sanity-test.cc | 32 +- .../test/asan/TestCases/Posix/asprintf.cc | 20 + .../assign_large_valloc_to_global.cc | 8 +- .../test/asan/TestCases/Posix/closed-fds.cc | 33 + .../TestCases/Posix/coverage-caller-callee.cc | 75 + .../Posix/coverage-direct-activation.cc | 59 + .../TestCases/Posix/coverage-direct-large.cc | 65 + .../asan/TestCases/Posix/coverage-direct.cc | 83 + .../TestCases/Posix/coverage-fork-direct.cc | 38 + .../asan/TestCases/Posix/coverage-fork.cc | 37 + .../Posix/coverage-maybe-open-file.cc | 32 + .../Posix/coverage-module-unloaded.cc | 54 + .../TestCases/Posix/coverage-sandboxing.cc | 86 + .../test/asan/TestCases/Posix/coverage.cc | 80 + .../{ => Posix}/current_allocated_bytes.cc | 13 +- .../TestCases/{ => Posix}/deep_call_stack.cc | 14 +- .../{ => Posix}/deep_thread_stack.cc | 9 +- .../TestCases/{ => Posix}/dlclose-test.cc | 47 +- .../{ => Posix}/free_hook_realloc.cc | 4 +- .../test/asan/TestCases/Posix/freopen.cc | 15 + .../asan/TestCases/{ => Posix}/gc-test.cc | 13 +- .../asan/TestCases/{Linux => Posix}/glob.cc | 4 + .../{Linux => Posix}/glob_test_root/aa | 0 .../{Linux => Posix}/glob_test_root/ab | 0 .../{Linux => Posix}/glob_test_root/ba | 0 .../Posix/init-order-pthread-create.cc | 54 + .../interception-in-shared-lib-test.cc | 11 +- .../test/asan/TestCases/{ => Posix}/ioctl.cc | 4 +- .../large_allocator_unpoisons_on_free.cc | 8 +- .../test/asan/TestCases/Posix/lit.local.cfg | 9 + .../log_path_fork_test.cc.disabled | 2 +- .../TestCases/Posix/new_array_cookie_test.cc | 24 + .../Posix/new_array_cookie_uaf_test.cc | 38 + .../new_array_cookie_with_new_from_class.cc | 37 + .../test/asan/TestCases/{ => Posix}/readv.cc | 0 .../asan/TestCases/Posix/shared-lib-test.cc | 57 + .../TestCases/{ => Posix}/stack-overflow.cc | 33 +- .../{ => Posix}/stack-use-after-return.cc | 19 +- .../asan/TestCases/Posix/start-deactivated.cc | 100 + .../TestCases/{ => Posix}/strerror_r_test.cc | 0 .../{Linux => Posix}/tsd_dtor_leak.cc | 20 +- .../test/asan/TestCases/Posix/wait.cc | 33 + .../test/asan/TestCases/Posix/wait3.cc | 36 + .../test/asan/TestCases/Posix/wait4.cc | 43 + .../test/asan/TestCases/{ => Posix}/waitid.cc | 1 + .../TestCases/SharedLibs/dlclose-test-so.cc | 33 - .../SharedLibs/init-order-dlopen-so.cc | 12 - .../asan/TestCases/SharedLibs/lit.local.cfg | 4 - .../SharedLibs/shared-lib-test-so.cc | 27 - .../SharedLibs/start-deactivated-so.cc | 7 - .../asan/TestCases/Windows/aligned_mallocs.cc | 29 + .../TestCases/Windows/allocators_sanity.cc | 37 + .../asan/TestCases/Windows/beginthreadex.cc | 21 + .../Windows/bind_io_completion_callback.cc | 70 + .../test/asan/TestCases/Windows/bitfield.cc | 21 + .../asan/TestCases/Windows/bitfield_uaf.cc | 34 + .../asan/TestCases/Windows/calloc_left_oob.cc | 17 + .../TestCases/Windows/calloc_right_oob.cc | 17 + .../test/asan/TestCases/Windows/calloc_uaf.cc | 20 + .../asan/TestCases/Windows/coverage-basic.cc | 25 + .../TestCases/Windows/crt_initializers.cc | 31 + .../asan/TestCases/Windows/default_options.cc | 18 + .../asan/TestCases/Windows/demangled_names.cc | 50 + .../TestCases/Windows/dll_aligned_mallocs.cc | 34 + .../Windows/dll_allocators_sanity.cc | 39 + .../asan/TestCases/Windows/dll_and_lib.cc | 19 + .../test/asan/TestCases/Windows/dll_cerr.cc | 23 + .../asan/TestCases/Windows/dll_control_c.cc | 130 + .../test/asan/TestCases/Windows/dll_host.cc | 54 + .../TestCases/Windows/dll_intercept_memchr.cc | 21 + .../TestCases/Windows/dll_intercept_memcpy.cc | 32 + .../Windows/dll_intercept_memcpy_indirect.cc | 34 + .../TestCases/Windows/dll_intercept_memset.cc | 32 + .../TestCases/Windows/dll_intercept_strlen.cc | 28 + .../TestCases/Windows/dll_large_function.cc | 12 + .../TestCases/Windows/dll_malloc_left_oob.cc | 23 + .../asan/TestCases/Windows/dll_malloc_uaf.cc | 28 + .../asan/TestCases/Windows/dll_noreturn.cc | 28 + .../asan/TestCases/Windows/dll_null_deref.cc | 18 + .../dll_operator_array_new_left_oob.cc | 25 + ...l_operator_array_new_with_dtor_left_oob.cc | 33 + .../TestCases/Windows/dll_poison_unpoison.cc | 35 + ...report_globals_symbolization_at_startup.cc | 40 + .../test/asan/TestCases/Windows/dll_seh.cc | 60 + .../Windows/dll_stack_use_after_return.cc | 28 + .../dll_thread_stack_array_left_oob.cc | 36 + .../asan/TestCases/Windows/double_free.cc | 21 + .../Windows/double_operator_delete.cc | 25 + .../TestCases/Windows/free_hook_realloc.cc | 37 + .../test/asan/TestCases/Windows/fuse-lld.cc | 23 + .../TestCases/Windows/global_const_string.cc | 12 + .../Windows/global_const_string_oob.cc | 20 + .../asan/TestCases/Windows/hello_world.cc | 9 + .../TestCases/Windows/intercept_memcpy.cc | 31 + .../TestCases/Windows/intercept_strdup.cc | 28 + .../TestCases/Windows/intercept_strlen.cc | 27 + .../asan/TestCases/Windows/iostream_sbo.cc | 18 + .../test/asan/TestCases/Windows/lit.local.cfg | 14 + .../test/asan/TestCases/Windows/longjmp.cc | 26 + .../asan/TestCases/Windows/malloc_left_oob.cc | 17 + .../TestCases/Windows/malloc_right_oob.cc | 17 + .../test/asan/TestCases/Windows/malloc_uaf.cc | 20 + .../test/asan/TestCases/Windows/null_deref.cc | 15 + .../Windows/null_deref_multiple_dlls.cc | 40 + .../TestCases/Windows/on_error_callback.cc | 20 + .../test/asan/TestCases/Windows/oom.cc | 12 + .../Windows/operator_array_new_left_oob.cc | 17 + .../Windows/operator_array_new_right_oob.cc | 18 + .../Windows/operator_array_new_uaf.cc | 24 + .../operator_array_new_with_dtor_left_oob.cc | 25 + .../Windows/operator_delete_wrong_argument.cc | 12 + .../Windows/operator_new_left_oob.cc | 17 + .../Windows/operator_new_right_oob.cc | 17 + .../TestCases/Windows/operator_new_uaf.cc | 22 + .../TestCases/Windows/queue_user_work_item.cc | 55 + .../Windows/queue_user_work_item_report.cc | 29 + .../TestCases/Windows/realloc_left_oob.cc | 17 + .../TestCases/Windows/realloc_right_oob.cc | 17 + .../asan/TestCases/Windows/realloc_uaf.cc | 20 + .../Windows/report_after_syminitialize.cc | 21 + .../Windows/report_globals_reload_dll.cc | 51 + .../Windows/report_globals_vs_freelibrary.cc | 47 + .../test/asan/TestCases/Windows/seh.cc | 58 + .../Windows/shadow_mapping_failure.cc | 17 + .../TestCases/Windows/stack_array_left_oob.cc | 16 + .../Windows/stack_array_right_oob.cc | 16 + .../TestCases/Windows/stack_array_sanity.cc | 12 + .../Windows/stack_use_after_return.cc | 22 + .../asan/TestCases/Windows/symbols_path.cc | 22 + .../asan/TestCases/Windows/thread_simple.cc | 26 + .../Windows/thread_stack_array_left_oob.cc | 27 + .../Windows/thread_stack_array_right_oob.cc | 27 + .../TestCases/Windows/thread_stack_reuse.cc | 37 + .../asan/TestCases/Windows/thread_stress.cc | 30 + .../TestCases/Windows/thread_suspended.cc | 27 + .../asan/TestCases/Windows/throw_catch.cc | 73 + .../asan/TestCases/Windows/unsymbolized.cc | 25 + .../TestCases/Windows/use_after_realloc.cc | 23 + .../Windows/use_after_return_linkage.cc | 12 + .../test/asan/TestCases/Windows/windows_h.cc | 7 + .../Windows/wrong_downcast_on_heap.cc | 26 + .../Windows/wrong_downcast_on_stack.cc | 26 + .../asan/TestCases/alloca_big_alignment.cc | 18 + .../TestCases/alloca_detect_custom_size_.cc | 23 + .../alloca_instruments_all_paddings.cc | 24 + .../asan/TestCases/alloca_loop_unpoisoning.cc | 38 + .../asan/TestCases/alloca_overflow_partial.cc | 18 + .../asan/TestCases/alloca_overflow_right.cc | 18 + .../test/asan/TestCases/alloca_safe_access.cc | 17 + .../asan/TestCases/alloca_underflow_left.cc | 18 + .../asan/TestCases/alloca_vla_interact.cc | 46 + .../asan/TestCases/allocator_returns_null.cc | 35 +- .../test/asan/TestCases/allow_user_segv.cc | 48 - .../TestCases/asan_and_llvm_coverage_test.cc | 10 + .../test/asan/TestCases/asan_options-help.cc | 9 + .../test/asan/TestCases/atexit_stats.cc | 4 +- .../test/asan/TestCases/atoi_strict.c | 55 + .../test/asan/TestCases/atol_strict.c | 55 + .../test/asan/TestCases/atoll_strict.c | 58 + .../asan/TestCases/contiguous_container.cc | 26 +- .../TestCases/contiguous_container_crash.cc | 19 +- .../test/asan/TestCases/coverage-and-lsan.cc | 20 + .../coverage-caller-callee-total-count.cc | 42 + .../test/asan/TestCases/coverage-disabled.cc | 20 + .../test/asan/TestCases/coverage-levels.cc | 34 + .../test/asan/TestCases/coverage-order-pcs.cc | 57 + .../test/asan/TestCases/coverage-reset.cc | 55 + .../test/asan/TestCases/coverage-tracing.cc | 51 + .../test/asan/TestCases/debug_locate.cc | 80 + .../test/asan/TestCases/debug_mapping.cc | 24 + .../asan/TestCases/debug_ppc64_mapping.cc | 37 + .../test/asan/TestCases/debug_report.cc | 63 + .../test/asan/TestCases/debug_stacks.cc | 68 + .../test/asan/TestCases/deep_stack_uaf.cc | 13 +- .../test/asan/TestCases/default_blacklist.cc | 3 + .../test/asan/TestCases/default_options.cc | 4 +- .../test/asan/TestCases/describe_address.cc | 19 + .../test/asan/TestCases/double-free.cc | 6 +- .../asan/TestCases/dump_instruction_bytes.cc | 20 + .../test/asan/TestCases/frexp_interceptor.cc | 16 + .../test/asan/TestCases/global-location.cc | 38 + .../{Linux => }/heap-overflow-large.cc | 12 +- .../test/asan/TestCases/heap-overflow.cc | 18 +- .../test/asan/TestCases/heavy_uar_test.cc | 65 + .../test/asan/TestCases/init-order-atexit.cc | 2 +- .../test/asan/TestCases/init-order-dlopen.cc | 57 - .../TestCases/init-order-pthread-create.cc | 32 - .../TestCases/initialization-blacklist.cc | 15 +- .../test/asan/TestCases/initialization-bug.cc | 8 +- .../TestCases/initialization-constexpr.cc | 20 +- .../asan/TestCases/initialization-nobug.cc | 16 +- .../{Linux => }/interception_failure_test.cc | 2 + .../test/asan/TestCases/interface_test.cc | 4 +- .../asan/TestCases/intra-object-overflow.cc | 31 + .../test/asan/TestCases/invalid-free.cc | 6 +- .../test/asan/TestCases/large_func_test.cc | 2 + .../test/asan/TestCases/log-path_test.cc | 18 +- .../test/asan/TestCases/longjmp.cc | 25 + .../asan/TestCases/malloc_context_size.cc | 24 +- .../test/asan/TestCases/malloc_fill.cc | 4 +- .../test/asan/TestCases/malloc_hook.cc | 36 - .../test/asan/TestCases/max_redzone.cc | 10 +- .../test/asan/TestCases/memcmp_strict_test.cc | 4 +- .../test/asan/TestCases/mmap_limit_mb.cc | 15 +- .../test/asan/TestCases/no_asan_gen_globals.c | 5 + .../test/asan/TestCases/null_deref.cc | 25 +- .../test/asan/TestCases/on_error_callback.cc | 3 +- .../test/asan/TestCases/poison_partial.cc | 4 +- .../test/asan/TestCases/print-stack-trace.cc | 16 - .../test/asan/TestCases/print_summary.cc | 16 +- .../test/asan/TestCases/printf-1.c | 8 +- .../test/asan/TestCases/printf-2.c | 9 +- .../test/asan/TestCases/printf-3.c | 11 +- .../test/asan/TestCases/printf-4.c | 9 +- .../test/asan/TestCases/printf-5.c | 9 +- .../test/asan/TestCases/sanity_check_pure_c.c | 2 + .../test/asan/TestCases/shared-lib-test.cc | 38 - .../test/asan/TestCases/sleep_before_dying.c | 2 +- .../test/asan/TestCases/speculative_load.cc | 50 + .../test/asan/TestCases/stack-oob-frames.cc | 3 + .../test/asan/TestCases/start-deactivated.cc | 57 - .../test/asan/TestCases/strcasestr-1.c | 25 + .../test/asan/TestCases/strcasestr-2.c | 25 + .../test/asan/TestCases/strcasestr_strict.c | 28 + .../test/asan/TestCases/strcat_strict.c | 44 + .../test/asan/TestCases/strchr_strict.c | 22 + .../test/asan/TestCases/strcmp_strict.c | 26 + .../test/asan/TestCases/strcspn-1.c | 20 + .../test/asan/TestCases/strcspn-2.c | 20 + .../test/asan/TestCases/strcspn_strict.c | 26 + .../test/asan/TestCases/strdup_oob_test.cc | 5 +- .../test/asan/TestCases/strip_path_prefix.c | 4 +- .../test/asan/TestCases/strncat_strict.c | 44 + .../test/asan/TestCases/strncpy-overflow.cc | 2 + .../test/asan/TestCases/strpbrk-1.c | 20 + .../test/asan/TestCases/strpbrk-2.c | 20 + .../test/asan/TestCases/strpbrk_strict.c | 25 + .../test/asan/TestCases/strspn-1.c | 20 + .../test/asan/TestCases/strspn-2.c | 20 + .../test/asan/TestCases/strspn_strict.c | 25 + .../test/asan/TestCases/strstr-1.c | 21 + .../test/asan/TestCases/strstr-2.c | 21 + .../test/asan/TestCases/strstr_strict.c | 25 + .../test/asan/TestCases/strtol_strict.c | 135 + .../test/asan/TestCases/strtoll_strict.c | 119 + .../suppressions-exec-relative-location.cc | 47 + .../asan/TestCases/suppressions-function.cc | 30 + .../TestCases/suppressions-interceptor.cc | 24 + .../asan/TestCases/suppressions-library.cc | 42 + .../test/asan/TestCases/throw_call_test.cc | 10 +- .../test/asan/TestCases/throw_catch.cc | 35 +- .../test/asan/TestCases/throw_invoke_test.cc | 4 + .../test/asan/TestCases/time_interceptor.cc | 6 + .../test/asan/TestCases/uar_and_exceptions.cc | 7 +- .../test/asan/TestCases/use-after-delete.cc | 8 +- .../asan/TestCases/use-after-free-right.cc | 12 +- .../test/asan/TestCases/use-after-free.cc | 12 +- .../test/asan/TestCases/use-after-poison.cc | 2 +- .../TestCases/use-after-scope-dtor-order.cc | 1 + .../asan/TestCases/use-after-scope-inlined.cc | 1 + .../asan/TestCases/use-after-scope-nobug.cc | 1 + .../test/asan/TestCases/use-after-scope.cc | 3 +- .../asan/TestCases/verbose-log-path_test.cc | 24 + .../asan/TestCases/vla_chrome_testcase.cc | 30 + .../asan/TestCases/vla_condition_overflow.cc | 22 + .../test/asan/TestCases/vla_loop_overfow.cc | 22 + src/compiler-rt/test/asan/TestCases/wait.cc | 56 - .../test/asan/TestCases/zero_page_pc.cc | 16 + .../test/asan/Unit/lit.site.cfg.in | 14 +- .../test/asan/android_commands/android_run.py | 9 +- src/compiler-rt/test/asan/lit.cfg | 113 +- src/compiler-rt/test/asan/lit.site.cfg.in | 5 +- .../test/builtins/Unit/absvdi2_test.c | 2 +- .../test/builtins/Unit/absvsi2_test.c | 2 +- .../test/builtins/Unit/absvti2_test.c | 2 +- .../test/builtins/Unit/adddf3vfp_test.c | 3 +- .../test/builtins/Unit/addsf3vfp_test.c | 3 +- .../test/builtins/Unit/addtf3_test.c | 82 + .../test/builtins/Unit/addvdi3_test.c | 2 +- .../test/builtins/Unit/addvsi3_test.c | 2 +- .../test/builtins/Unit/addvti3_test.c | 2 +- .../builtins/Unit/arm/aeabi_cdcmpeq_test.c | 70 + .../builtins/Unit/arm/aeabi_cdcmple_test.c | 92 + .../builtins/Unit/arm/aeabi_cfcmpeq_test.c | 70 + .../builtins/Unit/arm/aeabi_cfcmple_test.c | 92 + .../test/builtins/Unit/arm/aeabi_drsub_test.c | 47 + .../test/builtins/Unit/arm/aeabi_frsub_test.c | 47 + .../test/builtins/Unit/arm/call_apsr.S | 43 + .../test/builtins/Unit/arm/call_apsr.h | 39 + .../test/builtins/Unit/ashldi3_test.c | 2 +- .../test/builtins/Unit/ashlti3_test.c | 2 +- .../test/builtins/Unit/ashrdi3_test.c | 2 +- .../test/builtins/Unit/ashrti3_test.c | 2 +- .../test/builtins/Unit/clear_cache_test.c | 19 +- .../test/builtins/Unit/clzdi2_test.c | 2 +- .../test/builtins/Unit/clzsi2_test.c | 2 +- .../test/builtins/Unit/clzti2_test.c | 2 +- .../test/builtins/Unit/cmpdi2_test.c | 2 +- .../test/builtins/Unit/cmpti2_test.c | 2 +- .../test/builtins/Unit/ctzdi2_test.c | 2 +- .../test/builtins/Unit/ctzsi2_test.c | 2 +- .../test/builtins/Unit/ctzti2_test.c | 2 +- .../test/builtins/Unit/divdc3_test.c | 3 +- .../test/builtins/Unit/divdf3vfp_test.c | 3 +- .../test/builtins/Unit/divdi3_test.c | 2 +- .../test/builtins/Unit/divmodsi4_test.c | 2 +- .../test/builtins/Unit/divsc3_test.c | 3 +- .../test/builtins/Unit/divsf3vfp_test.c | 3 +- .../test/builtins/Unit/divsi3_test.c | 2 +- .../test/builtins/Unit/divtc3_test.c | 5 +- .../test/builtins/Unit/divtf3_test.c | 95 + .../test/builtins/Unit/divti3_test.c | 2 +- .../test/builtins/Unit/divxc3_test.c | 2 +- .../builtins/Unit/enable_execute_stack_test.c | 20 +- .../test/builtins/Unit/extebdsfdf2vfp_test.c | 3 +- .../test/builtins/Unit/extenddftf2_test.c | 83 + .../test/builtins/Unit/extendhfsf2_test.c | 113 + .../test/builtins/Unit/extendsftf2_test.c | 84 + .../test/builtins/Unit/ffsdi2_test.c | 2 +- .../test/builtins/Unit/ffsti2_test.c | 2 +- .../test/builtins/Unit/fixdfdi_test.c | 2 +- .../test/builtins/Unit/fixdfti_test.c | 2 +- .../test/builtins/Unit/fixsfdi_test.c | 2 +- .../test/builtins/Unit/fixsfti_test.c | 2 +- .../test/builtins/Unit/fixtfdi_test.c | 71 + .../test/builtins/Unit/fixtfsi_test.c | 65 + .../test/builtins/Unit/fixtfti_test.c | 83 + .../test/builtins/Unit/fixunsdfdi_test.c | 5 +- .../test/builtins/Unit/fixunsdfsi_test.c | 4 +- .../test/builtins/Unit/fixunsdfsivfp_test.c | 3 +- .../test/builtins/Unit/fixunsdfti_test.c | 5 +- .../test/builtins/Unit/fixunssfdi_test.c | 4 +- .../test/builtins/Unit/fixunssfsi_test.c | 4 +- .../test/builtins/Unit/fixunssfti_test.c | 2 +- .../test/builtins/Unit/fixunstfdi_test.c | 13 +- .../test/builtins/Unit/fixunstfsi_test.c | 67 + .../test/builtins/Unit/fixunstfti_test.c | 103 + .../test/builtins/Unit/fixunsxfdi_test.c | 2 +- .../test/builtins/Unit/fixunsxfsi_test.c | 2 +- .../test/builtins/Unit/fixunsxfti_test.c | 2 +- .../test/builtins/Unit/fixxfdi_test.c | 2 +- .../test/builtins/Unit/fixxfti_test.c | 2 +- .../test/builtins/Unit/floatdidf_test.c | 2 +- .../test/builtins/Unit/floatdisf_test.c | 2 +- .../test/builtins/Unit/floatditf_test.c | 69 + .../test/builtins/Unit/floatdixf_test.c | 2 +- .../test/builtins/Unit/floatsidfvfp_test.c | 3 +- .../test/builtins/Unit/floatsisfvfp_test.c | 3 +- .../test/builtins/Unit/floatsitf_test.c | 61 + .../test/builtins/Unit/floattidf_test.c | 2 +- .../test/builtins/Unit/floattisf_test.c | 2 +- .../test/builtins/Unit/floattixf_test.c | 2 +- .../test/builtins/Unit/floatundidf_test.c | 2 +- .../test/builtins/Unit/floatundisf_test.c | 2 +- .../test/builtins/Unit/floatunditf_test.c | 67 + .../test/builtins/Unit/floatundixf_test.c | 2 +- .../test/builtins/Unit/floatunsitf_test.c | 56 + .../test/builtins/Unit/floatunssidfvfp_test.c | 3 +- .../test/builtins/Unit/floatunssisfvfp_test.c | 4 +- .../test/builtins/Unit/floatuntidf_test.c | 2 +- .../test/builtins/Unit/floatuntisf_test.c | 2 +- .../test/builtins/Unit/floatuntixf_test.c | 2 +- src/compiler-rt/test/builtins/Unit/fp_test.h | 56 + .../test/builtins/Unit/lshrdi3_test.c | 2 +- .../test/builtins/Unit/lshrti3_test.c | 2 +- .../test/builtins/Unit/moddi3_test.c | 2 +- .../test/builtins/Unit/modsi3_test.c | 2 +- .../test/builtins/Unit/modti3_test.c | 2 +- .../test/builtins/Unit/muldc3_test.c | 3 +- .../test/builtins/Unit/muldf3vfp_test.c | 3 +- .../test/builtins/Unit/muldi3_test.c | 2 +- .../test/builtins/Unit/mulodi4_test.c | 2 +- .../test/builtins/Unit/mulosi4_test.c | 2 +- .../test/builtins/Unit/muloti4_test.c | 2 +- .../test/builtins/Unit/mulsc3_test.c | 3 +- .../test/builtins/Unit/mulsf3vfp_test.c | 3 +- .../test/builtins/Unit/multc3_test.c | 9 +- .../test/builtins/Unit/multf3_test.c | 95 + .../test/builtins/Unit/multi3_test.c | 2 +- .../test/builtins/Unit/mulvdi3_test.c | 2 +- .../test/builtins/Unit/mulvsi3_test.c | 2 +- .../test/builtins/Unit/mulvti3_test.c | 2 +- .../test/builtins/Unit/mulxc3_test.c | 2 +- .../test/builtins/Unit/negdf2vfp_test.c | 2 +- .../test/builtins/Unit/negdi2_test.c | 2 +- .../test/builtins/Unit/negsf2vfp_test.c | 3 +- .../test/builtins/Unit/negti2_test.c | 2 +- .../test/builtins/Unit/negvdi2_test.c | 2 +- .../test/builtins/Unit/negvsi2_test.c | 2 +- .../test/builtins/Unit/negvti2_test.c | 4 +- .../test/builtins/Unit/paritydi2_test.c | 2 +- .../test/builtins/Unit/paritysi2_test.c | 2 +- .../test/builtins/Unit/parityti2_test.c | 2 +- .../test/builtins/Unit/popcountdi2_test.c | 2 +- .../test/builtins/Unit/popcountsi2_test.c | 2 +- .../test/builtins/Unit/popcountti2_test.c | 2 +- .../test/builtins/Unit/powidf2_test.c | 2 +- .../test/builtins/Unit/powisf2_test.c | 2 +- .../test/builtins/Unit/powitf2_test.c | 5 +- .../test/builtins/Unit/powixf2_test.c | 2 +- .../test/builtins/Unit/ppc/floatditf_test.c | 2 +- .../test/builtins/Unit/ppc/floatunditf_test.c | 2 +- .../test/builtins/Unit/subdf3vfp_test.c | 2 +- .../test/builtins/Unit/subsf3vfp_test.c | 3 +- .../test/builtins/Unit/subtf3_test.c | 74 + .../test/builtins/Unit/subvdi3_test.c | 2 +- .../test/builtins/Unit/subvsi3_test.c | 2 +- .../test/builtins/Unit/subvti3_test.c | 2 +- .../test/builtins/Unit/truncdfhf2_test.c | 114 + .../test/builtins/Unit/truncdfsf2_test.c | 38 + .../test/builtins/Unit/truncdfsf2vfp_test.c | 3 +- .../test/builtins/Unit/truncsfhf2_test.c | 114 + .../test/builtins/Unit/trunctfdf2_test.c | 77 + .../test/builtins/Unit/trunctfsf2_test.c | 76 + .../test/builtins/Unit/ucmpdi2_test.c | 2 +- .../test/builtins/Unit/ucmpti2_test.c | 2 +- .../test/builtins/Unit/udivdi3_test.c | 2 +- .../test/builtins/Unit/udivmoddi4_test.c | 2 +- .../test/builtins/Unit/udivmodsi4_test.c | 2 +- .../test/builtins/Unit/udivmodti4_test.c | 2 +- .../test/builtins/Unit/udivsi3_test.c | 2 +- .../test/builtins/Unit/udivti3_test.c | 2 +- .../test/builtins/Unit/umoddi3_test.c | 2 +- .../test/builtins/Unit/umodsi3_test.c | 2 +- .../test/builtins/Unit/umodti3_test.c | 2 +- src/compiler-rt/test/cfi/CMakeLists.txt | 38 + src/compiler-rt/test/cfi/README.txt | 8 + src/compiler-rt/test/cfi/anon-namespace.cpp | 91 + src/compiler-rt/test/cfi/bad-cast.cpp | 137 + .../test/cfi/base-derived-destructor.cpp | 93 + src/compiler-rt/test/cfi/create-derivers.test | 20 + .../test/cfi/icall/bad-signature.c | 27 + .../test/cfi/icall/external-call.c | 27 + src/compiler-rt/test/cfi/icall/lit.local.cfg | 3 + src/compiler-rt/test/cfi/lit.cfg | 19 + src/compiler-rt/test/cfi/lit.site.cfg.in | 2 + .../test/cfi/multiple-inheritance.cpp | 74 + src/compiler-rt/test/cfi/nvcall.cpp | 59 + src/compiler-rt/test/cfi/overwrite.cpp | 61 + src/compiler-rt/test/cfi/sibling.cpp | 54 + src/compiler-rt/test/cfi/simple-fail.cpp | 95 + src/compiler-rt/test/cfi/simple-pass.cpp | 121 + src/compiler-rt/test/cfi/utils.h | 67 + src/compiler-rt/test/cfi/vdtor.cpp | 56 + src/compiler-rt/test/dfsan/basic.c | 11 +- .../test/dfsan/{custom.c => custom.cc} | 156 +- src/compiler-rt/test/dfsan/dump_labels.c | 69 + src/compiler-rt/test/dfsan/flags.c | 6 +- src/compiler-rt/test/dfsan/fncall.c | 4 +- src/compiler-rt/test/dfsan/label_count.c | 12 +- src/compiler-rt/test/dfsan/lit.cfg | 2 +- src/compiler-rt/test/dfsan/propagate.c | 4 +- src/compiler-rt/test/dfsan/vararg.c | 24 + src/compiler-rt/test/dfsan/write_callback.c | 4 +- src/compiler-rt/test/lit.common.cfg | 107 +- src/compiler-rt/test/lit.common.configured.in | 15 +- src/compiler-rt/test/lsan/CMakeLists.txt | 18 +- .../test/lsan/TestCases/ignore_object.cc | 5 +- .../lsan/TestCases/ignore_object_errors.cc | 6 +- .../test/lsan/TestCases/leak_check_at_exit.cc | 4 +- .../leak_check_before_thread_started.cc | 31 + .../lsan/TestCases/recoverable_leak_check.cc | 32 + .../lsan/TestCases/register_root_region.cc | 2 +- .../test/lsan/TestCases/stale_stack_leak.cc | 1 + .../test/lsan/TestCases/suppressions_file.cc | 14 +- .../test/lsan/TestCases/swapcontext.cc | 5 + .../test/lsan/TestCases/use_registers.cc | 5 +- .../lsan/TestCases/use_stacks_threaded.cc | 5 +- src/compiler-rt/test/lsan/lit.common.cfg | 7 +- .../test/msan/Linux/fopencookie.cc | 65 + src/compiler-rt/test/msan/Linux/forkpty.cc | 18 + src/compiler-rt/test/msan/Linux/getresid.cc | 6 +- src/compiler-rt/test/msan/Linux/glob.cc | 6 +- .../test/msan/Linux/glob_altdirfunc.cc | 6 +- .../test/msan/Linux/glob_nomatch.cc | 4 +- .../test/msan/{ => Linux}/ioctl_sound.cc | 4 +- .../test/msan/{ => Linux}/mallinfo.cc | 3 +- src/compiler-rt/test/msan/Linux/mincore.cc | 36 + src/compiler-rt/test/msan/Linux/obstack.cc | 37 + .../test/msan/Linux/process_vm_readv.cc | 67 + src/compiler-rt/test/msan/Linux/sunrpc.cc | 12 +- .../test/msan/Linux/sunrpc_bytes.cc | 4 +- .../test/msan/Linux/sunrpc_string.cc | 4 +- src/compiler-rt/test/msan/Linux/syscalls.cc | 26 +- src/compiler-rt/test/msan/Linux/tcgetattr.cc | 2 +- src/compiler-rt/test/msan/Linux/xattr.cc | 6 +- .../test/msan/SharedLibs/dso-origin-so.cc | 14 - .../test/msan/SharedLibs/dso-origin.h | 4 - .../test/msan/SharedLibs/lit.local.cfg | 4 - .../test/msan/allocator_mapping.cc | 36 + src/compiler-rt/test/msan/backtrace.cc | 4 +- src/compiler-rt/test/msan/c-strdup.c | 8 +- src/compiler-rt/test/msan/chained_origin.cc | 30 +- .../test/msan/chained_origin_empty_stack.cc | 34 + .../test/msan/chained_origin_limits.cc | 178 + .../test/msan/chained_origin_memcpy.cc | 24 +- .../test/msan/chained_origin_with_signals.cc | 12 +- .../test/msan/check_mem_is_initialized.cc | 16 +- src/compiler-rt/test/msan/coverage-levels.cc | 28 + src/compiler-rt/test/msan/cxa_atexit.cc | 2 +- src/compiler-rt/test/msan/death-callback.cc | 8 +- src/compiler-rt/test/msan/dlerror.cc | 6 +- src/compiler-rt/test/msan/dso-origin.cc | 37 +- src/compiler-rt/test/msan/dtls_test.c | 10 +- src/compiler-rt/test/msan/dtor-base-access.cc | 49 + src/compiler-rt/test/msan/dtor-bit-fields.cc | 70 + .../test/msan/dtor-derived-class.cc | 39 + src/compiler-rt/test/msan/dtor-member.cc | 48 + ...le-inheritance-nontrivial-class-members.cc | 152 + .../test/msan/dtor-multiple-inheritance.cc | 98 + .../test/msan/dtor-trivial-class-members.cc | 55 + src/compiler-rt/test/msan/dtor-trivial.cpp | 41 + .../msan/dtor-vtable-multiple-inheritance.cc | 72 + src/compiler-rt/test/msan/dtor-vtable.cc | 68 + src/compiler-rt/test/msan/errno.cc | 2 +- src/compiler-rt/test/msan/fork.cc | 121 + src/compiler-rt/test/msan/ftime.cc | 5 +- .../test/msan/getaddrinfo-positive.cc | 6 +- src/compiler-rt/test/msan/getaddrinfo.cc | 2 +- src/compiler-rt/test/msan/getc_unlocked.c | 16 +- src/compiler-rt/test/msan/getline.cc | 20 +- src/compiler-rt/test/msan/getline_test_data | 2 - src/compiler-rt/test/msan/heap-origin.cc | 16 +- src/compiler-rt/test/msan/icmp_slt_allones.cc | 20 + src/compiler-rt/test/msan/iconv.cc | 9 +- src/compiler-rt/test/msan/if_indextoname.cc | 8 +- src/compiler-rt/test/msan/ifaddrs.cc | 10 +- src/compiler-rt/test/msan/initgroups.cc | 3 +- .../test/msan/insertvalue_origin.cc | 5 +- src/compiler-rt/test/msan/ioctl.cc | 4 +- src/compiler-rt/test/msan/ioctl_custom.cc | 10 +- src/compiler-rt/test/msan/keep-going-dso.cc | 12 +- src/compiler-rt/test/msan/keep-going.cc | 16 +- src/compiler-rt/test/msan/lit.cfg | 6 +- src/compiler-rt/test/msan/memcmp_test.cc | 15 + src/compiler-rt/test/msan/mktime.cc | 4 +- src/compiler-rt/test/msan/mmap.cc | 71 + .../test/msan/mmap_below_shadow.cc | 22 +- .../msan/msan_check_mem_is_initialized.cc | 28 + src/compiler-rt/test/msan/msan_copy_shadow.cc | 34 + src/compiler-rt/test/msan/msan_dump_shadow.cc | 6 +- .../test/msan/msan_print_shadow.cc | 12 +- .../test/msan/msan_print_shadow2.cc | 10 +- .../test/msan/msan_print_shadow3.cc | 16 + src/compiler-rt/test/msan/mul_by_const.cc | 27 + .../test/msan/no_sanitize_memory.cc | 16 +- .../test/msan/no_sanitize_memory_prop.cc | 19 +- src/compiler-rt/test/msan/open_memstream.cc | 18 - .../test/msan/origin-store-long.cc | 21 + src/compiler-rt/test/msan/param_tls_limit.cc | 78 + src/compiler-rt/test/msan/print_stats.cc | 45 + .../test/msan/pthread_getattr_np_deadlock.cc | 2 +- .../test/msan/pthread_setcancelstate.cc | 19 + src/compiler-rt/test/msan/ptrace.cc | 36 - src/compiler-rt/test/msan/rand_r.cc | 4 +- src/compiler-rt/test/msan/readdir64.cc | 16 +- .../test/msan/realloc-large-origin.cc | 30 + src/compiler-rt/test/msan/realloc-origin.cc | 21 + .../test/msan/report-demangling.cc | 19 + src/compiler-rt/test/msan/scandir.cc | 6 +- src/compiler-rt/test/msan/scandir_null.cc | 6 +- src/compiler-rt/test/msan/select.cc | 8 +- .../test/msan/select_float_origin.cc | 24 + src/compiler-rt/test/msan/sem_getvalue.cc | 22 + src/compiler-rt/test/msan/setlocale.cc | 2 +- .../test/msan/signal_stress_test.cc | 3 + src/compiler-rt/test/msan/stack-origin.cc | 16 +- src/compiler-rt/test/msan/stack-origin2.cc | 41 + src/compiler-rt/test/msan/strlen_of_shadow.cc | 16 +- src/compiler-rt/test/msan/strxfrm.cc | 15 + .../test/msan/sync_lock_set_and_test.cc | 2 +- src/compiler-rt/test/msan/test.h | 15 + src/compiler-rt/test/msan/textdomain.cc | 2 +- src/compiler-rt/test/msan/times.cc | 2 +- src/compiler-rt/test/msan/tls_reuse.cc | 2 +- src/compiler-rt/test/msan/tzset.cc | 2 +- .../test/msan/unaligned_read_origin.cc | 4 +- src/compiler-rt/test/msan/unpoison_string.cc | 4 +- src/compiler-rt/test/msan/use-after-dtor.cc | 45 + src/compiler-rt/test/msan/use-after-free.cc | 18 +- src/compiler-rt/test/msan/vector_cvt.cc | 7 +- src/compiler-rt/test/msan/vector_select.cc | 12 +- .../test/msan/wrap_indirect_calls.cc | 64 - .../test/msan/wrap_indirect_calls/caller.cc | 51 - .../msan/wrap_indirect_calls/lit.local.cfg | 3 - .../test/msan/wrap_indirect_calls/one.cc | 3 - .../test/msan/wrap_indirect_calls/two.cc | 11 - .../test/msan/wrap_indirect_calls/wrapper.cc | 11 - .../test/msan/wrap_indirect_calls2.cc | 42 - .../test/msan/wrap_indirect_calls_in_rtl.cc | 80 - .../profile/Inputs/gcc-flag-compatibility.c | 8 + .../profile/Inputs/instrprof-dlopen-func.c | 1 + .../profile/Inputs/instrprof-dlopen-func2.c | 1 + .../profile/Inputs/instrprof-dlopen-main.c | 47 + .../profile/Inputs/instrprof-dynamic-a.cpp | 7 + .../profile/Inputs/instrprof-dynamic-b.cpp | 7 + .../profile/Inputs/instrprof-dynamic-header.h | 7 + .../profile/Inputs/instrprof-dynamic-main.cpp | 9 + .../test/profile/gcc-flag-compatibility.test | 17 + .../test/profile/instrprof-basic.c | 23 +- .../test/profile/instrprof-dlopen.test | 34 + .../profile/instrprof-dynamic-one-shared.test | 23 + .../profile/instrprof-dynamic-two-shared.test | 24 + ...rof-override-filename-then-reset-default.c | 19 + .../instrprof-override-filename-with-env.c | 14 + .../profile/instrprof-override-filename.c | 14 + .../test/profile/instrprof-reset-counters.c | 19 + ...nstrprof-set-filename-then-reset-default.c | 18 + .../test/profile/instrprof-set-filename.c | 14 + .../test/profile/instrprof-without-libc.c | 60 + .../instrprof-write-file-atexit-explicitly.c | 17 + .../test/profile/instrprof-write-file-only.c | 35 + .../test/profile/instrprof-write-file.c | 34 + src/compiler-rt/test/profile/lit.cfg | 20 +- src/compiler-rt/test/safestack/CMakeLists.txt | 29 + .../test/safestack/buffer-copy-vla.c | 26 + src/compiler-rt/test/safestack/buffer-copy.c | 25 + src/compiler-rt/test/safestack/init.c | 9 + src/compiler-rt/test/safestack/lit.cfg | 24 + .../test/safestack/lit.site.cfg.in | 8 + src/compiler-rt/test/safestack/lto.c | 12 + src/compiler-rt/test/safestack/overflow.c | 23 + .../test/safestack/pthread-cleanup.c | 31 + src/compiler-rt/test/safestack/pthread.c | 42 + src/compiler-rt/test/safestack/utils.h | 8 + .../test/sanitizer_common/CMakeLists.txt | 67 +- .../TestCases/Darwin/abort_on_error.cc | 19 + .../TestCases/Darwin/lit.local.cfg | 9 + .../TestCases/Linux/abort_on_error.cc | 20 + .../TestCases/Linux/aligned_alloc.c | 8 + .../TestCases/Linux/assert.cc | 24 + .../TestCases/Linux/clock_gettime.c | 11 + .../sanitizer_common/TestCases/Linux/fpe.cc | 30 + .../TestCases/Linux/getpass.cc | 33 + .../Linux/getpwnam_r_invalid_user.cc | 20 + .../TestCases/Linux/hard_rss_limit_mb_test.cc | 37 + .../TestCases/Linux/lit.local.cfg | 9 + .../TestCases/Linux/mlock_test.cc | 13 + .../TestCases/Linux/open_memstream.cc | 70 + .../TestCases/Linux/ptrace.cc | 105 + .../sanitizer_set_death_callback_test.cc | 40 + .../TestCases/Linux/sched_getparam.cc | 13 + .../TestCases/Linux/sem_init_glibc.cc | 32 + .../TestCases/Linux/signal_segv_handler.cc | 48 + .../TestCases/Linux/soft_rss_limit_mb_test.cc | 66 + .../TestCases/Linux/timerfd.cc | 52 + .../TestCases/Posix/decorate_proc_maps.cc | 61 + .../TestCases/Posix/lit.local.cfg | 9 + .../sanitizer_common/TestCases/corelimit.cc | 16 + .../TestCases}/malloc_hook.cc | 20 +- .../TestCases/options-help.cc | 8 + .../TestCases/options-include.cc | 46 + .../TestCases/options-invalid.cc | 15 + .../TestCases/print-stack-trace.cc | 24 + .../TestCases/pthread_mutexattr_get.cc | 19 + .../sanitizer_common/TestCases/strcasestr.c | 16 + .../test/sanitizer_common/TestCases/strcspn.c | 13 + .../test/sanitizer_common/TestCases/strpbrk.c | 14 + .../test/sanitizer_common/TestCases/strspn.c | 13 + .../test/sanitizer_common/TestCases/strstr.c | 12 + .../sanitizer_common/Unit/lit.site.cfg.in | 15 + .../test/sanitizer_common/lit.common.cfg | 51 + .../test/sanitizer_common/lit.site.cfg.in | 20 +- src/compiler-rt/test/tsan/CMakeLists.txt | 18 +- .../test/tsan/Helpers/blacklist.txt | 1 - .../test/tsan/Helpers/lit.local.cfg | 2 - src/compiler-rt/test/tsan/Linux/lit.local.cfg | 9 + .../test/tsan/{ => Linux}/mutex_robust.cc | 0 .../test/tsan/{ => Linux}/mutex_robust2.cc | 2 +- .../test/tsan/{ => Linux}/user_fopen.cc | 2 +- .../test/tsan/{ => Linux}/user_malloc.cc | 2 +- .../test/tsan/SharedLibs/lit.local.cfg | 4 - .../tsan/SharedLibs/load_shared_lib-so.cc | 25 - .../test/tsan/aligned_vs_unaligned_race.cc | 17 +- .../test/tsan/allocator_returns_null.cc | 2 +- .../test/tsan/annotate_happens_before.cc | 57 + src/compiler-rt/test/tsan/atexit.cc | 29 + src/compiler-rt/test/tsan/atexit2.cc | 26 + src/compiler-rt/test/tsan/atomic_free.cc | 9 +- src/compiler-rt/test/tsan/atomic_free2.cc | 9 +- src/compiler-rt/test/tsan/atomic_free3.cc | 28 + src/compiler-rt/test/tsan/atomic_norace.cc | 11 +- src/compiler-rt/test/tsan/atomic_race.cc | 13 +- src/compiler-rt/test/tsan/atomic_stack.cc | 9 +- .../test/tsan/bench_shadow_flush.cc | 14 +- src/compiler-rt/test/tsan/benign_race.cc | 8 +- src/compiler-rt/test/tsan/blacklist.cc | 5 +- src/compiler-rt/test/tsan/blacklist2.cc | 49 + src/compiler-rt/test/tsan/cond_cancel.c | 16 +- src/compiler-rt/test/tsan/cond_destruction.cc | 53 + src/compiler-rt/test/tsan/cond_race.cc | 13 +- .../tsan/deadlock_detector_stress_test.cc | 49 +- src/compiler-rt/test/tsan/deep_stack1.cc | 20 +- src/compiler-rt/test/tsan/deflake.bash | 17 + src/compiler-rt/test/tsan/dl_iterate_phdr.cc | 56 + src/compiler-rt/test/tsan/dlclose.cc | 58 + src/compiler-rt/test/tsan/fd_close_norace.cc | 8 +- src/compiler-rt/test/tsan/fd_dup_norace2.cc | 60 + src/compiler-rt/test/tsan/fd_dup_race.cc | 33 + src/compiler-rt/test/tsan/fd_location.cc | 10 +- src/compiler-rt/test/tsan/fd_pipe_race.cc | 10 +- src/compiler-rt/test/tsan/fd_stdout_race.cc | 10 +- src/compiler-rt/test/tsan/fork_deadlock.cc | 8 +- .../test/tsan/fork_multithreaded.cc | 14 +- src/compiler-rt/test/tsan/free_race.c | 14 +- src/compiler-rt/test/tsan/free_race2.c | 2 +- src/compiler-rt/test/tsan/getline_nohang.cc | 4 + src/compiler-rt/test/tsan/global_race.cc | 37 +- src/compiler-rt/test/tsan/global_race2.cc | 27 + src/compiler-rt/test/tsan/global_race3.cc | 31 + src/compiler-rt/test/tsan/halt_on_error.cc | 10 +- src/compiler-rt/test/tsan/heap_race.cc | 6 +- src/compiler-rt/test/tsan/ignore_free.cc | 11 +- src/compiler-rt/test/tsan/ignore_lib0.cc | 7 +- src/compiler-rt/test/tsan/ignore_lib1.cc | 6 +- src/compiler-rt/test/tsan/ignore_lib2.cc | 2 +- src/compiler-rt/test/tsan/ignore_lib3.cc | 5 +- src/compiler-rt/test/tsan/ignore_malloc.cc | 9 +- src/compiler-rt/test/tsan/ignore_race.cc | 8 +- src/compiler-rt/test/tsan/ignore_sync.cc | 2 +- .../test/tsan/inlined_memcpy_race.cc | 30 +- .../test/tsan/inlined_memcpy_race2.cc | 37 + src/compiler-rt/test/tsan/java.h | 14 +- src/compiler-rt/test/tsan/java_alloc.cc | 12 +- src/compiler-rt/test/tsan/java_finalizer.cc | 29 + src/compiler-rt/test/tsan/java_heap_init.cc | 28 + src/compiler-rt/test/tsan/java_lock.cc | 20 +- src/compiler-rt/test/tsan/java_lock_move.cc | 17 +- src/compiler-rt/test/tsan/java_lock_rec.cc | 23 +- .../test/tsan/java_lock_rec_race.cc | 25 +- .../test/tsan/java_move_overlap.cc | 74 + .../test/tsan/java_move_overlap_race.cc | 55 + src/compiler-rt/test/tsan/java_race.cc | 17 +- src/compiler-rt/test/tsan/java_race_move.cc | 16 +- src/compiler-rt/test/tsan/java_race_pc.cc | 36 + src/compiler-rt/test/tsan/java_rwlock.cc | 20 +- .../test/tsan/java_symbolization.cc | 44 + src/compiler-rt/test/tsan/java_volatile.cc | 42 + .../test/tsan/large_malloc_meta.cc | 28 + .../test/tsan/libcxx/lit.local.cfg | 10 + .../test/tsan/libcxx/std_shared_ptr.cc | 24 + src/compiler-rt/test/tsan/lit.cfg | 41 +- src/compiler-rt/test/tsan/lit.site.cfg.in | 2 + src/compiler-rt/test/tsan/load_shared_lib.cc | 46 +- src/compiler-rt/test/tsan/longjmp.cc | 5 + src/compiler-rt/test/tsan/longjmp2.cc | 5 + src/compiler-rt/test/tsan/longjmp3.cc | 7 +- src/compiler-rt/test/tsan/longjmp4.cc | 7 +- src/compiler-rt/test/tsan/malloc_hook.cc | 52 - src/compiler-rt/test/tsan/malloc_stack.cc | 9 +- src/compiler-rt/test/tsan/map32bit.cc | 44 + src/compiler-rt/test/tsan/memcmp_race.cc | 42 + src/compiler-rt/test/tsan/memcpy_race.cc | 11 +- src/compiler-rt/test/tsan/mmap_large.cc | 16 +- src/compiler-rt/test/tsan/mmap_stress.cc | 47 + src/compiler-rt/test/tsan/mop1.c | 40 + src/compiler-rt/test/tsan/mop_with_offset.cc | 11 +- src/compiler-rt/test/tsan/mop_with_offset2.cc | 11 +- src/compiler-rt/test/tsan/must_deadlock.cc | 50 + .../test/tsan/mutex_bad_read_lock.cc | 2 +- .../test/tsan/mutex_bad_read_unlock.cc | 2 +- src/compiler-rt/test/tsan/mutex_bad_unlock.cc | 2 +- src/compiler-rt/test/tsan/mutex_cycle2.c | 14 +- .../test/tsan/mutex_destroy_locked.cc | 2 +- .../test/tsan/mutex_double_lock.cc | 2 +- src/compiler-rt/test/tsan/mutexset1.cc | 10 +- src/compiler-rt/test/tsan/mutexset2.cc | 10 +- src/compiler-rt/test/tsan/mutexset3.cc | 10 +- src/compiler-rt/test/tsan/mutexset4.cc | 10 +- src/compiler-rt/test/tsan/mutexset5.cc | 10 +- src/compiler-rt/test/tsan/mutexset6.cc | 10 +- src/compiler-rt/test/tsan/mutexset7.cc | 21 +- src/compiler-rt/test/tsan/mutexset8.cc | 10 +- src/compiler-rt/test/tsan/oob_race.cc | 26 - .../test/tsan/pthread_atfork_deadlock.c | 33 + src/compiler-rt/test/tsan/race_on_barrier.c | 11 +- src/compiler-rt/test/tsan/race_on_barrier2.c | 2 +- src/compiler-rt/test/tsan/race_on_heap.cc | 4 +- src/compiler-rt/test/tsan/race_on_mutex.c | 15 +- src/compiler-rt/test/tsan/race_on_mutex2.c | 11 +- src/compiler-rt/test/tsan/race_on_puts.cc | 30 + src/compiler-rt/test/tsan/race_on_read.cc | 22 +- .../test/tsan/race_on_speculative_load.cc | 11 +- src/compiler-rt/test/tsan/race_on_write.cc | 11 +- src/compiler-rt/test/tsan/race_stress.cc | 25 + .../test/tsan/race_top_suppression.cc | 29 + .../test/tsan/race_top_suppression1.cc | 32 + .../test/tsan/race_with_finished_thread.cc | 13 +- .../real_deadlock_detector_stress_test.cc | 186 + src/compiler-rt/test/tsan/restore_stack.cc | 50 + src/compiler-rt/test/tsan/setuid.c | 26 + src/compiler-rt/test/tsan/setuid2.c | 21 + src/compiler-rt/test/tsan/signal_cond.cc | 51 + src/compiler-rt/test/tsan/signal_errno.cc | 15 +- src/compiler-rt/test/tsan/signal_longjmp.cc | 73 + src/compiler-rt/test/tsan/signal_malloc.cc | 10 +- src/compiler-rt/test/tsan/signal_recursive.cc | 126 + src/compiler-rt/test/tsan/signal_reset.cc | 74 + src/compiler-rt/test/tsan/signal_sync.cc | 55 + src/compiler-rt/test/tsan/signal_thread.cc | 52 + src/compiler-rt/test/tsan/signal_write.cc | 27 + src/compiler-rt/test/tsan/sigsuspend.cc | 4 +- src/compiler-rt/test/tsan/simple_race.c | 11 +- src/compiler-rt/test/tsan/simple_race.cc | 9 +- src/compiler-rt/test/tsan/simple_stack.c | 26 +- src/compiler-rt/test/tsan/simple_stack2.cc | 22 +- src/compiler-rt/test/tsan/sleep_sync.cc | 10 +- src/compiler-rt/test/tsan/sleep_sync2.cc | 10 +- src/compiler-rt/test/tsan/stack_race.cc | 10 +- src/compiler-rt/test/tsan/stack_race2.cc | 10 +- src/compiler-rt/test/tsan/stack_sync_reuse.cc | 65 + src/compiler-rt/test/tsan/static_init3.cc | 2 +- src/compiler-rt/test/tsan/sunrpc.cc | 1 + .../test/tsan/suppress_same_address.cc | 9 +- .../test/tsan/suppress_same_stacks.cc | 2 +- .../test/tsan/suppressions_global.cc | 2 +- .../test/tsan/suppressions_race.cc | 10 +- .../test/tsan/suppressions_race2.cc | 10 +- src/compiler-rt/test/tsan/test.h | 59 + src/compiler-rt/test/tsan/test_output.sh | 13 +- src/compiler-rt/test/tsan/thread_detach.c | 20 + src/compiler-rt/test/tsan/thread_detach2.c | 28 + .../test/tsan/thread_end_with_ignore.cc | 2 +- .../test/tsan/thread_end_with_ignore2.cc | 2 +- .../test/tsan/thread_end_with_ignore3.cc | 2 +- src/compiler-rt/test/tsan/thread_leak3.c | 10 +- src/compiler-rt/test/tsan/thread_leak4.c | 10 +- src/compiler-rt/test/tsan/thread_leak5.c | 10 +- src/compiler-rt/test/tsan/thread_name.cc | 23 +- src/compiler-rt/test/tsan/thread_name2.cc | 19 +- src/compiler-rt/test/tsan/tiny_race.c | 9 +- src/compiler-rt/test/tsan/tls_race.cc | 10 +- src/compiler-rt/test/tsan/tls_race2.cc | 10 +- src/compiler-rt/test/tsan/unaligned_norace.cc | 18 +- src/compiler-rt/test/tsan/unaligned_race.cc | 11 +- .../test/tsan/vptr_harmful_race.cc | 10 +- .../test/tsan/vptr_harmful_race2.cc | 10 +- .../test/tsan/vptr_harmful_race3.cc | 10 +- .../test/tsan/vptr_harmful_race4.cc | 34 + .../test/tsan/write_in_reader_lock.cc | 11 +- src/compiler-rt/test/ubsan/CMakeLists.txt | 54 +- .../ubsan/TestCases/Float/cast-overflow.cpp | 106 +- .../ubsan/TestCases/Integer/add-overflow.cpp | 8 +- .../test/ubsan/TestCases/Integer/div-zero.cpp | 2 +- .../TestCases/Integer/incdec-overflow.cpp | 12 +- .../TestCases/Integer/negate-overflow.cpp | 4 +- .../ubsan/TestCases/Integer/no-recover.cpp | 4 +- .../test/ubsan/TestCases/Integer/shift.cpp | 34 +- .../ubsan/TestCases/Integer/sub-overflow.cpp | 8 +- .../test/ubsan/TestCases/Integer/summary.cpp | 13 + .../ubsan/TestCases/Integer/uadd-overflow.cpp | 8 +- .../TestCases/Integer/uincdec-overflow.cpp | 8 +- .../ubsan/TestCases/Integer/usub-overflow.cpp | 8 +- .../ubsan/TestCases/Misc/Linux/lit.local.cfg | 9 + .../TestCases/Misc/Linux/ubsan_options.cc | 18 + .../test/ubsan/TestCases/Misc/bool.cpp | 7 +- .../test/ubsan/TestCases/Misc/bounds.cpp | 18 +- .../ubsan/TestCases/Misc/coverage-levels.cc | 41 + .../ubsan/TestCases/Misc/deduplication.cpp | 1 + .../test/ubsan/TestCases/Misc/enum.cpp | 6 +- .../ubsan/TestCases/Misc/log-path_test.cc | 36 + .../ubsan/TestCases/Misc/missing_return.cpp | 10 +- .../test/ubsan/TestCases/Misc/nonnull-arg.cpp | 61 + .../test/ubsan/TestCases/Misc/nonnull.cpp | 15 + .../test/ubsan/TestCases/Misc/unreachable.cpp | 2 +- .../TestCases/TypeCheck/Function/function.cpp | 28 +- .../ubsan/TestCases/TypeCheck/misaligned.cpp | 53 +- .../test/ubsan/TestCases/TypeCheck/null.cpp | 12 +- .../vptr-virtual-base-construction.cpp | 13 + .../TestCases/TypeCheck/vptr-virtual-base.cpp | 18 + .../test/ubsan/TestCases/TypeCheck/vptr.cpp | 94 +- src/compiler-rt/test/ubsan/lit.common.cfg | 46 +- src/compiler-rt/test/ubsan/lit.site.cfg.in | 2 + .../unittests/lit.common.unit.configured.in | 2 +- src/compiler-rt/www/index.html | 4 +- src/compiler-rt/www/menu.html.incl | 4 +- src/compiletest/compiletest.rs | 2 - src/compiletest/header.rs | 12 + src/compiletest/raise_fd_limit.rs | 27 +- src/compiletest/runtest.rs | 44 +- src/doc/README.md | 2 +- src/doc/book/README.md | 47 + src/doc/{trpl => book}/SUMMARY.md | 28 +- src/doc/{trpl => book}/advanced-linking.md | 0 .../{trpl => book}/associated-constants.md | 4 +- src/doc/{trpl => book}/associated-types.md | 0 src/doc/{trpl => book}/attributes.md | 0 src/doc/{trpl => book}/benchmark-tests.md | 0 src/doc/{trpl => book}/bibliography.md | 0 src/doc/{trpl => book}/borrow-and-asref.md | 0 .../{trpl => book}/box-syntax-and-patterns.md | 0 src/doc/book/casting-between-types.md | 202 + .../choosing-your-guarantees.md | 0 src/doc/{trpl => book}/closures.md | 0 src/doc/{trpl => book}/comments.md | 0 src/doc/{trpl => book}/compiler-plugins.md | 29 +- src/doc/{trpl => book}/concurrency.md | 18 +- .../{trpl => book}/conditional-compilation.md | 0 src/doc/{trpl => book}/const-and-static.md | 0 src/doc/{trpl => book}/crates-and-modules.md | 0 src/doc/{trpl => book}/custom-allocators.md | 3 +- src/doc/{trpl => book}/deref-coercions.md | 0 src/doc/{trpl => book}/dining-philosophers.md | 51 +- src/doc/{trpl => book}/documentation.md | 67 +- src/doc/{trpl => book}/drop.md | 0 src/doc/{trpl => book}/effective-rust.md | 0 src/doc/{trpl => book}/enums.md | 0 src/doc/{trpl => book}/error-handling.md | 44 +- src/doc/{trpl => book}/ffi.md | 19 +- src/doc/{trpl => book}/functions.md | 0 src/doc/{trpl => book}/generics.md | 0 src/doc/book/getting-started.md | 610 ++ src/doc/{trpl => book}/glossary.md | 0 src/doc/{trpl => book}/guessing-game.md | 92 +- src/doc/{trpl => book}/if-let.md | 12 +- src/doc/{trpl => book}/if.md | 0 src/doc/{trpl => book}/inline-assembly.md | 0 src/doc/{trpl => book}/intrinsics.md | 0 src/doc/{trpl => book}/iterators.md | 0 src/doc/{trpl => book}/lang-items.md | 4 +- src/doc/{trpl => book}/learn-rust.md | 0 src/doc/{trpl => book}/lifetimes.md | 3 +- src/doc/{trpl => book}/loops.md | 12 +- src/doc/{trpl => book}/macros.md | 2 +- src/doc/{trpl => book}/match.md | 0 src/doc/{trpl => book}/method-syntax.md | 31 +- src/doc/{trpl => book}/mutability.md | 0 src/doc/{trpl => book}/nightly-rust.md | 0 src/doc/book/no-stdlib.md | 86 + .../operators-and-overloading.md | 0 src/doc/{trpl => book}/ownership.md | 2 +- src/doc/{trpl => book}/patterns.md | 0 src/doc/{trpl => book}/primitive-types.md | 0 src/doc/{trpl => book}/raw-pointers.md | 0 .../references-and-borrowing.md | 11 +- src/doc/{trpl => book}/release-channels.md | 0 .../rust-inside-other-languages.md | 3 +- src/doc/{trpl => book}/slice-patterns.md | 0 src/doc/{trpl => book}/strings.md | 39 +- src/doc/{trpl => book}/structs.md | 0 .../{trpl => book}/syntax-and-semantics.md | 0 src/doc/{trpl => book}/syntax-index.md | 19 +- src/doc/{trpl => book}/testing.md | 5 +- .../{trpl => book}/the-stack-and-the-heap.md | 18 +- src/doc/{trpl => book}/trait-objects.md | 0 src/doc/{trpl => book}/traits.md | 28 +- src/doc/{trpl => book}/type-aliases.md | 4 +- src/doc/{trpl => book}/ufcs.md | 23 +- src/doc/{trpl => book}/unsafe.md | 0 src/doc/{trpl => book}/unsized-types.md | 0 ...using-rust-without-the-standard-library.md | 41 + src/doc/{trpl => book}/variable-bindings.md | 0 src/doc/{trpl => book}/vectors.md | 0 src/doc/complement-design-faq.md | 6 +- src/doc/complement-lang-faq.md | 2 +- src/doc/index.md | 49 +- src/doc/nomicon/destructors.md | 15 +- src/doc/nomicon/lifetimes.md | 2 +- src/doc/nomicon/other-reprs.md | 3 + src/doc/nomicon/unbounded-lifetimes.md | 3 +- src/doc/reference.md | 97 +- src/doc/rustc-ux-guidelines.md | 73 + src/doc/style/safety/lib-guarantees.md | 4 +- src/doc/trpl/README.md | 198 - src/doc/trpl/casting-between-types.md | 89 - src/doc/trpl/getting-started.md | 5 - src/doc/trpl/hello-cargo.md | 210 - src/doc/trpl/hello-world.md | 171 - src/doc/trpl/installing-rust.md | 184 - src/doc/trpl/no-stdlib.md | 164 - src/etc/add-authors.sh | 32 - src/etc/apple-darwin.supp | 104 +- src/etc/featureck.py | 2 +- src/etc/make-win-dist.py | 14 +- src/etc/tidy.py | 3 +- src/etc/unicode.py | 3 - src/etc/x86.supp | 511 +- src/jemalloc/VERSION | 2 +- src/liballoc/arc.rs | 77 +- src/liballoc/boxed.rs | 47 +- src/liballoc/boxed_test.rs | 3 +- src/liballoc/heap.rs | 2 +- src/liballoc/lib.rs | 15 +- src/liballoc/raw_vec.rs | 56 +- src/liballoc/rc.rs | 61 +- src/liballoc_jemalloc/lib.rs | 7 +- src/liballoc_system/lib.rs | 25 +- src/libarena/lib.rs | 24 +- src/libcollections/binary_heap.rs | 117 +- src/libcollections/borrow.rs | 50 +- src/libcollections/btree/map.rs | 423 +- src/libcollections/btree/node.rs | 334 +- src/libcollections/btree/set.rs | 208 +- src/libcollections/enum_set.rs | 83 +- src/libcollections/fmt.rs | 15 +- src/libcollections/lib.rs | 21 +- src/libcollections/linked_list.rs | 132 +- src/libcollections/range.rs | 24 +- src/libcollections/slice.rs | 172 +- src/libcollections/str.rs | 873 +- src/libcollections/string.rs | 500 +- src/libcollections/vec.rs | 208 +- src/libcollections/vec_deque.rs | 718 +- src/libcollectionstest/lib.rs | 2 +- src/libcore/any.rs | 1 + src/libcore/array.rs | 32 + src/libcore/cell.rs | 6 +- src/libcore/char.rs | 167 +- src/libcore/clone.rs | 2 + src/libcore/cmp.rs | 14 +- src/libcore/cmp_macros.rs | 47 - src/libcore/default.rs | 7 +- src/libcore/fmt/mod.rs | 35 +- src/libcore/fmt/num.rs | 1 + src/libcore/hash/mod.rs | 4 + src/libcore/intrinsics.rs | 117 +- src/libcore/iter.rs | 1710 +++- src/libcore/lib.rs | 24 +- src/libcore/macros.rs | 73 +- src/libcore/marker.rs | 58 +- src/libcore/mem.rs | 8 +- src/libcore/num/bignum.rs | 11 + src/libcore/num/f32.rs | 7 +- src/libcore/num/f64.rs | 7 +- src/libcore/num/flt2dec/mod.rs | 5 +- src/libcore/num/mod.rs | 630 +- src/libcore/num/wrapping.rs | 182 +- src/libcore/ops.rs | 31 +- src/libcore/option.rs | 7 +- src/libcore/prelude/v1.rs | 14 + src/libcore/ptr.rs | 9 +- src/libcore/result.rs | 25 +- src/libcore/simd.rs | 2 +- src/libcore/slice.rs | 184 +- src/libcore/str/mod.rs | 126 +- src/libcore/sync/atomic.rs | 11 +- src/libcore/tuple.rs | 3 - src/libcoretest/lib.rs | 1 + src/libcoretest/num/mod.rs | 57 + src/libflate/lib.rs | 8 +- src/libfmt_macros/lib.rs | 19 +- src/libgetopts/lib.rs | 912 ++- src/libgraphviz/lib.rs | 67 +- src/liblibc/.travis.yml | 53 + src/liblibc/Cargo.toml | 17 + src/liblibc/LICENSE-APACHE | 201 + src/liblibc/LICENSE-MIT | 25 + src/liblibc/README.md | 116 + src/liblibc/appveyor.yml | 25 + src/liblibc/ci/README.md | 68 + src/liblibc/ci/Vagrantfile | 38 + src/liblibc/ci/cargo-config | 13 + src/liblibc/ci/dox.sh | 33 + src/liblibc/ci/landing-page-footer.html | 7 + src/liblibc/ci/landing-page-head.html | 4 + src/liblibc/ci/run-all.sh | 48 + src/liblibc/ci/run-travis.sh | 118 + src/liblibc/ci/run.sh | 49 + src/liblibc/lib.rs | 7184 ----------------- src/liblibc/libc-test/Cargo.toml | 11 + src/liblibc/libc-test/build.rs | 275 + src/liblibc/libc-test/src/main.rs | 6 + src/liblibc/src/dox.rs | 130 + src/liblibc/src/lib.rs | 245 + src/liblibc/src/macros.rs | 107 + src/liblibc/src/unix/bsd/apple/b32.rs | 15 + src/liblibc/src/unix/bsd/apple/b64.rs | 15 + src/liblibc/src/unix/bsd/apple/mod.rs | 718 ++ .../src/unix/bsd/freebsdlike/dragonfly.rs | 7 + .../src/unix/bsd/freebsdlike/freebsd.rs | 7 + src/liblibc/src/unix/bsd/freebsdlike/mod.rs | 563 ++ src/liblibc/src/unix/bsd/freebsdlike/x86.rs | 31 + .../src/unix/bsd/freebsdlike/x86_64.rs | 30 + src/liblibc/src/unix/bsd/mod.rs | 182 + .../src/unix/bsd/openbsdlike/bitrig.rs | 20 + src/liblibc/src/unix/bsd/openbsdlike/mod.rs | 552 ++ .../src/unix/bsd/openbsdlike/netbsd.rs | 22 + .../src/unix/bsd/openbsdlike/openbsd.rs | 22 + src/liblibc/src/unix/mod.rs | 598 ++ src/liblibc/src/unix/notbsd/android/b32.rs | 8 + src/liblibc/src/unix/notbsd/android/b64.rs | 8 + src/liblibc/src/unix/notbsd/android/mod.rs | 388 + src/liblibc/src/unix/notbsd/linux/mips.rs | 288 + src/liblibc/src/unix/notbsd/linux/mod.rs | 343 + src/liblibc/src/unix/notbsd/linux/musl.rs | 272 + .../src/unix/notbsd/linux/other/b32/arm.rs | 2 + .../src/unix/notbsd/linux/other/b32/mod.rs | 84 + .../src/unix/notbsd/linux/other/b32/x86.rs | 2 + .../unix/notbsd/linux/other/b64/aarch64.rs | 59 + .../src/unix/notbsd/linux/other/b64/mod.rs | 28 + .../src/unix/notbsd/linux/other/b64/x86_64.rs | 57 + .../src/unix/notbsd/linux/other/mod.rs | 254 + src/liblibc/src/unix/notbsd/mod.rs | 392 + src/liblibc/src/windows.rs | 178 + src/liblog/directive.rs | 8 +- src/liblog/lib.rs | 17 +- src/liblog/macros.rs | 8 +- src/librand/chacha.rs | 6 +- src/librand/distributions/gamma.rs | 5 +- src/librand/distributions/mod.rs | 7 +- src/librand/isaac.rs | 3 +- src/librand/lib.rs | 15 +- src/librand/rand_impls.rs | 2 +- src/librand/reseeding.rs | 1 - src/librbml/lib.rs | 13 +- src/librustc/diagnostics.rs | 261 +- src/librustc/front/check_attr.rs | 29 +- src/librustc/front/map/blocks.rs | 4 +- src/librustc/front/map/collector.rs | 48 +- src/librustc/front/map/definitions.rs | 2 +- src/librustc/front/map/mod.rs | 29 +- src/librustc/lib.rs | 24 +- src/librustc/lint/builtin.rs | 20 +- src/librustc/lint/context.rs | 261 +- src/librustc/lint/mod.rs | 4 +- src/librustc/metadata/csearch.rs | 404 - src/librustc/metadata/inline.rs | 64 - src/librustc/metadata/mod.rs | 23 - src/librustc/middle/cfg/construct.rs | 6 +- src/librustc/middle/check_const.rs | 68 +- src/librustc/middle/check_loop.rs | 9 +- src/librustc/middle/check_match.rs | 51 +- src/librustc/middle/check_rvalues.rs | 10 +- src/librustc/middle/check_static_recursion.rs | 27 +- src/librustc/middle/const_eval.rs | 329 +- src/librustc/middle/cstore.rs | 409 + src/librustc/middle/dataflow.rs | 18 +- src/librustc/middle/dead.rs | 134 +- src/librustc/middle/def.rs | 4 +- src/librustc/middle/def_id.rs | 2 +- src/librustc/middle/dependency_format.rs | 82 +- src/librustc/middle/effect.rs | 12 +- src/librustc/middle/entry.rs | 34 +- src/librustc/middle/expr_use_visitor.rs | 8 +- src/librustc/middle/infer/error_reporting.rs | 54 +- src/librustc/middle/infer/mod.rs | 74 +- .../middle/infer/region_inference/graphviz.rs | 60 +- .../middle/infer/region_inference/mod.rs | 627 +- src/librustc/middle/intrinsicck.rs | 13 +- src/librustc/middle/lang_items.rs | 22 +- src/librustc/middle/liveness.rs | 60 +- src/librustc/middle/mem_categorization.rs | 176 +- src/librustc/middle/pat_util.rs | 40 +- src/librustc/middle/privacy.rs | 50 +- src/librustc/middle/reachable.rs | 122 +- src/librustc/middle/region.rs | 32 +- src/librustc/middle/resolve_lifetime.rs | 56 +- src/librustc/middle/stability.rs | 341 +- src/librustc/middle/traits/coherence.rs | 27 +- src/librustc/middle/traits/error_reporting.rs | 2 +- src/librustc/middle/traits/mod.rs | 70 +- src/librustc/middle/traits/project.rs | 48 +- src/librustc/middle/traits/select.rs | 450 +- src/librustc/middle/ty/context.rs | 51 +- src/librustc/middle/ty/error.rs | 15 +- src/librustc/middle/ty/mod.rs | 92 +- src/librustc/middle/ty/outlives.rs | 8 +- src/librustc/middle/ty/structural_impls.rs | 1 + src/librustc/middle/ty/sty.rs | 3 +- src/librustc/middle/ty/util.rs | 2 +- src/librustc/middle/weak_lang_items.rs | 22 +- src/{librustc_mir => librustc/mir}/repr.rs | 142 +- src/librustc/mir/tcx.rs | 190 + src/librustc/mir/visit.rs | 246 + src/librustc/session/config.rs | 158 +- .../{metadata => session}/filesearch.rs | 106 +- src/librustc/session/mod.rs | 32 +- src/librustc/util/common.rs | 49 +- src/librustc/util/ppaux.rs | 50 +- src/librustc_back/lib.rs | 5 +- src/librustc_back/rpath.rs | 4 +- src/librustc_back/sha2.rs | 19 +- src/librustc_back/svh.rs | 69 +- .../target/i686_pc_windows_gnu.rs | 13 +- src/librustc_back/target/mod.rs | 33 +- src/librustc_back/target/windows_base.rs | 28 +- .../target/x86_64_pc_windows_gnu.rs | 3 - .../target/x86_64_unknown_linux_musl.rs | 4 +- src/librustc_bitflags/lib.rs | 4 +- src/librustc_borrowck/borrowck/check_loans.rs | 25 +- .../borrowck/gather_loans/gather_moves.rs | 33 +- .../borrowck/gather_loans/lifetime.rs | 41 +- .../borrowck/gather_loans/mod.rs | 23 +- .../borrowck/gather_loans/move_error.rs | 26 +- .../borrowck/gather_loans/restrictions.rs | 15 +- src/librustc_borrowck/borrowck/mod.rs | 85 +- src/librustc_borrowck/graphviz.rs | 5 +- src/librustc_borrowck/lib.rs | 4 +- src/librustc_data_structures/lib.rs | 2 +- src/librustc_driver/driver.rs | 749 +- src/librustc_driver/lib.rs | 346 +- src/librustc_driver/pretty.rs | 329 +- src/librustc_driver/target_features.rs | 31 +- src/librustc_driver/test.rs | 244 +- src/librustc_front/fold.rs | 383 +- src/librustc_front/hir.rs | 199 +- .../{visit.rs => intravisit.rs} | 113 +- src/librustc_front/lib.rs | 5 +- src/librustc_front/lowering.rs | 1309 +-- src/librustc_front/print/pprust.rs | 222 +- src/librustc_front/util.rs | 108 +- src/librustc_lint/bad_style.rs | 6 +- src/librustc_lint/builtin.rs | 122 +- src/librustc_lint/lib.rs | 18 +- src/librustc_lint/types.rs | 11 +- src/librustc_lint/unused.rs | 30 +- src/librustc_llvm/diagnostic.rs | 3 - src/librustc_llvm/lib.rs | 8 +- .../middle => librustc_metadata}/astencode.rs | 53 +- .../metadata => librustc_metadata}/common.rs | 8 - .../metadata => librustc_metadata}/creader.rs | 148 +- src/librustc_metadata/csearch.rs | 499 ++ .../metadata => librustc_metadata}/cstore.rs | 73 +- .../metadata => librustc_metadata}/decoder.rs | 93 +- src/librustc_metadata/diagnostics.rs | 77 + .../metadata => librustc_metadata}/encoder.rs | 84 +- .../metadata => librustc_metadata}/index.rs | 0 src/librustc_metadata/lib.rs | 60 + .../metadata => librustc_metadata}/loader.rs | 48 +- .../macro_import.rs | 16 +- src/librustc_metadata/macros.rs | 46 + .../tydecode.rs | 2 +- .../tyencode.rs | 2 +- src/librustc_mir/build/block.rs | 2 +- src/librustc_mir/build/cfg.rs | 9 +- src/librustc_mir/build/expr/as_constant.rs | 2 +- src/librustc_mir/build/expr/as_lvalue.rs | 4 +- src/librustc_mir/build/expr/as_operand.rs | 4 +- src/librustc_mir/build/expr/as_rvalue.rs | 21 +- src/librustc_mir/build/expr/as_temp.rs | 6 +- src/librustc_mir/build/expr/into.rs | 10 +- src/librustc_mir/build/into.rs | 4 +- src/librustc_mir/build/matches/mod.rs | 312 +- src/librustc_mir/build/matches/simplify.rs | 40 +- src/librustc_mir/build/matches/test.rs | 421 +- src/librustc_mir/build/matches/util.rs | 63 +- src/librustc_mir/build/misc.rs | 28 +- src/librustc_mir/build/mod.rs | 39 +- src/librustc_mir/build/scope.rs | 78 +- src/librustc_mir/build/stmt.rs | 98 +- src/librustc_mir/graphviz/mod.rs | 2 +- src/librustc_mir/{tcx => hair/cx}/block.rs | 31 +- src/librustc_mir/{tcx => hair/cx}/expr.rs | 127 +- src/librustc_mir/{tcx => hair/cx}/mod.rs | 28 +- src/librustc_mir/{tcx => hair/cx}/pattern.rs | 303 +- src/librustc_mir/{tcx => hair/cx}/to_ref.rs | 29 - src/librustc_mir/{hair.rs => hair/mod.rs} | 68 +- src/librustc_mir/lib.rs | 6 +- src/librustc_mir/mir_map.rs | 105 +- src/librustc_mir/transform/erase_regions.rs | 234 + .../transform/mod.rs} | 14 +- src/librustc_mir/transform/simplify_cfg.rs | 135 + src/librustc_mir/transform/util.rs | 51 + src/librustc_platform_intrinsics/lib.rs | 2 +- .../plugin => librustc_plugin}/build.rs | 7 +- src/librustc_plugin/diagnostics.rs | 19 + .../plugin/mod.rs => librustc_plugin/lib.rs} | 24 + .../plugin => librustc_plugin}/load.rs | 15 +- .../plugin => librustc_plugin}/registry.rs | 4 +- src/librustc_privacy/lib.rs | 587 +- src/librustc_resolve/build_reduced_graph.rs | 750 +- src/librustc_resolve/check_unused.rs | 35 +- src/librustc_resolve/diagnostics.rs | 87 +- src/librustc_resolve/lib.rs | 2508 +++--- src/librustc_resolve/record_exports.rs | 62 +- src/librustc_resolve/resolve_imports.rs | 437 +- src/librustc_trans/back/archive.rs | 7 +- src/librustc_trans/back/link.rs | 80 +- src/librustc_trans/back/linker.rs | 6 +- src/librustc_trans/back/msvc/mod.rs | 425 +- src/librustc_trans/back/msvc/registry.rs | 52 +- src/librustc_trans/back/write.rs | 26 +- src/librustc_trans/diagnostics.rs | 15 +- src/librustc_trans/lib.rs | 11 +- src/librustc_trans/save/dump_csv.rs | 22 +- src/librustc_trans/save/mod.rs | 18 +- src/librustc_trans/save/recorder.rs | 10 +- src/librustc_trans/save/span_utils.rs | 13 +- src/librustc_trans/trans/_match.rs | 131 +- src/librustc_trans/trans/adt.rs | 161 +- src/librustc_trans/trans/asm.rs | 2 +- src/librustc_trans/trans/attributes.rs | 5 +- src/librustc_trans/trans/base.rs | 1448 ++-- src/librustc_trans/trans/builder.rs | 26 + src/librustc_trans/trans/callee.rs | 29 +- src/librustc_trans/trans/cleanup.rs | 4 +- src/librustc_trans/trans/closure.rs | 6 +- src/librustc_trans/trans/common.rs | 162 +- src/librustc_trans/trans/consts.rs | 20 +- src/librustc_trans/trans/context.rs | 47 +- src/librustc_trans/trans/controlflow.rs | 2 +- src/librustc_trans/trans/datum.rs | 10 +- .../trans/debuginfo/create_scope_map.rs | 14 +- src/librustc_trans/trans/debuginfo/doc.rs | 6 +- .../trans/debuginfo/metadata.rs | 33 +- src/librustc_trans/trans/debuginfo/mod.rs | 13 +- .../trans/debuginfo/type_names.rs | 25 +- src/librustc_trans/trans/declare.rs | 8 +- src/librustc_trans/trans/expr.rs | 197 +- src/librustc_trans/trans/foreign.rs | 2 +- src/librustc_trans/trans/glue.rs | 26 +- src/librustc_trans/trans/inline.rs | 29 +- src/librustc_trans/trans/intrinsic.rs | 341 +- src/librustc_trans/trans/meth.rs | 36 +- src/librustc_trans/trans/mir/analyze.rs | 115 + src/librustc_trans/trans/mir/block.rs | 117 + src/librustc_trans/trans/mir/constant.rs | 96 + src/librustc_trans/trans/mir/lvalue.rs | 189 + src/librustc_trans/trans/mir/mod.rs | 194 + src/librustc_trans/trans/mir/operand.rs | 170 + src/librustc_trans/trans/mir/rvalue.rs | 421 + src/librustc_trans/trans/mir/statement.rs | 70 + src/librustc_trans/trans/mod.rs | 3 +- src/librustc_trans/trans/monomorphize.rs | 2 +- src/librustc_trans/trans/type_of.rs | 28 +- src/librustc_typeck/astconv.rs | 28 +- src/librustc_typeck/check/_match.rs | 115 +- src/librustc_typeck/check/callee.rs | 13 +- src/librustc_typeck/check/coercion.rs | 59 +- src/librustc_typeck/check/compare_method.rs | 6 +- src/librustc_typeck/check/demand.rs | 6 +- src/librustc_typeck/check/intrinsic.rs | 57 +- src/librustc_typeck/check/method/confirm.rs | 7 +- src/librustc_typeck/check/method/probe.rs | 6 +- src/librustc_typeck/check/method/suggest.rs | 95 +- src/librustc_typeck/check/mod.rs | 158 +- src/librustc_typeck/check/regionck.rs | 117 +- src/librustc_typeck/check/upvar.rs | 59 +- src/librustc_typeck/check/wf.rs | 8 +- src/librustc_typeck/check/wfcheck.rs | 12 +- src/librustc_typeck/check/writeback.rs | 46 +- src/librustc_typeck/coherence/mod.rs | 21 +- src/librustc_typeck/coherence/orphan.rs | 9 +- src/librustc_typeck/coherence/overlap.rs | 20 +- src/librustc_typeck/coherence/unsafety.rs | 8 +- src/librustc_typeck/collect.rs | 102 +- .../constrained_type_params.rs | 176 +- src/librustc_typeck/diagnostics.rs | 23 +- src/librustc_typeck/lib.rs | 12 +- src/librustc_typeck/variance.rs | 25 +- src/librustc_unicode/char.rs | 66 +- src/librustc_unicode/lib.rs | 10 +- src/librustc_unicode/tables.rs | 2 - src/librustc_unicode/u_str.rs | 10 +- src/librustdoc/clean/inline.rs | 75 +- src/librustdoc/clean/mod.rs | 104 +- src/librustdoc/core.rs | 36 +- src/librustdoc/doctree.rs | 5 +- src/librustdoc/flock.rs | 80 +- src/librustdoc/html/format.rs | 6 +- src/librustdoc/html/layout.rs | 3 +- src/librustdoc/html/markdown.rs | 64 +- src/librustdoc/html/render.rs | 134 +- src/librustdoc/html/static/COPYRIGHT.txt | 2 +- src/librustdoc/html/static/main.js | 4 + .../html/static/{main.css => rustdoc.css} | 78 +- src/librustdoc/html/static/styles/main.css | 125 + src/librustdoc/lib.rs | 6 +- src/librustdoc/markdown.rs | 9 +- src/librustdoc/passes.rs | 50 +- src/librustdoc/test.rs | 90 +- src/librustdoc/visit_ast.rs | 16 +- src/libserialize/json.rs | 9 +- src/libserialize/lib.rs | 5 +- src/libstd/collections/hash/map.rs | 22 +- src/libstd/collections/hash/set.rs | 23 +- src/libstd/collections/mod.rs | 10 +- src/libstd/dynamic_lib.rs | 91 +- src/libstd/env.rs | 68 +- src/libstd/error.rs | 16 + src/libstd/ffi/c_str.rs | 76 +- src/libstd/ffi/os_str.rs | 7 + src/libstd/fs.rs | 42 +- src/libstd/io/buffered.rs | 1 + src/libstd/io/cursor.rs | 5 +- src/libstd/io/error.rs | 11 +- src/libstd/io/impls.rs | 14 +- src/libstd/io/mod.rs | 50 +- src/libstd/io/prelude.rs | 2 + src/libstd/io/stdio.rs | 37 +- src/libstd/lib.rs | 349 +- src/libstd/macros.rs | 62 +- src/libstd/net/addr.rs | 50 +- src/libstd/net/ip.rs | 101 +- src/libstd/net/mod.rs | 25 + src/libstd/net/parser.rs | 3 + src/libstd/net/tcp.rs | 4 +- src/libstd/net/udp.rs | 1 + src/libstd/num/f32.rs | 13 +- src/libstd/num/f64.rs | 21 +- src/libstd/num/mod.rs | 3 + src/libstd/os/android/mod.rs | 3 +- src/libstd/os/android/raw.rs | 5 + src/libstd/os/bitrig/mod.rs | 3 +- src/libstd/os/bitrig/raw.rs | 2 + src/libstd/os/dragonfly/mod.rs | 3 +- src/libstd/os/dragonfly/raw.rs | 2 + src/libstd/os/freebsd/mod.rs | 3 +- src/libstd/os/freebsd/raw.rs | 3 + src/libstd/os/ios/mod.rs | 3 +- src/libstd/os/ios/raw.rs | 2 + src/libstd/os/linux/mod.rs | 3 +- src/libstd/os/linux/raw.rs | 5 + src/libstd/os/macos/mod.rs | 3 +- src/libstd/os/macos/raw.rs | 2 + src/libstd/os/mod.rs | 8 +- src/libstd/os/nacl/mod.rs | 3 +- src/libstd/os/nacl/raw.rs | 271 +- src/libstd/os/netbsd/mod.rs | 3 +- src/libstd/os/netbsd/raw.rs | 2 + src/libstd/os/openbsd/mod.rs | 3 +- src/libstd/os/openbsd/raw.rs | 2 + src/libstd/os/raw.rs | 8 +- src/libstd/path.rs | 419 +- src/libstd/prelude/mod.rs | 209 +- src/libstd/prelude/v1.rs | 2 + src/libstd/primitive_docs.rs | 163 +- src/libstd/process.rs | 43 +- src/libstd/rand/os.rs | 37 +- src/libstd/rt.rs | 5 + src/libstd/rtdeps.rs | 8 + src/libstd/sync/barrier.rs | 1 + src/libstd/sync/condvar.rs | 12 +- src/libstd/sync/mod.rs | 11 + src/libstd/sync/mpsc/mod.rs | 6 + src/libstd/sync/mpsc/mpsc_queue.rs | 1 - src/libstd/sync/mutex.rs | 10 +- src/libstd/sync/rwlock.rs | 8 +- src/libstd/sys/common/backtrace.rs | 2 + src/libstd/sys/common/gnu/libbacktrace.rs | 4 +- src/libstd/sys/common/libunwind.rs | 51 +- src/libstd/sys/common/mod.rs | 19 + src/libstd/sys/common/net.rs | 151 +- src/libstd/sys/common/poison.rs | 3 + src/libstd/sys/common/unwind/gcc.rs | 35 + src/libstd/sys/common/unwind/mod.rs | 47 +- src/libstd/sys/common/unwind/seh.rs | 43 +- src/libstd/sys/common/unwind/seh64_gnu.rs | 149 +- src/libstd/sys/common/wtf8.rs | 24 +- src/libstd/sys/unix/c.rs | 410 - src/libstd/sys/unix/condvar.rs | 28 +- src/libstd/sys/unix/ext/fs.rs | 7 +- src/libstd/sys/unix/ext/mod.rs | 7 +- src/libstd/sys/unix/ext/process.rs | 8 +- src/libstd/sys/unix/ext/raw.rs | 5 + src/libstd/sys/unix/ext/thread.rs | 43 + src/libstd/sys/unix/fd.rs | 12 +- src/libstd/sys/unix/fs.rs | 21 +- src/libstd/sys/unix/mod.rs | 9 +- src/libstd/sys/unix/mutex.rs | 42 +- src/libstd/sys/unix/net.rs | 59 +- src/libstd/sys/unix/os.rs | 163 +- src/libstd/sys/unix/os_str.rs | 2 +- src/libstd/sys/unix/process.rs | 183 +- src/libstd/sys/unix/rwlock.rs | 19 +- src/libstd/sys/unix/stack_overflow.rs | 34 +- src/libstd/sys/unix/sync.rs | 315 - src/libstd/sys/unix/thread.rs | 156 +- src/libstd/sys/unix/thread_local.rs | 43 +- src/libstd/sys/unix/time.rs | 378 +- src/libstd/sys/windows/backtrace.rs | 297 +- src/libstd/sys/windows/c.rs | 1289 ++- src/libstd/sys/windows/compat.rs | 11 +- src/libstd/sys/windows/condvar.rs | 6 +- src/libstd/sys/windows/ext/ffi.rs | 1 + src/libstd/sys/windows/ext/fs.rs | 3 + src/libstd/sys/windows/ext/io.rs | 3 +- src/libstd/sys/windows/ext/mod.rs | 7 +- src/libstd/sys/windows/ext/process.rs | 4 + src/libstd/sys/windows/ext/thread.rs | 29 + src/libstd/sys/windows/fs.rs | 203 +- src/libstd/sys/windows/handle.rs | 35 +- src/libstd/sys/windows/mod.rs | 76 +- src/libstd/sys/windows/net.rs | 72 +- src/libstd/sys/windows/os.rs | 172 +- src/libstd/sys/windows/pipe.rs | 7 +- src/libstd/sys/windows/printing/gnu.rs | 9 +- src/libstd/sys/windows/printing/msvc.rs | 35 +- src/libstd/sys/windows/process.rs | 81 +- src/libstd/sys/windows/stack_overflow.rs | 5 +- src/libstd/sys/windows/stdio.rs | 11 +- src/libstd/sys/windows/thread.rs | 13 +- src/libstd/sys/windows/thread_local.rs | 43 +- src/libstd/sys/windows/time.rs | 197 +- src/libstd/thread/local.rs | 2 +- src/libstd/thread/mod.rs | 13 + src/libstd/thread/scoped_tls.rs | 9 +- src/libstd/time/duration.rs | 12 +- src/libstd/time/mod.rs | 319 + src/libsyntax/abi.rs | 2 + src/libsyntax/ast.rs | 181 +- src/libsyntax/ast_util.rs | 90 +- src/libsyntax/attr.rs | 206 +- src/libsyntax/codemap.rs | 212 + src/libsyntax/config.rs | 352 +- src/libsyntax/diagnostic.rs | 56 +- src/libsyntax/diagnostics/plugin.rs | 14 +- src/libsyntax/ext/asm.rs | 13 +- src/libsyntax/ext/base.rs | 62 +- src/libsyntax/ext/build.rs | 5 +- src/libsyntax/ext/cfg.rs | 13 +- src/libsyntax/ext/concat_idents.rs | 9 +- src/libsyntax/ext/deriving/debug.rs | 81 +- src/libsyntax/ext/deriving/generic/mod.rs | 15 +- src/libsyntax/ext/deriving/generic/ty.rs | 4 +- src/libsyntax/ext/expand.rs | 99 +- src/libsyntax/ext/format.rs | 13 +- src/libsyntax/ext/quote.rs | 228 +- src/libsyntax/ext/source_util.rs | 4 +- src/libsyntax/ext/trace_macros.rs | 8 +- src/libsyntax/ext/tt/macro_parser.rs | 97 +- src/libsyntax/ext/tt/macro_rules.rs | 198 +- src/libsyntax/ext/tt/transcribe.rs | 42 +- src/libsyntax/feature_gate.rs | 181 +- src/libsyntax/fold.rs | 145 +- src/libsyntax/lib.rs | 14 +- src/libsyntax/parse/attr.rs | 88 +- src/libsyntax/parse/classify.rs | 2 +- src/libsyntax/parse/lexer/comments.rs | 2 +- src/libsyntax/parse/lexer/mod.rs | 81 +- src/libsyntax/parse/lexer/unicode_chars.rs | 203 + src/libsyntax/parse/mod.rs | 92 +- src/libsyntax/parse/parser.rs | 1060 +-- src/libsyntax/parse/token.rs | 5 +- src/libsyntax/print/pp.rs | 6 +- src/libsyntax/print/pprust.rs | 325 +- src/libsyntax/test.rs | 16 +- .../util/lev_distance.rs | 8 + src/libsyntax/util/move_map.rs | 79 + src/libsyntax/util/node_count.rs | 164 + src/libsyntax/util/parser.rs | 210 + src/libsyntax/util/parser_testing.rs | 20 +- src/libsyntax/util/small_vector.rs | 46 +- src/libsyntax/visit.rs | 42 +- src/libterm/lib.rs | 219 +- src/libterm/terminfo/mod.rs | 296 +- src/libterm/terminfo/parm.rs | 572 +- src/libterm/terminfo/parser/compiled.rs | 254 +- src/libterm/terminfo/searcher.rs | 84 +- src/libterm/win.rs | 97 +- src/libtest/lib.rs | 94 +- src/rtstartup/rsbegin.rs | 80 + src/rtstartup/rsend.rs | 26 + src/rustllvm/PassWrapper.cpp | 1 - src/test/auxiliary/allocator-dummy.rs | 2 +- src/test/auxiliary/allocator1.rs | 2 +- src/test/auxiliary/allocator2.rs | 2 +- src/test/auxiliary/allocator3.rs | 2 +- src/test/auxiliary/attr_plugin_test.rs | 3 +- src/test/auxiliary/custom_derive_plugin.rs | 3 +- .../auxiliary/custom_derive_plugin_attr.rs | 3 +- src/test/auxiliary/inherited_stability.rs | 5 +- src/test/auxiliary/internal_unstable.rs | 11 +- src/test/auxiliary/issue-11225-1.rs | 5 + src/test/auxiliary/issue-11225-2.rs | 6 + src/test/auxiliary/issue-11225-3.rs | 38 + src/test/auxiliary/issue-27362.rs | 20 + src/test/auxiliary/issue-28927-1.rs | 12 + src/test/auxiliary/issue-28927-2.rs | 11 + src/test/auxiliary/issue-30109-1.rs | 11 + .../issue_16723_multiple_items_syntax_ext.rs | 3 +- src/test/auxiliary/lang-item-public.rs | 2 +- src/test/auxiliary/lint_for_crate.rs | 3 +- src/test/auxiliary/lint_group_plugin_test.rs | 3 +- src/test/auxiliary/lint_output_format.rs | 3 +- src/test/auxiliary/lint_plugin_test.rs | 3 +- src/test/auxiliary/lint_stability.rs | 45 +- src/test/auxiliary/lint_stability_fields.rs | 13 +- src/test/auxiliary/llvm_pass_plugin.rs | 3 +- .../auxiliary/lto-syntax-extension-plugin.rs | 3 +- .../auxiliary/macro_crate_MacroRulesTT.rs | 3 +- src/test/auxiliary/macro_crate_test.rs | 5 +- src/test/auxiliary/needs_allocator.rs | 2 +- src/test/auxiliary/no_std_crate.rs | 1 - src/test/auxiliary/plugin_args.rs | 3 +- .../plugin_crate_outlive_expansion_phase.rs | 3 +- src/test/auxiliary/plugin_with_plugin_lib.rs | 3 +- src/test/auxiliary/procedural_mbe_matching.rs | 5 +- src/test/auxiliary/rlib_crate_test.rs | 3 +- src/test/auxiliary/roman_numerals.rs | 16 +- .../auxiliary/stability_attribute_issue.rs | 1 - src/test/auxiliary/stability_cfg1.rs | 1 - src/test/auxiliary/stability_cfg2.rs | 1 - .../syntax_extension_with_dll_deps_2.rs | 3 +- src/test/auxiliary/weak-lang-items.rs | 1 - src/test/codegen/fatptr.rs | 22 + src/test/compile-fail-fulldeps/gated-quote.rs | 24 +- src/test/compile-fail/array_const_index-0.rs | 16 + .../array_const_index-1.rs} | 8 +- src/test/compile-fail/cast-rfc0401.rs | 5 +- src/test/compile-fail/cfg-attr-crate-2.rs | 2 +- src/test/compile-fail/cfg-non-opt-expr.rs | 18 + .../coherence-projection-conflict-ty-param.rs | 22 + .../compile-fail/const-array-oob-arith.rs | 22 + src/test/compile-fail/const-array-oob.rs | 7 +- src/test/compile-fail/const-call.rs | 24 + .../compile-fail/const-eval-overflow-4b.rs | 2 +- src/test/compile-fail/const-eval-span.rs | 2 +- .../const-fn-stability-calls-2.rs | 3 +- .../const-index-feature-gate.rs} | 7 +- .../compile-fail/const-integer-bool-ops.rs | 46 + .../compile-fail/const-pattern-irrefutable.rs | 28 + .../derive-no-std-not-supported.rs | 1 - .../empty-struct-braces-gate-2.rs | 17 +- .../compile-fail/empty-struct-braces-pat-1.rs | 10 +- .../compile-fail/empty-struct-braces-pat-2.rs | 12 - .../compile-fail/empty-struct-braces-pat-3.rs | 29 + .../compile-fail/empty-struct-unit-pat.rs | 27 +- .../enum-and-module-in-same-scope.rs | 2 +- .../compile-fail/expr_attr_paren_order.rs | 34 + .../compile-fail/fail-no-dead-code-core.rs | 5 +- .../compile-fail/feature-gate-fundamental.rs | 14 + .../feature-gate-placement-expr.rs | 2 +- .../{gated-no-std.rs => gated-no-core.rs} | 2 +- src/test/compile-fail/if-let-arm-types.rs | 17 + .../compile-fail/infinite-instantiation.rs | 2 +- src/test/compile-fail/internal-unstable.rs | 0 .../compile-fail/invalid-macro-matcher.rs | 2 +- src/test/compile-fail/issue-10969.rs | 17 + .../issue-12560-1.rs | 8 +- src/test/compile-fail/issue-14084.rs | 2 +- src/test/compile-fail/issue-16819.rs | 12 +- src/test/compile-fail/issue-17337.rs | 5 +- src/test/compile-fail/issue-19086.rs | 2 +- src/test/compile-fail/issue-19692.rs | 2 +- src/test/compile-fail/issue-21546.rs | 10 +- src/test/compile-fail/issue-21946.rs | 22 + src/test/compile-fail/issue-21950.rs | 2 +- src/test/compile-fail/issue-22638.rs | 2 + src/test/compile-fail/issue-23217.rs | 16 + src/test/compile-fail/issue-2392.rs | 23 + src/test/compile-fail/issue-23966.rs | 4 +- src/test/compile-fail/issue-24352.rs | 2 +- src/test/compile-fail/issue-26548.rs | 19 + src/test/compile-fail/issue-26638.rs | 6 +- src/test/compile-fail/issue-27831.rs | 2 +- src/test/compile-fail/issue-28586.rs | 16 + src/test/compile-fail/issue-28971.rs | 27 + src/test/compile-fail/issue-28992-empty.rs | 26 + src/test/compile-fail/issue-29147.rs | 32 + src/test/compile-fail/issue-29857.rs | 31 + src/test/compile-fail/issue-29861.rs | 30 + src/test/compile-fail/issue-30007.rs | 19 + src/test/compile-fail/issue-30236.rs | 18 + src/test/compile-fail/lint-dead-code-1.rs | 1 - src/test/compile-fail/lint-dead-code-3.rs | 2 +- src/test/compile-fail/lint-dead-code-4.rs | 34 +- .../compile-fail/lint-exceeding-bitshifts.rs | 5 +- src/test/compile-fail/lint-forbid-cmdline.rs | 1 - src/test/compile-fail/lint-malformed.rs | 14 + src/test/compile-fail/lint-raw-ptr-derive.rs | 34 - src/test/compile-fail/lint-removed-cmdline.rs | 20 + src/test/compile-fail/lint-removed.rs | 16 + src/test/compile-fail/lint-renamed-cmdline.rs | 18 + src/test/compile-fail/lint-renamed.rs | 13 + .../compile-fail/lint-stability-fields.rs | 15 +- src/test/compile-fail/lint-stability.rs | 37 +- .../compile-fail/lint-unknown-lint-cmdline.rs | 16 + src/test/compile-fail/lint-unknown-lint.rs | 13 + src/test/compile-fail/liveness-dead.rs | 10 + src/test/compile-fail/macro-context.rs | 33 + src/test/compile-fail/macro-error.rs | 19 + .../compile-fail/macro-missing-fragment.rs | 17 + src/test/compile-fail/macro-name-typo.rs | 14 + src/test/compile-fail/malformed_macro_lhs.rs | 17 + src/test/compile-fail/missing-stability.rs | 3 +- src/test/compile-fail/move-fragments-2.rs | 8 +- src/test/compile-fail/move-fragments-3.rs | 2 +- src/test/compile-fail/mut-suggestion.rs | 30 + .../no-extern-crate-in-glob-import.rs | 22 + src/test/compile-fail/no-std-inject.rs | 1 - .../compile-fail/no_owned_box_lang_item.rs | 2 +- .../compile-fail/placement-expr-unsafe.rs | 4 +- .../compile-fail/placement-expr-unstable.rs | 3 +- src/test/compile-fail/privacy-sanity.rs | 113 + src/test/compile-fail/recursion.rs | 8 +- .../resolve-hint-macro.rs} | 12 +- .../single-primitive-inherent-impl.rs | 1 - .../stability-attribute-non-staged.rs | 2 +- .../stability-attribute-sanity-2.rs | 8 +- .../stability-attribute-sanity.rs | 19 +- .../stmt_expr_attrs_no_feature.rs | 151 + src/test/compile-fail/trait-test-2.rs | 3 +- src/test/compile-fail/type-macros-fail.rs | 2 +- src/test/compile-fail/unreachable-in-call.rs | 32 + src/test/compile-fail/unused-attr.rs | 2 +- src/test/compile-fail/use-from-trait-xc.rs | 4 +- .../compile-fail/warn-pub-extern-crate.rs | 8 +- src/test/compile-fail/weak-lang-item.rs | 1 - src/test/parse-fail/assoc-oddities-1.rs | 22 + src/test/parse-fail/assoc-oddities-2.rs | 16 + src/test/parse-fail/assoc-oddities-3.rs | 16 + src/test/parse-fail/attr-dangling-in-fn.rs | 2 +- src/test/parse-fail/doc-before-rbrace.rs | 2 +- src/test/parse-fail/doc-before-semi.rs | 2 +- src/test/parse-fail/lex-bad-char-literals.rs | 4 +- src/test/parse-fail/match-refactor-to-expr.rs | 18 + .../parse-fail/removed-syntax-larrow-move.rs | 18 - src/test/parse-fail/unicode-chars.rs | 18 + src/test/pretty/stmt_expr_attributes.rs | 282 + src/test/run-fail/overflowing-rsh-5.rs | 18 + src/test/run-fail/overflowing-rsh-6.rs | 19 + .../run-make/alloc-extern-crates/fakealloc.rs | 2 - .../allow-warnings-cmdline-stability/bar.rs | 1 - .../compiler-rt-works-on-mingw/Makefile | 17 + .../compiler-rt-works-on-mingw/foo.cpp | 5 + .../compiler-rt-works-on-mingw/foo.rs | 16 + src/test/run-make/execution-engine/test.rs | 20 +- .../run-make/extern-multiple-copies/Makefile | 8 + .../run-make/extern-multiple-copies/bar.rs | 16 + .../run-make/extern-multiple-copies/foo1.rs | 11 + .../run-make/extern-multiple-copies/foo2.rs | 11 + .../graphviz-flowgraph/f07.dot-expected.dot | 2 +- .../graphviz-flowgraph/f18.dot-expected.dot | 4 +- .../graphviz-flowgraph/f19.dot-expected.dot | 6 +- src/test/run-make/issue-14500/foo.c | 3 +- src/test/run-make/issue-14500/foo.rs | 3 + src/test/run-make/issue-19371/foo.rs | 16 +- src/test/run-make/issue-30063/Makefile | 35 + .../issue-30063/foo.rs} | 2 - .../run-make/libs-through-symlinks/Makefile | 2 +- src/test/run-make/no-duplicate-libs/bar.rs | 6 +- src/test/run-make/no-duplicate-libs/foo.rs | 5 +- .../output-type-permutations/Makefile | 29 + .../run-make/use-extern-for-plugins/foo.rs | 1 - .../run-pass-fulldeps/ast_stmt_expr_attr.rs | 308 + src/test/run-pass-fulldeps/qquote.rs | 37 + .../down-with-thread-dtors.rs | 0 .../exit-flushes.rs | 0 .../osx-frameworks.rs | 0 src/test/run-pass/array_const_index-1.rs | 18 + src/test/run-pass/asm-indirect-memory.rs | 39 + src/test/run-pass/assert-eq-macro-unsized.rs | 13 + src/test/run-pass/atomic-print.rs | 2 +- src/test/run-pass/cfg-attr-crate.rs | 2 +- src/test/run-pass/cfg_stmt_expr.rs | 98 + src/test/run-pass/check-static-slice.rs | 45 +- .../run-pass/check_const-feature-gated.rs | 15 + .../run-pass/coherence-rfc447-constrained.rs | 31 + src/test/run-pass/const-block-item.rs | 6 - src/test/run-pass/const-enum-vec-index.rs | 9 +- src/test/run-pass/const-fn-method.rs | 1 + src/test/run-pass/const-fn.rs | 1 + src/test/run-pass/const-str-ptr.rs | 1 + src/test/run-pass/derive-no-std.rs | 2 +- src/test/run-pass/deriving-clone-array.rs | 18 + src/test/run-pass/dst-field-align.rs | 87 + src/test/run-pass/empty-struct-braces.rs | 20 +- src/test/run-pass/env-funky-keys.rs | 45 + src/test/run-pass/env-vars.rs | 5 +- src/test/run-pass/extern_fat_drop.rs | 4 +- src/test/run-pass/for-loop-no-std.rs | 2 +- src/test/run-pass/format-no-std.rs | 2 +- src/test/run-pass/intrinsics-integer.rs | 173 +- src/test/run-pass/issue-11225-1.rs | 1 + src/test/run-pass/issue-11225-2.rs | 1 + src/test/run-pass/issue-11225-3.rs | 20 + .../run-pass/issue-13259-windows-tcb-trash.rs | 11 +- src/test/run-pass/issue-13655.rs | 2 +- src/test/run-pass/issue-14308.rs | 9 - src/test/run-pass/issue-14958.rs | 2 +- src/test/run-pass/issue-14959.rs | 2 +- src/test/run-pass/issue-16739.rs | 2 +- src/test/run-pass/issue-1701.rs | 2 +- src/test/run-pass/issue-18661.rs | 4 +- src/test/run-pass/issue-19001.rs | 19 + src/test/run-pass/issue-19098.rs | 9 +- src/test/run-pass/issue-19982.rs | 2 +- src/test/run-pass/issue-20544.rs | 2 +- .../issue-23338-ensure-param-drop-order.rs | 8 +- src/test/run-pass/issue-23406.rs | 23 + src/test/run-pass/issue-23598.rs | 22 + .../run-pass/issue-23611-enum-swap-in-drop.rs | 2 +- src/test/run-pass/issue-23992.rs | 28 + src/test/run-pass/issue-24954.rs | 22 + src/test/run-pass/issue-25810.rs | 37 + src/test/run-pass/issue-29030.rs | 17 + src/test/run-pass/issue-29071-2.rs | 40 + src/test/run-pass/issue-29071.rs | 21 + src/test/run-pass/issue-29147.rs | 36 + src/test/run-pass/issue-29227.rs | 151 + src/test/run-pass/issue-29276.rs | 13 + src/test/run-pass/issue-29466.rs | 3607 +++++++++ src/test/run-pass/issue-29488.rs | 30 + src/test/run-pass/issue-29522.rs | 25 + src/test/run-pass/issue-29540.rs | 501 ++ src/test/run-pass/issue-29710.rs | 20 + src/test/run-pass/issue-29740.rs | 326 + src/test/run-pass/issue-pr29383.rs | 22 + src/test/run-pass/last-use-in-cap-clause.rs | 10 +- src/test/run-pass/mir_coercions.rs | 76 + src/test/run-pass/mir_fat_ptr.rs | 63 + src/test/run-pass/mir_raw_fat_ptr.rs | 173 + .../mir_small_agg_arg.rs} | 12 +- src/test/run-pass/mir_trans_array.rs | 21 + src/test/run-pass/mir_trans_array_2.rs | 20 + .../mir_trans_spike1.rs} | 15 +- src/test/run-pass/mir_trans_switchint.rs | 24 + src/test/run-pass/no-std-1.rs | 1 - src/test/run-pass/no-std-2.rs | 1 - src/test/run-pass/no-std-3.rs | 1 - .../overloaded-calls-param-vtables.rs | 2 +- src/test/run-pass/overloaded-calls-simple.rs | 2 +- .../run-pass/overloaded-calls-zero-args.rs | 2 +- src/test/run-pass/paths-containing-nul.rs | 48 + src/test/run-pass/regions-copy-closure.rs | 7 +- src/test/run-pass/regions-static-closure.rs | 7 +- src/test/run-pass/resolve-pseudo-shadowing.rs | 20 + src/test/run-pass/rfc-1014-2.rs | 10 +- src/test/run-pass/rfc-1014.rs | 12 +- src/test/run-pass/shift-near-oflo.rs | 52 +- .../run-pass/simd-intrinsic-generic-cast.rs | 0 src/test/run-pass/smallest-hello-world.rs | 2 + .../run-pass/stmt_expr_attr_macro_parse.rs | 32 + src/test/run-pass/string-box-error.rs | 20 + src/test/run-pass/trait-copy-guessing.rs | 46 + .../run-pass/unboxed-closures-extern-fn-hr.rs | 7 +- ...unboxed-closures-fn-as-fnmut-and-fnonce.rs | 2 +- .../unboxed-closures-fnmut-as-fnonce.rs | 4 +- .../unboxed-closures-infer-recursive-fn.rs | 3 +- .../run-pass/unboxed-closures-manual-impl.rs | 5 +- .../unboxed-closures-monomorphization.rs | 13 +- src/test/run-pass/unboxed-closures-prelude.rs | 7 +- src/test/run-pass/vec-macro-no-std.rs | 4 +- .../run-pass/wait-forked-but-failed-child.rs | 4 +- src/test/run-pass/weird-exit-code.rs | 37 + src/test/rustdoc/cap-lints.rs | 20 + src/test/rustdoc/issue-15318.rs | 1 - src/test/rustdoc/issue-18199.rs | 2 +- src/test/rustdoc/issue-23511.rs | 2 +- src/test/rustdoc/issue-25001.rs | 53 + src/test/rustdoc/issue-27362.rs | 19 + src/test/rustdoc/issue-27759.rs | 3 +- src/test/rustdoc/issue-28927.rs | 16 + src/test/rustdoc/issue-29449.rs | 30 + src/test/rustdoc/issue-30109.rs | 24 + src/test/rustdoc/issue-30252.rs | 16 + src/test/rustdoc/macros.rs | 20 + 2574 files changed, 101871 insertions(+), 52725 deletions(-) delete mode 100644 AUTHORS.txt delete mode 100644 src/compiler-rt/SDKs/README.txt delete mode 100644 src/compiler-rt/SDKs/darwin/README.txt delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/errno.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/fcntl.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/inttypes.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/limits.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/stdio.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/stdlib.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/string.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/sys/errno.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/sys/fcntl.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/sys/mman.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/sys/stat.h delete mode 100644 src/compiler-rt/SDKs/darwin/usr/include/sys/types.h delete mode 100644 src/compiler-rt/SDKs/linux/README.txt delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/endian.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/fcntl.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/limits.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/stdio.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/stdlib.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/string.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/sys/fcntl.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/sys/mman.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/sys/stat.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/sys/types.h delete mode 100644 src/compiler-rt/SDKs/linux/usr/include/unistd.h delete mode 100644 src/compiler-rt/android/README.LLVM delete mode 100644 src/compiler-rt/android/include/sys/ucontext.h delete mode 100644 src/compiler-rt/android/include/ucontext.h create mode 100644 src/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake create mode 100644 src/compiler-rt/include/sanitizer/allocator_interface.h create mode 100644 src/compiler-rt/include/sanitizer/coverage_interface.h create mode 100644 src/compiler-rt/lib/asan/asan_activation_flags.inc create mode 100644 src/compiler-rt/lib/asan/asan_allocator.cc delete mode 100644 src/compiler-rt/lib/asan/asan_allocator2.cc delete mode 100644 src/compiler-rt/lib/asan/asan_asm_instrumentation.S create mode 100644 src/compiler-rt/lib/asan/asan_debugging.cc delete mode 100644 src/compiler-rt/lib/asan/asan_dll_thunk.cc create mode 100644 src/compiler-rt/lib/asan/asan_flags.cc create mode 100644 src/compiler-rt/lib/asan/asan_flags.inc create mode 100644 src/compiler-rt/lib/asan/asan_init_version.h create mode 100644 src/compiler-rt/lib/asan/asan_suppressions.cc create mode 100644 src/compiler-rt/lib/asan/asan_suppressions.h create mode 100644 src/compiler-rt/lib/asan/asan_win_dll_thunk.cc create mode 100644 src/compiler-rt/lib/asan/asan_win_dynamic_runtime_thunk.cc delete mode 100755 src/compiler-rt/lib/asan/scripts/gen_asm_instrumentation.sh create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/10.4-x86_64.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/10.4.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/CMakeLists.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/README.TXT create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/ios-armv7.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/ios-armv7s.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/ios.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/ios6-armv7.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/ios6-armv7s.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/ios7-arm64.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/iossim-i386.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/iossim-x86_64.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/iossim.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/osx-i386.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/osx-x86_64.txt create mode 100644 src/compiler-rt/lib/builtins/Darwin-excludes/osx.txt create mode 100644 src/compiler-rt/lib/builtins/README.txt create mode 100644 src/compiler-rt/lib/builtins/addtf3.c create mode 100644 src/compiler-rt/lib/builtins/arm/aeabi_cdcmp.S create mode 100644 src/compiler-rt/lib/builtins/arm/aeabi_cdcmpeq_check_nan.c create mode 100644 src/compiler-rt/lib/builtins/arm/aeabi_cfcmp.S create mode 100644 src/compiler-rt/lib/builtins/arm/aeabi_cfcmpeq_check_nan.c create mode 100644 src/compiler-rt/lib/builtins/arm/aeabi_div0.c create mode 100644 src/compiler-rt/lib/builtins/arm/aeabi_drsub.c create mode 100644 src/compiler-rt/lib/builtins/arm/aeabi_frsub.c rename src/compiler-rt/lib/builtins/{aarch64 => arm64}/Makefile.mk (83%) create mode 100644 src/compiler-rt/lib/builtins/armv6m/Makefile.mk create mode 100644 src/compiler-rt/lib/builtins/atomic_flag_clear.c create mode 100644 src/compiler-rt/lib/builtins/atomic_flag_clear_explicit.c create mode 100644 src/compiler-rt/lib/builtins/atomic_flag_test_and_set.c create mode 100644 src/compiler-rt/lib/builtins/atomic_flag_test_and_set_explicit.c create mode 100644 src/compiler-rt/lib/builtins/atomic_signal_fence.c create mode 100644 src/compiler-rt/lib/builtins/atomic_thread_fence.c create mode 100644 src/compiler-rt/lib/builtins/divtf3.c create mode 100644 src/compiler-rt/lib/builtins/emutls.c create mode 100644 src/compiler-rt/lib/builtins/extenddftf2.c create mode 100644 src/compiler-rt/lib/builtins/extendhfsf2.c create mode 100644 src/compiler-rt/lib/builtins/extendsftf2.c create mode 100644 src/compiler-rt/lib/builtins/fixtfdi.c create mode 100644 src/compiler-rt/lib/builtins/fixtfsi.c create mode 100644 src/compiler-rt/lib/builtins/fixtfti.c create mode 100644 src/compiler-rt/lib/builtins/fixunstfdi.c create mode 100644 src/compiler-rt/lib/builtins/fixunstfsi.c create mode 100644 src/compiler-rt/lib/builtins/fixunstfti.c create mode 100644 src/compiler-rt/lib/builtins/floatditf.c create mode 100644 src/compiler-rt/lib/builtins/floatsitf.c create mode 100644 src/compiler-rt/lib/builtins/floatunditf.c create mode 100644 src/compiler-rt/lib/builtins/floatunsitf.c create mode 100644 src/compiler-rt/lib/builtins/fp_add_impl.inc create mode 100644 src/compiler-rt/lib/builtins/fp_extend.h create mode 100644 src/compiler-rt/lib/builtins/fp_extend_impl.inc create mode 100644 src/compiler-rt/lib/builtins/fp_fixint_impl.inc create mode 100644 src/compiler-rt/lib/builtins/fp_fixuint_impl.inc create mode 100644 src/compiler-rt/lib/builtins/fp_mul_impl.inc create mode 100644 src/compiler-rt/lib/builtins/fp_trunc.h create mode 100644 src/compiler-rt/lib/builtins/fp_trunc_impl.inc create mode 100644 src/compiler-rt/lib/builtins/i386/chkstk.S create mode 100644 src/compiler-rt/lib/builtins/i386/chkstk2.S create mode 100644 src/compiler-rt/lib/builtins/macho_embedded/CMakeLists.txt create mode 100644 src/compiler-rt/lib/builtins/macho_embedded/arm.txt create mode 100644 src/compiler-rt/lib/builtins/macho_embedded/common.txt create mode 100644 src/compiler-rt/lib/builtins/macho_embedded/i386.txt create mode 100644 src/compiler-rt/lib/builtins/macho_embedded/thumb2-64.txt create mode 100644 src/compiler-rt/lib/builtins/macho_embedded/thumb2.txt create mode 100644 src/compiler-rt/lib/builtins/multc3.c create mode 100644 src/compiler-rt/lib/builtins/multf3.c create mode 100644 src/compiler-rt/lib/builtins/subtf3.c create mode 100644 src/compiler-rt/lib/builtins/truncdfhf2.c create mode 100644 src/compiler-rt/lib/builtins/truncsfhf2.c create mode 100644 src/compiler-rt/lib/builtins/trunctfdf2.c create mode 100644 src/compiler-rt/lib/builtins/trunctfsf2.c create mode 100644 src/compiler-rt/lib/builtins/x86_64/chkstk.S create mode 100644 src/compiler-rt/lib/builtins/x86_64/chkstk2.S create mode 100644 src/compiler-rt/lib/cfi/CMakeLists.txt create mode 100644 src/compiler-rt/lib/cfi/cfi_blacklist.txt delete mode 100644 src/compiler-rt/lib/dfsan/Makefile.mk create mode 100644 src/compiler-rt/lib/dfsan/dfsan_flags.inc rename src/compiler-rt/lib/dfsan/{libc_ubuntu1204_abilist.txt => libc_ubuntu1404_abilist.txt} (90%) create mode 100644 src/compiler-rt/lib/lsan/lsan_flags.inc delete mode 100644 src/compiler-rt/lib/msan/Makefile.mk create mode 100644 src/compiler-rt/lib/msan/msan_chained_origin_depot.cc create mode 100644 src/compiler-rt/lib/msan/msan_chained_origin_depot.h create mode 100644 src/compiler-rt/lib/msan/msan_flags.inc create mode 100644 src/compiler-rt/lib/msan/msan_origin.h create mode 100644 src/compiler-rt/lib/msan/msan_poisoning.cc create mode 100644 src/compiler-rt/lib/msan/msan_poisoning.h delete mode 100644 src/compiler-rt/lib/msan/tests/msandr_test_so.cc delete mode 100644 src/compiler-rt/lib/msan/tests/msandr_test_so.h delete mode 100644 src/compiler-rt/lib/msandr/CMakeLists.txt delete mode 100644 src/compiler-rt/lib/msandr/README.txt delete mode 100644 src/compiler-rt/lib/msandr/msandr.cc create mode 100644 src/compiler-rt/lib/profile/InstrProfilingInternal.h create mode 100644 src/compiler-rt/lib/profile/InstrProfilingPlatformLinux.c create mode 100644 src/compiler-rt/lib/profile/InstrProfilingUtil.c create mode 100644 src/compiler-rt/lib/profile/InstrProfilingUtil.h create mode 100644 src/compiler-rt/lib/safestack/CMakeLists.txt create mode 100644 src/compiler-rt/lib/safestack/safestack.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_allocator_interface.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_common_nolibc.cc delete mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_coverage.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_coverage_libcdep.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_coverage_mapping_libcdep.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_flag_parser.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_flags.inc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_freebsd.h delete mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_interception.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_interface_internal.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc rename src/compiler-rt/{test/asan/TestCases/SharedLibs/darwin-dummy-shared-lib-so.cc => lib/sanitizer_common/sanitizer_persistent_allocator.cc} (54%) create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_persistent_allocator.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_posix.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_common.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_procmaps_freebsd.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_stackdepotbase.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_stacktrace_printer.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_internal.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_symbolizer_mac.h create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_syscall_linux_aarch64.inc create mode 100644 src/compiler-rt/lib/sanitizer_common/sanitizer_unwind_linux_libcdep.cc create mode 100755 src/compiler-rt/lib/sanitizer_common/scripts/litlint.py create mode 100755 src/compiler-rt/lib/sanitizer_common/scripts/litlint_test.py create mode 100644 src/compiler-rt/lib/sanitizer_common/tests/sanitizer_pthread_wrappers.h create mode 100644 src/compiler-rt/lib/sanitizer_common/tests/sanitizer_stacktrace_printer_test.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/tests/sanitizer_symbolizer_test.cc create mode 100644 src/compiler-rt/lib/sanitizer_common/tests/sanitizer_test_config.h delete mode 100644 src/compiler-rt/lib/tsan/Makefile.mk delete mode 100644 src/compiler-rt/lib/tsan/rtl/Makefile.mk create mode 100644 src/compiler-rt/lib/tsan/rtl/tsan_dense_alloc.h create mode 100644 src/compiler-rt/lib/tsan/rtl/tsan_flags.inc create mode 100644 src/compiler-rt/lib/tsan/rtl/tsan_interceptors.h create mode 100644 src/compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc create mode 100644 src/compiler-rt/lib/tsan/rtl/tsan_new_delete.cc create mode 100644 src/compiler-rt/lib/tsan/rtl/tsan_platform_posix.cc create mode 100644 src/compiler-rt/lib/tsan/rtl/tsan_stack_trace.cc create mode 100644 src/compiler-rt/lib/tsan/rtl/tsan_stack_trace.h create mode 100644 src/compiler-rt/lib/tsan/tests/unit/tsan_dense_alloc_test.cc create mode 100644 src/compiler-rt/lib/ubsan/ubsan_checks.inc create mode 100644 src/compiler-rt/lib/ubsan/ubsan_flags.cc create mode 100644 src/compiler-rt/lib/ubsan/ubsan_flags.h create mode 100644 src/compiler-rt/lib/ubsan/ubsan_flags.inc create mode 100644 src/compiler-rt/lib/ubsan/ubsan_init.cc create mode 100644 src/compiler-rt/lib/ubsan/ubsan_init.h create mode 100644 src/compiler-rt/lib/ubsan/ubsan_init_standalone.cc create mode 100644 src/compiler-rt/lib/ubsan/ubsan_platform.h create mode 100644 src/compiler-rt/lib/ubsan/ubsan_type_hash_itanium.cc create mode 100644 src/compiler-rt/lib/ubsan/ubsan_type_hash_win.cc delete mode 100644 src/compiler-rt/make/platform/clang_darwin.mk delete mode 100644 src/compiler-rt/make/platform/clang_darwin_test_input.c delete mode 100644 src/compiler-rt/make/platform/clang_linux.mk delete mode 100644 src/compiler-rt/make/platform/clang_linux_test_input.c delete mode 100644 src/compiler-rt/make/platform/clang_macho_embedded.mk delete mode 100644 src/compiler-rt/make/platform/clang_macho_embedded_test_input.c delete mode 100644 src/compiler-rt/make/platform/darwin_bni.mk delete mode 100644 src/compiler-rt/make/platform/darwin_fat.mk delete mode 100644 src/compiler-rt/make/platform/multi_arch.mk create mode 100644 src/compiler-rt/test/asan/TestCases/Android/coverage-android.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Android/lit.local.cfg create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/abort_on_error.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/address-range-limit.mm create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer-dyld-root-path.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/atos-symbolizer.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/crashlog-stacktraces.c create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/dladdr-demangling.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_reexec.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/dyld_insert_libraries_remove.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/empty-section.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/interception-in-shared-lib-test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/linked-only.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/mixing-global-constructors.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/objc-odr.mm create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/sandbox-symbolizer.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/suppressions-darwin.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Darwin/suppressions-sandbox.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/Helpers/init-order-pthread-create-extra.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/abort_on_error.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/activation-options.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/asan-asm-stacktrace-test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/asan_default_suppressions.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/clang_gcc_abi.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/coverage-missing.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/Linux/coverage.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/Linux/heavy_uar_test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/init-order-dlopen.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/init_fini_sections.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/leak_check_segv.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/nohugepage_test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/pthread_create_version.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/quarantine_size_mb.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/read_binary_name_regtest.c create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/signal_during_stop_the_world.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/sized_delete_test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/stack-overflow-sigbus.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/stack-trace-dlclose.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Linux/static_tls.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/allow_user_segv.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/asan-symbolize-bad-path.cc rename src/compiler-rt/test/asan/TestCases/{ => Posix}/asan-symbolize-sanity-test.cc (58%) create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/asprintf.cc rename src/compiler-rt/test/asan/TestCases/{ => Posix}/assign_large_valloc_to_global.cc (51%) create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/closed-fds.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage-caller-callee.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage-direct-activation.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage-direct-large.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage-direct.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage-fork-direct.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage-fork.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage-maybe-open-file.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage-module-unloaded.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage-sandboxing.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/coverage.cc rename src/compiler-rt/test/asan/TestCases/{ => Posix}/current_allocated_bytes.cc (70%) rename src/compiler-rt/test/asan/TestCases/{ => Posix}/deep_call_stack.cc (58%) rename src/compiler-rt/test/asan/TestCases/{ => Posix}/deep_thread_stack.cc (80%) rename src/compiler-rt/test/asan/TestCases/{ => Posix}/dlclose-test.cc (62%) rename src/compiler-rt/test/asan/TestCases/{ => Posix}/free_hook_realloc.cc (86%) create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/freopen.cc rename src/compiler-rt/test/asan/TestCases/{ => Posix}/gc-test.cc (65%) rename src/compiler-rt/test/asan/TestCases/{Linux => Posix}/glob.cc (85%) rename src/compiler-rt/test/asan/TestCases/{Linux => Posix}/glob_test_root/aa (100%) rename src/compiler-rt/test/asan/TestCases/{Linux => Posix}/glob_test_root/ab (100%) rename src/compiler-rt/test/asan/TestCases/{Linux => Posix}/glob_test_root/ba (100%) create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/init-order-pthread-create.cc rename src/compiler-rt/test/asan/TestCases/{Linux => Posix}/interception-in-shared-lib-test.cc (59%) rename src/compiler-rt/test/asan/TestCases/{ => Posix}/ioctl.cc (71%) rename src/compiler-rt/test/asan/TestCases/{ => Posix}/large_allocator_unpoisons_on_free.cc (74%) create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/lit.local.cfg rename src/compiler-rt/test/asan/TestCases/{ => Posix}/log_path_fork_test.cc.disabled (87%) create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_uaf_test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/new_array_cookie_with_new_from_class.cc rename src/compiler-rt/test/asan/TestCases/{ => Posix}/readv.cc (100%) create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/shared-lib-test.cc rename src/compiler-rt/test/asan/TestCases/{ => Posix}/stack-overflow.cc (53%) rename src/compiler-rt/test/asan/TestCases/{ => Posix}/stack-use-after-return.cc (57%) create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/start-deactivated.cc rename src/compiler-rt/test/asan/TestCases/{ => Posix}/strerror_r_test.cc (100%) rename src/compiler-rt/test/asan/TestCases/{Linux => Posix}/tsd_dtor_leak.cc (63%) create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/wait.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/wait3.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Posix/wait4.cc rename src/compiler-rt/test/asan/TestCases/{ => Posix}/waitid.cc (97%) delete mode 100644 src/compiler-rt/test/asan/TestCases/SharedLibs/dlclose-test-so.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/SharedLibs/init-order-dlopen-so.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/SharedLibs/lit.local.cfg delete mode 100644 src/compiler-rt/test/asan/TestCases/SharedLibs/shared-lib-test-so.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/SharedLibs/start-deactivated-so.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/aligned_mallocs.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/allocators_sanity.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/beginthreadex.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/bind_io_completion_callback.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/bitfield.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/bitfield_uaf.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/calloc_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/calloc_right_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/calloc_uaf.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/coverage-basic.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/crt_initializers.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/default_options.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/demangled_names.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_aligned_mallocs.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_allocators_sanity.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_and_lib.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_cerr.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_control_c.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_host.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memchr.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memcpy_indirect.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_intercept_memset.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_intercept_strlen.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_large_function.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_malloc_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_malloc_uaf.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_noreturn.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_null_deref.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_operator_array_new_with_dtor_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_poison_unpoison.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_report_globals_symbolization_at_startup.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_seh.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_stack_use_after_return.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/dll_thread_stack_array_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/double_free.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/double_operator_delete.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/free_hook_realloc.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/fuse-lld.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/global_const_string.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/global_const_string_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/hello_world.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/intercept_memcpy.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/intercept_strdup.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/intercept_strlen.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/iostream_sbo.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/lit.local.cfg create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/longjmp.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/malloc_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/malloc_right_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/malloc_uaf.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/null_deref.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/null_deref_multiple_dlls.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/on_error_callback.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/oom.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/operator_array_new_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/operator_array_new_right_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/operator_array_new_uaf.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/operator_array_new_with_dtor_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/operator_delete_wrong_argument.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/operator_new_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/operator_new_right_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/operator_new_uaf.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/queue_user_work_item_report.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/realloc_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/realloc_right_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/realloc_uaf.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/report_after_syminitialize.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/report_globals_reload_dll.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/report_globals_vs_freelibrary.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/seh.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/shadow_mapping_failure.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/stack_array_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/stack_array_right_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/stack_array_sanity.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/stack_use_after_return.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/symbols_path.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/thread_simple.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_left_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/thread_stack_array_right_oob.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/thread_stack_reuse.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/thread_stress.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/thread_suspended.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/throw_catch.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/unsymbolized.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/use_after_realloc.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/use_after_return_linkage.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/windows_h.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_heap.cc create mode 100644 src/compiler-rt/test/asan/TestCases/Windows/wrong_downcast_on_stack.cc create mode 100644 src/compiler-rt/test/asan/TestCases/alloca_big_alignment.cc create mode 100644 src/compiler-rt/test/asan/TestCases/alloca_detect_custom_size_.cc create mode 100644 src/compiler-rt/test/asan/TestCases/alloca_instruments_all_paddings.cc create mode 100644 src/compiler-rt/test/asan/TestCases/alloca_loop_unpoisoning.cc create mode 100644 src/compiler-rt/test/asan/TestCases/alloca_overflow_partial.cc create mode 100644 src/compiler-rt/test/asan/TestCases/alloca_overflow_right.cc create mode 100644 src/compiler-rt/test/asan/TestCases/alloca_safe_access.cc create mode 100644 src/compiler-rt/test/asan/TestCases/alloca_underflow_left.cc create mode 100644 src/compiler-rt/test/asan/TestCases/alloca_vla_interact.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/allow_user_segv.cc create mode 100644 src/compiler-rt/test/asan/TestCases/asan_and_llvm_coverage_test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/asan_options-help.cc create mode 100644 src/compiler-rt/test/asan/TestCases/atoi_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/atol_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/atoll_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/coverage-and-lsan.cc create mode 100644 src/compiler-rt/test/asan/TestCases/coverage-caller-callee-total-count.cc create mode 100644 src/compiler-rt/test/asan/TestCases/coverage-disabled.cc create mode 100644 src/compiler-rt/test/asan/TestCases/coverage-levels.cc create mode 100644 src/compiler-rt/test/asan/TestCases/coverage-order-pcs.cc create mode 100644 src/compiler-rt/test/asan/TestCases/coverage-reset.cc create mode 100644 src/compiler-rt/test/asan/TestCases/coverage-tracing.cc create mode 100644 src/compiler-rt/test/asan/TestCases/debug_locate.cc create mode 100644 src/compiler-rt/test/asan/TestCases/debug_mapping.cc create mode 100644 src/compiler-rt/test/asan/TestCases/debug_ppc64_mapping.cc create mode 100644 src/compiler-rt/test/asan/TestCases/debug_report.cc create mode 100644 src/compiler-rt/test/asan/TestCases/debug_stacks.cc create mode 100644 src/compiler-rt/test/asan/TestCases/describe_address.cc create mode 100644 src/compiler-rt/test/asan/TestCases/dump_instruction_bytes.cc create mode 100644 src/compiler-rt/test/asan/TestCases/frexp_interceptor.cc create mode 100644 src/compiler-rt/test/asan/TestCases/global-location.cc rename src/compiler-rt/test/asan/TestCases/{Linux => }/heap-overflow-large.cc (53%) create mode 100644 src/compiler-rt/test/asan/TestCases/heavy_uar_test.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/init-order-dlopen.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/init-order-pthread-create.cc rename src/compiler-rt/test/asan/TestCases/{Linux => }/interception_failure_test.cc (89%) create mode 100644 src/compiler-rt/test/asan/TestCases/intra-object-overflow.cc create mode 100644 src/compiler-rt/test/asan/TestCases/longjmp.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/malloc_hook.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/print-stack-trace.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/shared-lib-test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/speculative_load.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/start-deactivated.cc create mode 100644 src/compiler-rt/test/asan/TestCases/strcasestr-1.c create mode 100644 src/compiler-rt/test/asan/TestCases/strcasestr-2.c create mode 100644 src/compiler-rt/test/asan/TestCases/strcasestr_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strcat_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strchr_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strcmp_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strcspn-1.c create mode 100644 src/compiler-rt/test/asan/TestCases/strcspn-2.c create mode 100644 src/compiler-rt/test/asan/TestCases/strcspn_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strncat_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strpbrk-1.c create mode 100644 src/compiler-rt/test/asan/TestCases/strpbrk-2.c create mode 100644 src/compiler-rt/test/asan/TestCases/strpbrk_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strspn-1.c create mode 100644 src/compiler-rt/test/asan/TestCases/strspn-2.c create mode 100644 src/compiler-rt/test/asan/TestCases/strspn_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strstr-1.c create mode 100644 src/compiler-rt/test/asan/TestCases/strstr-2.c create mode 100644 src/compiler-rt/test/asan/TestCases/strstr_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strtol_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/strtoll_strict.c create mode 100644 src/compiler-rt/test/asan/TestCases/suppressions-exec-relative-location.cc create mode 100644 src/compiler-rt/test/asan/TestCases/suppressions-function.cc create mode 100644 src/compiler-rt/test/asan/TestCases/suppressions-interceptor.cc create mode 100644 src/compiler-rt/test/asan/TestCases/suppressions-library.cc create mode 100644 src/compiler-rt/test/asan/TestCases/verbose-log-path_test.cc create mode 100644 src/compiler-rt/test/asan/TestCases/vla_chrome_testcase.cc create mode 100644 src/compiler-rt/test/asan/TestCases/vla_condition_overflow.cc create mode 100644 src/compiler-rt/test/asan/TestCases/vla_loop_overfow.cc delete mode 100644 src/compiler-rt/test/asan/TestCases/wait.cc create mode 100644 src/compiler-rt/test/asan/TestCases/zero_page_pc.cc create mode 100644 src/compiler-rt/test/builtins/Unit/addtf3_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmpeq_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/arm/aeabi_cdcmple_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmpeq_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/arm/aeabi_cfcmple_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/arm/aeabi_drsub_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/arm/aeabi_frsub_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/arm/call_apsr.S create mode 100644 src/compiler-rt/test/builtins/Unit/arm/call_apsr.h create mode 100644 src/compiler-rt/test/builtins/Unit/divtf3_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/extenddftf2_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/extendhfsf2_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/extendsftf2_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/fixtfdi_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/fixtfsi_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/fixtfti_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/fixunstfsi_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/fixunstfti_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/floatditf_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/floatsitf_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/floatunditf_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/floatunsitf_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/multf3_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/subtf3_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/truncdfhf2_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/truncdfsf2_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/truncsfhf2_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/trunctfdf2_test.c create mode 100644 src/compiler-rt/test/builtins/Unit/trunctfsf2_test.c create mode 100644 src/compiler-rt/test/cfi/CMakeLists.txt create mode 100644 src/compiler-rt/test/cfi/README.txt create mode 100644 src/compiler-rt/test/cfi/anon-namespace.cpp create mode 100644 src/compiler-rt/test/cfi/bad-cast.cpp create mode 100644 src/compiler-rt/test/cfi/base-derived-destructor.cpp create mode 100644 src/compiler-rt/test/cfi/create-derivers.test create mode 100644 src/compiler-rt/test/cfi/icall/bad-signature.c create mode 100644 src/compiler-rt/test/cfi/icall/external-call.c create mode 100644 src/compiler-rt/test/cfi/icall/lit.local.cfg create mode 100644 src/compiler-rt/test/cfi/lit.cfg create mode 100644 src/compiler-rt/test/cfi/lit.site.cfg.in create mode 100644 src/compiler-rt/test/cfi/multiple-inheritance.cpp create mode 100644 src/compiler-rt/test/cfi/nvcall.cpp create mode 100644 src/compiler-rt/test/cfi/overwrite.cpp create mode 100644 src/compiler-rt/test/cfi/sibling.cpp create mode 100644 src/compiler-rt/test/cfi/simple-fail.cpp create mode 100644 src/compiler-rt/test/cfi/simple-pass.cpp create mode 100644 src/compiler-rt/test/cfi/utils.h create mode 100644 src/compiler-rt/test/cfi/vdtor.cpp rename src/compiler-rt/test/dfsan/{custom.c => custom.cc} (78%) create mode 100644 src/compiler-rt/test/dfsan/dump_labels.c create mode 100644 src/compiler-rt/test/dfsan/vararg.c create mode 100644 src/compiler-rt/test/lsan/TestCases/leak_check_before_thread_started.cc create mode 100644 src/compiler-rt/test/lsan/TestCases/recoverable_leak_check.cc create mode 100644 src/compiler-rt/test/msan/Linux/fopencookie.cc create mode 100644 src/compiler-rt/test/msan/Linux/forkpty.cc rename src/compiler-rt/test/msan/{ => Linux}/ioctl_sound.cc (85%) rename src/compiler-rt/test/msan/{ => Linux}/mallinfo.cc (72%) create mode 100644 src/compiler-rt/test/msan/Linux/mincore.cc create mode 100644 src/compiler-rt/test/msan/Linux/obstack.cc create mode 100644 src/compiler-rt/test/msan/Linux/process_vm_readv.cc delete mode 100644 src/compiler-rt/test/msan/SharedLibs/dso-origin-so.cc delete mode 100644 src/compiler-rt/test/msan/SharedLibs/dso-origin.h delete mode 100644 src/compiler-rt/test/msan/SharedLibs/lit.local.cfg create mode 100644 src/compiler-rt/test/msan/allocator_mapping.cc create mode 100644 src/compiler-rt/test/msan/chained_origin_empty_stack.cc create mode 100644 src/compiler-rt/test/msan/chained_origin_limits.cc create mode 100644 src/compiler-rt/test/msan/coverage-levels.cc create mode 100644 src/compiler-rt/test/msan/dtor-base-access.cc create mode 100644 src/compiler-rt/test/msan/dtor-bit-fields.cc create mode 100644 src/compiler-rt/test/msan/dtor-derived-class.cc create mode 100644 src/compiler-rt/test/msan/dtor-member.cc create mode 100644 src/compiler-rt/test/msan/dtor-multiple-inheritance-nontrivial-class-members.cc create mode 100644 src/compiler-rt/test/msan/dtor-multiple-inheritance.cc create mode 100644 src/compiler-rt/test/msan/dtor-trivial-class-members.cc create mode 100644 src/compiler-rt/test/msan/dtor-trivial.cpp create mode 100644 src/compiler-rt/test/msan/dtor-vtable-multiple-inheritance.cc create mode 100644 src/compiler-rt/test/msan/dtor-vtable.cc create mode 100644 src/compiler-rt/test/msan/fork.cc delete mode 100644 src/compiler-rt/test/msan/getline_test_data create mode 100644 src/compiler-rt/test/msan/icmp_slt_allones.cc create mode 100644 src/compiler-rt/test/msan/memcmp_test.cc create mode 100644 src/compiler-rt/test/msan/mmap.cc create mode 100644 src/compiler-rt/test/msan/msan_check_mem_is_initialized.cc create mode 100644 src/compiler-rt/test/msan/msan_copy_shadow.cc create mode 100644 src/compiler-rt/test/msan/msan_print_shadow3.cc create mode 100644 src/compiler-rt/test/msan/mul_by_const.cc delete mode 100644 src/compiler-rt/test/msan/open_memstream.cc create mode 100644 src/compiler-rt/test/msan/origin-store-long.cc create mode 100644 src/compiler-rt/test/msan/param_tls_limit.cc create mode 100644 src/compiler-rt/test/msan/print_stats.cc create mode 100644 src/compiler-rt/test/msan/pthread_setcancelstate.cc delete mode 100644 src/compiler-rt/test/msan/ptrace.cc create mode 100644 src/compiler-rt/test/msan/realloc-large-origin.cc create mode 100644 src/compiler-rt/test/msan/realloc-origin.cc create mode 100644 src/compiler-rt/test/msan/report-demangling.cc create mode 100644 src/compiler-rt/test/msan/select_float_origin.cc create mode 100644 src/compiler-rt/test/msan/sem_getvalue.cc create mode 100644 src/compiler-rt/test/msan/stack-origin2.cc create mode 100644 src/compiler-rt/test/msan/strxfrm.cc create mode 100644 src/compiler-rt/test/msan/test.h create mode 100644 src/compiler-rt/test/msan/use-after-dtor.cc delete mode 100644 src/compiler-rt/test/msan/wrap_indirect_calls.cc delete mode 100644 src/compiler-rt/test/msan/wrap_indirect_calls/caller.cc delete mode 100644 src/compiler-rt/test/msan/wrap_indirect_calls/lit.local.cfg delete mode 100644 src/compiler-rt/test/msan/wrap_indirect_calls/one.cc delete mode 100644 src/compiler-rt/test/msan/wrap_indirect_calls/two.cc delete mode 100644 src/compiler-rt/test/msan/wrap_indirect_calls/wrapper.cc delete mode 100644 src/compiler-rt/test/msan/wrap_indirect_calls2.cc delete mode 100644 src/compiler-rt/test/msan/wrap_indirect_calls_in_rtl.cc create mode 100644 src/compiler-rt/test/profile/Inputs/gcc-flag-compatibility.c create mode 100644 src/compiler-rt/test/profile/Inputs/instrprof-dlopen-func.c create mode 100644 src/compiler-rt/test/profile/Inputs/instrprof-dlopen-func2.c create mode 100644 src/compiler-rt/test/profile/Inputs/instrprof-dlopen-main.c create mode 100644 src/compiler-rt/test/profile/Inputs/instrprof-dynamic-a.cpp create mode 100644 src/compiler-rt/test/profile/Inputs/instrprof-dynamic-b.cpp create mode 100644 src/compiler-rt/test/profile/Inputs/instrprof-dynamic-header.h create mode 100644 src/compiler-rt/test/profile/Inputs/instrprof-dynamic-main.cpp create mode 100644 src/compiler-rt/test/profile/gcc-flag-compatibility.test create mode 100644 src/compiler-rt/test/profile/instrprof-dlopen.test create mode 100644 src/compiler-rt/test/profile/instrprof-dynamic-one-shared.test create mode 100644 src/compiler-rt/test/profile/instrprof-dynamic-two-shared.test create mode 100644 src/compiler-rt/test/profile/instrprof-override-filename-then-reset-default.c create mode 100644 src/compiler-rt/test/profile/instrprof-override-filename-with-env.c create mode 100644 src/compiler-rt/test/profile/instrprof-override-filename.c create mode 100644 src/compiler-rt/test/profile/instrprof-reset-counters.c create mode 100644 src/compiler-rt/test/profile/instrprof-set-filename-then-reset-default.c create mode 100644 src/compiler-rt/test/profile/instrprof-set-filename.c create mode 100644 src/compiler-rt/test/profile/instrprof-without-libc.c create mode 100644 src/compiler-rt/test/profile/instrprof-write-file-atexit-explicitly.c create mode 100644 src/compiler-rt/test/profile/instrprof-write-file-only.c create mode 100644 src/compiler-rt/test/profile/instrprof-write-file.c create mode 100644 src/compiler-rt/test/safestack/CMakeLists.txt create mode 100644 src/compiler-rt/test/safestack/buffer-copy-vla.c create mode 100644 src/compiler-rt/test/safestack/buffer-copy.c create mode 100644 src/compiler-rt/test/safestack/init.c create mode 100644 src/compiler-rt/test/safestack/lit.cfg create mode 100644 src/compiler-rt/test/safestack/lit.site.cfg.in create mode 100644 src/compiler-rt/test/safestack/lto.c create mode 100644 src/compiler-rt/test/safestack/overflow.c create mode 100644 src/compiler-rt/test/safestack/pthread-cleanup.c create mode 100644 src/compiler-rt/test/safestack/pthread.c create mode 100644 src/compiler-rt/test/safestack/utils.h create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Darwin/abort_on_error.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Darwin/lit.local.cfg create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/abort_on_error.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/aligned_alloc.c create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/assert.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/clock_gettime.c create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/fpe.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/getpass.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/getpwnam_r_invalid_user.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/hard_rss_limit_mb_test.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/lit.local.cfg create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/mlock_test.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/open_memstream.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/ptrace.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/sanitizer_set_death_callback_test.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/sched_getparam.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/sem_init_glibc.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/signal_segv_handler.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/soft_rss_limit_mb_test.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Linux/timerfd.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Posix/decorate_proc_maps.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/Posix/lit.local.cfg create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/corelimit.cc rename src/compiler-rt/test/{msan => sanitizer_common/TestCases}/malloc_hook.cc (55%) create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/options-help.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/options-include.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/options-invalid.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/print-stack-trace.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/pthread_mutexattr_get.cc create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/strcasestr.c create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/strcspn.c create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/strpbrk.c create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/strspn.c create mode 100644 src/compiler-rt/test/sanitizer_common/TestCases/strstr.c create mode 100644 src/compiler-rt/test/sanitizer_common/Unit/lit.site.cfg.in create mode 100644 src/compiler-rt/test/sanitizer_common/lit.common.cfg delete mode 100644 src/compiler-rt/test/tsan/Helpers/blacklist.txt delete mode 100644 src/compiler-rt/test/tsan/Helpers/lit.local.cfg create mode 100644 src/compiler-rt/test/tsan/Linux/lit.local.cfg rename src/compiler-rt/test/tsan/{ => Linux}/mutex_robust.cc (100%) rename src/compiler-rt/test/tsan/{ => Linux}/mutex_robust2.cc (93%) rename src/compiler-rt/test/tsan/{ => Linux}/user_fopen.cc (97%) rename src/compiler-rt/test/tsan/{ => Linux}/user_malloc.cc (96%) delete mode 100644 src/compiler-rt/test/tsan/SharedLibs/lit.local.cfg delete mode 100644 src/compiler-rt/test/tsan/SharedLibs/load_shared_lib-so.cc create mode 100644 src/compiler-rt/test/tsan/annotate_happens_before.cc create mode 100644 src/compiler-rt/test/tsan/atexit.cc create mode 100644 src/compiler-rt/test/tsan/atexit2.cc create mode 100644 src/compiler-rt/test/tsan/atomic_free3.cc create mode 100644 src/compiler-rt/test/tsan/blacklist2.cc create mode 100644 src/compiler-rt/test/tsan/cond_destruction.cc create mode 100755 src/compiler-rt/test/tsan/deflake.bash create mode 100644 src/compiler-rt/test/tsan/dl_iterate_phdr.cc create mode 100644 src/compiler-rt/test/tsan/dlclose.cc create mode 100644 src/compiler-rt/test/tsan/fd_dup_norace2.cc create mode 100644 src/compiler-rt/test/tsan/fd_dup_race.cc create mode 100644 src/compiler-rt/test/tsan/global_race2.cc create mode 100644 src/compiler-rt/test/tsan/global_race3.cc create mode 100644 src/compiler-rt/test/tsan/inlined_memcpy_race2.cc create mode 100644 src/compiler-rt/test/tsan/java_finalizer.cc create mode 100644 src/compiler-rt/test/tsan/java_heap_init.cc create mode 100644 src/compiler-rt/test/tsan/java_move_overlap.cc create mode 100644 src/compiler-rt/test/tsan/java_move_overlap_race.cc create mode 100644 src/compiler-rt/test/tsan/java_race_pc.cc create mode 100644 src/compiler-rt/test/tsan/java_symbolization.cc create mode 100644 src/compiler-rt/test/tsan/java_volatile.cc create mode 100644 src/compiler-rt/test/tsan/large_malloc_meta.cc create mode 100644 src/compiler-rt/test/tsan/libcxx/lit.local.cfg create mode 100644 src/compiler-rt/test/tsan/libcxx/std_shared_ptr.cc delete mode 100644 src/compiler-rt/test/tsan/malloc_hook.cc create mode 100644 src/compiler-rt/test/tsan/map32bit.cc create mode 100644 src/compiler-rt/test/tsan/memcmp_race.cc create mode 100644 src/compiler-rt/test/tsan/mmap_stress.cc create mode 100644 src/compiler-rt/test/tsan/mop1.c create mode 100644 src/compiler-rt/test/tsan/must_deadlock.cc delete mode 100644 src/compiler-rt/test/tsan/oob_race.cc create mode 100644 src/compiler-rt/test/tsan/pthread_atfork_deadlock.c create mode 100644 src/compiler-rt/test/tsan/race_on_puts.cc create mode 100644 src/compiler-rt/test/tsan/race_stress.cc create mode 100644 src/compiler-rt/test/tsan/race_top_suppression.cc create mode 100644 src/compiler-rt/test/tsan/race_top_suppression1.cc create mode 100644 src/compiler-rt/test/tsan/real_deadlock_detector_stress_test.cc create mode 100644 src/compiler-rt/test/tsan/restore_stack.cc create mode 100644 src/compiler-rt/test/tsan/setuid.c create mode 100644 src/compiler-rt/test/tsan/setuid2.c create mode 100644 src/compiler-rt/test/tsan/signal_cond.cc create mode 100644 src/compiler-rt/test/tsan/signal_longjmp.cc create mode 100644 src/compiler-rt/test/tsan/signal_recursive.cc create mode 100644 src/compiler-rt/test/tsan/signal_reset.cc create mode 100644 src/compiler-rt/test/tsan/signal_sync.cc create mode 100644 src/compiler-rt/test/tsan/signal_thread.cc create mode 100644 src/compiler-rt/test/tsan/signal_write.cc create mode 100644 src/compiler-rt/test/tsan/stack_sync_reuse.cc create mode 100644 src/compiler-rt/test/tsan/test.h create mode 100644 src/compiler-rt/test/tsan/thread_detach.c create mode 100644 src/compiler-rt/test/tsan/thread_detach2.c create mode 100644 src/compiler-rt/test/tsan/vptr_harmful_race4.cc create mode 100644 src/compiler-rt/test/ubsan/TestCases/Integer/summary.cpp create mode 100644 src/compiler-rt/test/ubsan/TestCases/Misc/Linux/lit.local.cfg create mode 100644 src/compiler-rt/test/ubsan/TestCases/Misc/Linux/ubsan_options.cc create mode 100644 src/compiler-rt/test/ubsan/TestCases/Misc/coverage-levels.cc create mode 100644 src/compiler-rt/test/ubsan/TestCases/Misc/log-path_test.cc create mode 100644 src/compiler-rt/test/ubsan/TestCases/Misc/nonnull-arg.cpp create mode 100644 src/compiler-rt/test/ubsan/TestCases/Misc/nonnull.cpp create mode 100644 src/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base-construction.cpp create mode 100644 src/compiler-rt/test/ubsan/TestCases/TypeCheck/vptr-virtual-base.cpp create mode 100644 src/doc/book/README.md rename src/doc/{trpl => book}/SUMMARY.md (95%) rename src/doc/{trpl => book}/advanced-linking.md (100%) rename src/doc/{trpl => book}/associated-constants.md (94%) rename src/doc/{trpl => book}/associated-types.md (100%) rename src/doc/{trpl => book}/attributes.md (100%) rename src/doc/{trpl => book}/benchmark-tests.md (100%) rename src/doc/{trpl => book}/bibliography.md (100%) rename src/doc/{trpl => book}/borrow-and-asref.md (100%) rename src/doc/{trpl => book}/box-syntax-and-patterns.md (100%) create mode 100644 src/doc/book/casting-between-types.md rename src/doc/{trpl => book}/choosing-your-guarantees.md (100%) rename src/doc/{trpl => book}/closures.md (100%) rename src/doc/{trpl => book}/comments.md (100%) rename src/doc/{trpl => book}/compiler-plugins.md (91%) rename src/doc/{trpl => book}/concurrency.md (96%) rename src/doc/{trpl => book}/conditional-compilation.md (100%) rename src/doc/{trpl => book}/const-and-static.md (100%) rename src/doc/{trpl => book}/crates-and-modules.md (100%) rename src/doc/{trpl => book}/custom-allocators.md (98%) rename src/doc/{trpl => book}/deref-coercions.md (100%) rename src/doc/{trpl => book}/dining-philosophers.md (93%) rename src/doc/{trpl => book}/documentation.md (87%) rename src/doc/{trpl => book}/drop.md (100%) rename src/doc/{trpl => book}/effective-rust.md (100%) rename src/doc/{trpl => book}/enums.md (100%) rename src/doc/{trpl => book}/error-handling.md (98%) rename src/doc/{trpl => book}/ffi.md (98%) rename src/doc/{trpl => book}/functions.md (100%) rename src/doc/{trpl => book}/generics.md (100%) create mode 100644 src/doc/book/getting-started.md rename src/doc/{trpl => book}/glossary.md (100%) rename src/doc/{trpl => book}/guessing-game.md (91%) rename src/doc/{trpl => book}/if-let.md (86%) rename src/doc/{trpl => book}/if.md (100%) rename src/doc/{trpl => book}/inline-assembly.md (100%) rename src/doc/{trpl => book}/intrinsics.md (100%) rename src/doc/{trpl => book}/iterators.md (100%) rename src/doc/{trpl => book}/lang-items.md (93%) rename src/doc/{trpl => book}/learn-rust.md (100%) rename src/doc/{trpl => book}/lifetimes.md (99%) rename src/doc/{trpl => book}/loops.md (90%) rename src/doc/{trpl => book}/macros.md (99%) rename src/doc/{trpl => book}/match.md (100%) rename src/doc/{trpl => book}/method-syntax.md (91%) rename src/doc/{trpl => book}/mutability.md (100%) rename src/doc/{trpl => book}/nightly-rust.md (100%) create mode 100644 src/doc/book/no-stdlib.md rename src/doc/{trpl => book}/operators-and-overloading.md (100%) rename src/doc/{trpl => book}/ownership.md (99%) rename src/doc/{trpl => book}/patterns.md (100%) rename src/doc/{trpl => book}/primitive-types.md (100%) rename src/doc/{trpl => book}/raw-pointers.md (100%) rename src/doc/{trpl => book}/references-and-borrowing.md (97%) rename src/doc/{trpl => book}/release-channels.md (100%) rename src/doc/{trpl => book}/rust-inside-other-languages.md (99%) rename src/doc/{trpl => book}/slice-patterns.md (100%) rename src/doc/{trpl => book}/strings.md (78%) rename src/doc/{trpl => book}/structs.md (100%) rename src/doc/{trpl => book}/syntax-and-semantics.md (100%) rename src/doc/{trpl => book}/syntax-index.md (90%) rename src/doc/{trpl => book}/testing.md (98%) rename src/doc/{trpl => book}/the-stack-and-the-heap.md (95%) rename src/doc/{trpl => book}/trait-objects.md (100%) rename src/doc/{trpl => book}/traits.md (90%) rename src/doc/{trpl => book}/type-aliases.md (91%) rename src/doc/{trpl => book}/ufcs.md (89%) rename src/doc/{trpl => book}/unsafe.md (100%) rename src/doc/{trpl => book}/unsized-types.md (100%) create mode 100644 src/doc/book/using-rust-without-the-standard-library.md rename src/doc/{trpl => book}/variable-bindings.md (100%) rename src/doc/{trpl => book}/vectors.md (100%) create mode 100644 src/doc/rustc-ux-guidelines.md delete mode 100644 src/doc/trpl/README.md delete mode 100644 src/doc/trpl/casting-between-types.md delete mode 100644 src/doc/trpl/getting-started.md delete mode 100644 src/doc/trpl/hello-cargo.md delete mode 100644 src/doc/trpl/hello-world.md delete mode 100644 src/doc/trpl/installing-rust.md delete mode 100644 src/doc/trpl/no-stdlib.md delete mode 100644 src/etc/add-authors.sh delete mode 100644 src/libcore/cmp_macros.rs create mode 100644 src/liblibc/.travis.yml create mode 100644 src/liblibc/Cargo.toml create mode 100644 src/liblibc/LICENSE-APACHE create mode 100644 src/liblibc/LICENSE-MIT create mode 100644 src/liblibc/README.md create mode 100644 src/liblibc/appveyor.yml create mode 100644 src/liblibc/ci/README.md create mode 100644 src/liblibc/ci/Vagrantfile create mode 100644 src/liblibc/ci/cargo-config create mode 100644 src/liblibc/ci/dox.sh create mode 100644 src/liblibc/ci/landing-page-footer.html create mode 100644 src/liblibc/ci/landing-page-head.html create mode 100644 src/liblibc/ci/run-all.sh create mode 100644 src/liblibc/ci/run-travis.sh create mode 100644 src/liblibc/ci/run.sh delete mode 100644 src/liblibc/lib.rs create mode 100644 src/liblibc/libc-test/Cargo.toml create mode 100644 src/liblibc/libc-test/build.rs create mode 100644 src/liblibc/libc-test/src/main.rs create mode 100644 src/liblibc/src/dox.rs create mode 100644 src/liblibc/src/lib.rs create mode 100644 src/liblibc/src/macros.rs create mode 100644 src/liblibc/src/unix/bsd/apple/b32.rs create mode 100644 src/liblibc/src/unix/bsd/apple/b64.rs create mode 100644 src/liblibc/src/unix/bsd/apple/mod.rs create mode 100644 src/liblibc/src/unix/bsd/freebsdlike/dragonfly.rs create mode 100644 src/liblibc/src/unix/bsd/freebsdlike/freebsd.rs create mode 100644 src/liblibc/src/unix/bsd/freebsdlike/mod.rs create mode 100644 src/liblibc/src/unix/bsd/freebsdlike/x86.rs create mode 100644 src/liblibc/src/unix/bsd/freebsdlike/x86_64.rs create mode 100644 src/liblibc/src/unix/bsd/mod.rs create mode 100644 src/liblibc/src/unix/bsd/openbsdlike/bitrig.rs create mode 100644 src/liblibc/src/unix/bsd/openbsdlike/mod.rs create mode 100644 src/liblibc/src/unix/bsd/openbsdlike/netbsd.rs create mode 100644 src/liblibc/src/unix/bsd/openbsdlike/openbsd.rs create mode 100644 src/liblibc/src/unix/mod.rs create mode 100644 src/liblibc/src/unix/notbsd/android/b32.rs create mode 100644 src/liblibc/src/unix/notbsd/android/b64.rs create mode 100644 src/liblibc/src/unix/notbsd/android/mod.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/mips.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/mod.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/musl.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/other/b32/arm.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/other/b32/mod.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/other/b32/x86.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/other/b64/aarch64.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/other/b64/mod.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/other/b64/x86_64.rs create mode 100644 src/liblibc/src/unix/notbsd/linux/other/mod.rs create mode 100644 src/liblibc/src/unix/notbsd/mod.rs create mode 100644 src/liblibc/src/windows.rs delete mode 100644 src/librustc/metadata/csearch.rs delete mode 100644 src/librustc/metadata/inline.rs delete mode 100644 src/librustc/metadata/mod.rs create mode 100644 src/librustc/middle/cstore.rs rename src/{librustc_mir => librustc/mir}/repr.rs (86%) create mode 100644 src/librustc/mir/tcx.rs create mode 100644 src/librustc/mir/visit.rs rename src/librustc/{metadata => session}/filesearch.rs (67%) rename src/librustc_front/{visit.rs => intravisit.rs} (89%) rename src/{librustc/middle => librustc_metadata}/astencode.rs (97%) rename src/{librustc/metadata => librustc_metadata}/common.rs (98%) rename src/{librustc/metadata => librustc_metadata}/creader.rs (90%) create mode 100644 src/librustc_metadata/csearch.rs rename src/{librustc/metadata => librustc_metadata}/cstore.rs (87%) rename src/{librustc/metadata => librustc_metadata}/decoder.rs (96%) create mode 100644 src/librustc_metadata/diagnostics.rs rename src/{librustc/metadata => librustc_metadata}/encoder.rs (97%) rename src/{librustc/metadata => librustc_metadata}/index.rs (100%) create mode 100644 src/librustc_metadata/lib.rs rename src/{librustc/metadata => librustc_metadata}/loader.rs (96%) rename src/{librustc/metadata => librustc_metadata}/macro_import.rs (94%) create mode 100644 src/librustc_metadata/macros.rs rename src/{librustc/metadata => librustc_metadata}/tydecode.rs (99%) rename src/{librustc/metadata => librustc_metadata}/tyencode.rs (99%) rename src/librustc_mir/{tcx => hair/cx}/block.rs (80%) rename src/librustc_mir/{tcx => hair/cx}/expr.rs (90%) rename src/librustc_mir/{tcx => hair/cx}/mod.rs (88%) rename src/librustc_mir/{tcx => hair/cx}/pattern.rs (54%) rename src/librustc_mir/{tcx => hair/cx}/to_ref.rs (70%) rename src/librustc_mir/{hair.rs => hair/mod.rs} (86%) create mode 100644 src/librustc_mir/transform/erase_regions.rs rename src/{test/parse-fail/removed-syntax-larrow-init.rs => librustc_mir/transform/mod.rs} (64%) create mode 100644 src/librustc_mir/transform/simplify_cfg.rs create mode 100644 src/librustc_mir/transform/util.rs mode change 100755 => 100644 src/librustc_platform_intrinsics/lib.rs rename src/{librustc/plugin => librustc_plugin}/build.rs (92%) create mode 100644 src/librustc_plugin/diagnostics.rs rename src/{librustc/plugin/mod.rs => librustc_plugin/lib.rs} (68%) rename src/{librustc/plugin => librustc_plugin}/load.rs (91%) rename src/{librustc/plugin => librustc_plugin}/registry.rs (98%) create mode 100644 src/librustc_trans/trans/mir/analyze.rs create mode 100644 src/librustc_trans/trans/mir/block.rs create mode 100644 src/librustc_trans/trans/mir/constant.rs create mode 100644 src/librustc_trans/trans/mir/lvalue.rs create mode 100644 src/librustc_trans/trans/mir/mod.rs create mode 100644 src/librustc_trans/trans/mir/operand.rs create mode 100644 src/librustc_trans/trans/mir/rvalue.rs create mode 100644 src/librustc_trans/trans/mir/statement.rs rename src/librustdoc/html/static/{main.css => rustdoc.css} (85%) create mode 100644 src/librustdoc/html/static/styles/main.css delete mode 100644 src/libstd/sys/unix/c.rs create mode 100644 src/libstd/sys/unix/ext/thread.rs delete mode 100644 src/libstd/sys/unix/sync.rs create mode 100644 src/libstd/sys/windows/ext/thread.rs create mode 100644 src/libsyntax/parse/lexer/unicode_chars.rs rename src/{librustc => libsyntax}/util/lev_distance.rs (86%) create mode 100644 src/libsyntax/util/move_map.rs create mode 100644 src/libsyntax/util/node_count.rs create mode 100644 src/libsyntax/util/parser.rs create mode 100644 src/rtstartup/rsbegin.rs create mode 100644 src/rtstartup/rsend.rs create mode 100644 src/test/auxiliary/issue-11225-3.rs create mode 100644 src/test/auxiliary/issue-27362.rs create mode 100644 src/test/auxiliary/issue-28927-1.rs create mode 100644 src/test/auxiliary/issue-28927-2.rs create mode 100644 src/test/auxiliary/issue-30109-1.rs create mode 100644 src/test/codegen/fatptr.rs create mode 100644 src/test/compile-fail/array_const_index-0.rs rename src/test/{parse-fail/attr-before-ext.rs => compile-fail/array_const_index-1.rs} (71%) create mode 100644 src/test/compile-fail/cfg-non-opt-expr.rs create mode 100644 src/test/compile-fail/coherence-projection-conflict-ty-param.rs create mode 100644 src/test/compile-fail/const-array-oob-arith.rs create mode 100644 src/test/compile-fail/const-call.rs rename src/test/{parse-fail/attr-before-let.rs => compile-fail/const-index-feature-gate.rs} (73%) create mode 100644 src/test/compile-fail/const-integer-bool-ops.rs create mode 100644 src/test/compile-fail/const-pattern-irrefutable.rs create mode 100644 src/test/compile-fail/empty-struct-braces-pat-3.rs create mode 100644 src/test/compile-fail/expr_attr_paren_order.rs create mode 100644 src/test/compile-fail/feature-gate-fundamental.rs rename src/test/compile-fail/{gated-no-std.rs => gated-no-core.rs} (91%) create mode 100644 src/test/compile-fail/if-let-arm-types.rs mode change 100755 => 100644 src/test/compile-fail/internal-unstable.rs create mode 100644 src/test/compile-fail/issue-10969.rs rename src/test/{parse-fail => compile-fail}/issue-12560-1.rs (70%) create mode 100644 src/test/compile-fail/issue-21946.rs create mode 100644 src/test/compile-fail/issue-23217.rs create mode 100644 src/test/compile-fail/issue-26548.rs create mode 100644 src/test/compile-fail/issue-28586.rs create mode 100644 src/test/compile-fail/issue-28971.rs create mode 100644 src/test/compile-fail/issue-28992-empty.rs create mode 100644 src/test/compile-fail/issue-29147.rs create mode 100644 src/test/compile-fail/issue-29857.rs create mode 100644 src/test/compile-fail/issue-29861.rs create mode 100644 src/test/compile-fail/issue-30007.rs create mode 100644 src/test/compile-fail/issue-30236.rs create mode 100644 src/test/compile-fail/lint-malformed.rs delete mode 100644 src/test/compile-fail/lint-raw-ptr-derive.rs create mode 100644 src/test/compile-fail/lint-removed-cmdline.rs create mode 100644 src/test/compile-fail/lint-removed.rs create mode 100644 src/test/compile-fail/lint-renamed-cmdline.rs create mode 100644 src/test/compile-fail/lint-renamed.rs create mode 100644 src/test/compile-fail/lint-unknown-lint-cmdline.rs create mode 100644 src/test/compile-fail/lint-unknown-lint.rs create mode 100644 src/test/compile-fail/macro-context.rs create mode 100644 src/test/compile-fail/macro-error.rs create mode 100644 src/test/compile-fail/macro-missing-fragment.rs create mode 100644 src/test/compile-fail/macro-name-typo.rs create mode 100644 src/test/compile-fail/malformed_macro_lhs.rs create mode 100644 src/test/compile-fail/mut-suggestion.rs create mode 100644 src/test/compile-fail/no-extern-crate-in-glob-import.rs create mode 100644 src/test/compile-fail/privacy-sanity.rs rename src/test/{run-pass/issue-21296.rs => compile-fail/resolve-hint-macro.rs} (72%) create mode 100644 src/test/compile-fail/stmt_expr_attrs_no_feature.rs create mode 100644 src/test/compile-fail/unreachable-in-call.rs create mode 100644 src/test/parse-fail/assoc-oddities-1.rs create mode 100644 src/test/parse-fail/assoc-oddities-2.rs create mode 100644 src/test/parse-fail/assoc-oddities-3.rs create mode 100644 src/test/parse-fail/match-refactor-to-expr.rs delete mode 100644 src/test/parse-fail/removed-syntax-larrow-move.rs create mode 100644 src/test/parse-fail/unicode-chars.rs create mode 100644 src/test/pretty/stmt_expr_attributes.rs create mode 100644 src/test/run-fail/overflowing-rsh-5.rs create mode 100644 src/test/run-fail/overflowing-rsh-6.rs create mode 100644 src/test/run-make/compiler-rt-works-on-mingw/Makefile create mode 100644 src/test/run-make/compiler-rt-works-on-mingw/foo.cpp create mode 100644 src/test/run-make/compiler-rt-works-on-mingw/foo.rs create mode 100644 src/test/run-make/extern-multiple-copies/Makefile create mode 100644 src/test/run-make/extern-multiple-copies/bar.rs create mode 100644 src/test/run-make/extern-multiple-copies/foo1.rs create mode 100644 src/test/run-make/extern-multiple-copies/foo2.rs create mode 100644 src/test/run-make/issue-30063/Makefile rename src/test/{compile-fail/staged_api.rs => run-make/issue-30063/foo.rs} (88%) create mode 100644 src/test/run-pass-fulldeps/ast_stmt_expr_attr.rs rename src/test/{run-pass => run-pass-valgrind}/down-with-thread-dtors.rs (100%) rename src/test/{run-pass => run-pass-valgrind}/exit-flushes.rs (100%) rename src/test/{run-pass => run-pass-valgrind}/osx-frameworks.rs (100%) create mode 100644 src/test/run-pass/array_const_index-1.rs create mode 100644 src/test/run-pass/asm-indirect-memory.rs create mode 100644 src/test/run-pass/assert-eq-macro-unsized.rs create mode 100644 src/test/run-pass/cfg_stmt_expr.rs create mode 100644 src/test/run-pass/check_const-feature-gated.rs create mode 100644 src/test/run-pass/coherence-rfc447-constrained.rs create mode 100644 src/test/run-pass/deriving-clone-array.rs create mode 100644 src/test/run-pass/dst-field-align.rs create mode 100644 src/test/run-pass/env-funky-keys.rs create mode 100644 src/test/run-pass/issue-11225-3.rs create mode 100644 src/test/run-pass/issue-19001.rs create mode 100644 src/test/run-pass/issue-23406.rs create mode 100644 src/test/run-pass/issue-23598.rs create mode 100644 src/test/run-pass/issue-23992.rs create mode 100644 src/test/run-pass/issue-24954.rs create mode 100644 src/test/run-pass/issue-25810.rs create mode 100644 src/test/run-pass/issue-29030.rs create mode 100644 src/test/run-pass/issue-29071-2.rs create mode 100644 src/test/run-pass/issue-29071.rs create mode 100644 src/test/run-pass/issue-29147.rs create mode 100644 src/test/run-pass/issue-29227.rs create mode 100644 src/test/run-pass/issue-29276.rs create mode 100644 src/test/run-pass/issue-29466.rs create mode 100644 src/test/run-pass/issue-29488.rs create mode 100644 src/test/run-pass/issue-29522.rs create mode 100644 src/test/run-pass/issue-29540.rs create mode 100644 src/test/run-pass/issue-29710.rs create mode 100644 src/test/run-pass/issue-29740.rs create mode 100644 src/test/run-pass/issue-pr29383.rs create mode 100644 src/test/run-pass/mir_coercions.rs create mode 100644 src/test/run-pass/mir_fat_ptr.rs create mode 100644 src/test/run-pass/mir_raw_fat_ptr.rs rename src/test/{parse-fail/attr-before-stmt.rs => run-pass/mir_small_agg_arg.rs} (71%) create mode 100644 src/test/run-pass/mir_trans_array.rs create mode 100644 src/test/run-pass/mir_trans_array_2.rs rename src/test/{parse-fail/doc-before-macro.rs => run-pass/mir_trans_spike1.rs} (69%) create mode 100644 src/test/run-pass/mir_trans_switchint.rs create mode 100644 src/test/run-pass/paths-containing-nul.rs create mode 100644 src/test/run-pass/resolve-pseudo-shadowing.rs mode change 100755 => 100644 src/test/run-pass/simd-intrinsic-generic-cast.rs create mode 100644 src/test/run-pass/stmt_expr_attr_macro_parse.rs create mode 100644 src/test/run-pass/string-box-error.rs create mode 100644 src/test/run-pass/trait-copy-guessing.rs create mode 100644 src/test/run-pass/weird-exit-code.rs create mode 100644 src/test/rustdoc/cap-lints.rs create mode 100644 src/test/rustdoc/issue-25001.rs create mode 100644 src/test/rustdoc/issue-27362.rs create mode 100644 src/test/rustdoc/issue-28927.rs create mode 100644 src/test/rustdoc/issue-29449.rs create mode 100644 src/test/rustdoc/issue-30109.rs create mode 100644 src/test/rustdoc/issue-30252.rs create mode 100644 src/test/rustdoc/macros.rs diff --git a/AUTHORS.txt b/AUTHORS.txt deleted file mode 100644 index d5db7e3310..0000000000 --- a/AUTHORS.txt +++ /dev/null @@ -1,1365 +0,0 @@ -Rust was written by these fine people: - -Aaron Friel -Aaron Gallagher <_@habnab.it> -Aaron Laursen -Aaron Liblong -Aaron Raimist -Aaron Todd -Aaron Turon -Aaron Weiss -Abhishek Chanda -Adam Badawy -Adam Bozanich -Adam Crume -Adam Heins -Adam Jacob -Adam Roben -Adam Szkoda -Adenilson Cavalcanti -Adolfo Ochagavía -Adrien Brault -Adrien Tétar -Agoston Szepessy -Ahmed Charles -Aidan Cully -Aidan Hobson Sayers -A.J. Gardner -Akos Kiss -Akshay Chiwhane -Alan Andrade -Alan Cutter -Alan Williams -Aleksander Balicki -Aleksandr Koshlo -Aleksey Kladov -Alexander Artemenko -Alexander Bliskovsky -Alexander Bulaev -Alexander Campbell -Alexander Chernyakhovsky -Alexander Korolkov -Alexander Light -Alexander Polakov -Alexander Stavonin -Alexandre Gagnon -Alexandros Tasos -Alex Burka -Alex Crichton -AlexDenisov <1101.debian@gmail.com> -Alexei Sholik -Alex Gaynor -Alexis Beingessner -Alex Lyon -Alex Newman -Alex Ozdemir -Alex Quach -Alex Rønne Petersen -Alex Stokes -Alex Whitney -Alfie John -Alfie John -Alisdair Owens -Ali Smesseim -Aljaž "g5pw" Srebrnič -Amanieu d'Antras -Amit Aryeh Levy -Amit Saha -Amol Mundayoor -Amy Unger -Anatoly Ikorsky -Anders Kaseorg -Andrea Canciani -Andre Arko -Andreas Gal -Andreas Martens -Andreas Neuhaus -Andreas Ots -Andreas Sommer -Andreas Tolfsen -Andre Bogus -Andrei Formiga -Andrei Oprea -Andrew Barchuk -Andrew Cann -Andrew Chin -Andrew Dunham -Andrew Foote -Andrew Gallant -Andrew Hobden -Andrew Kensler -Andrew Kuchev <0coming.soon@gmail.com> -Andrew Paseltiner -Andrew Poelstra -Andrew Seidl -Andrew Straw -Andrew Wagner -androm3da -Andrzej Janik -Andy Caldwell -Andy Grover -angelsl -Angus Lees -Anthony Juckel -Anton Löfgren -Antti Keränen -aochagavia -Aram Visser -arcnmx -Arcterus -Areski Belaid -Ariel Ben-Yehuda -Arjan Topolovec -Arkaitz Jimenez -Armin Preiml -Armin Ronacher -Arpad Borsos -Artem -Artem Shitov -Arthur Liao -arthurprs -arturo -Ashkan Kiani -Ashok Gautham -Augusto Hack -auREAX -Austin Bonander -Austin Hellyer -Austin King -Austin Seipp -Avdi Grimm -awlnx -Axel Viala -Aydin Kim -b1nd -bachm -Barosl LEE -Barosl Lee -Bastien Dejean -bcoopers -Ben Alpert -benaryorg -Ben Ashford -Ben Blum -ben fleis -Ben Foppa -Ben Gamari -Ben Gesoff -Ben Harris -Benjamin Adamson -Benjamin Herr -Benjamin Jackman -Benjamin Kircher -Benjamin Peterson -Ben Kelly -Ben Noordhuis -Ben Sago -benshu -Ben S -Ben Striegel -Bhargav Patel -Bheesham Persaud -Bilal Husain -Bill Fallon -Bill Myers -billpmurphy -Bill Wendling -Birunthan Mohanathas -Björn Steinbrink -blackbeam -blake2-ppc -Blake Loring -bluss -bombless -Boris Egorov -bors -Bouke van der Bijl -Brad King -Brandon Sanderson -Brandon Waskiewicz -Branimir -Brendan Cully -Brendan Eich -Brendan Graetz -Brendan McLoughlin -Brendan Zabarauskas -Brett Cannon -Brian Anderson -Brian Brooks -Brian Campbell -Brian Dawn -Brian J Brennan -Brian J. Burg -Brian Koropoff -Brian Leibig -Brian Quinlan -Brody Holden -Bruno de Oliveira Abinader -Bruno Tavares -Bryan Dunsmore -Bryce Van Dyk -Byron Williams -Cadence Marseille -caipre -Caitlin Potter -Cameron Sun -Cameron Zwarich -Camille Roussel -Camille TJHOA -Cam Jackson -Carl-Anton Ingmarsson -Carl Lerche -Carlos Galarza -Carlos Liam -Carlos -Carol (Nichols || Goulding) -Carol Willing -Carter Hinsley -Carter Tazio Schonwald -CarVac -Caspar Krieger -Cesar Eduardo Barros -Charlotte Spencer -Chase Southwood -Ches Martin -chitra -Chloe <5paceToast@users.noreply.github.com> -Chris C Cerami -Chris Double -Chris Drake -Chris Hellmuth -Chris Krycho -Chris Morgan -Chris Nixon -Chris Peterson -Chris Pressey -Chris Sainty -Chris Shea -Chris Thorn -Christian Persson -Christian Stadelmann -Christian Weinz -Christoph Burgdorf -Christopher Bergqvist -Christopher Chambers -christopherdumas -Christopher Kendell -Chris Wong -chromatic -Chuck Bassett -Chuck Ries -Clark Gaebel -clatour -Clifford Caoile -Clinton Ryan -Cody P Schafer -Cody Schroeder -Cole Mickens -Cole Reynolds -Colin Davidson -Colin Sherratt -Colin Wallace -Colin Walters -comex -Conrad Kleinespel -corentih -Corentin Henry -Corey Farwell -Corey Ford -Corey Richardson -Cornel Punga -Craig Hills -crhino -Cristian Kubis -Cristi Burcă -Cristi Cobzarenco -critiqjo -Cruz Julian Bishop -Daan Rijks -Dabo Ross -Damian Gryski -Damien Grassart -Damien Radtke -Damien Schoof -Dan Albert -Dan Burkert -Dan Callahan -Dan Connolly -Daniel Albert -Daniel Brooks -Daniel Carral -Daniel Fagnan -Daniel Farina -Daniel Griffen -Daniel Grunwald -Daniel Hofstetter -Daniel Keep -Daniel Lobato García -Daniel Luz -Daniel MacDougall -Daniel Micay -Daniel Patterson -Daniel Raloff -Daniel Ralston -Daniel Ramos -Daniel Rollins -Daniel Rosenwasser -Daniel Trebbien -Daniel Ursache Dogariu -Daniil Smirnov -Danilo Bargen -Dan Luu -Dan Schatzberg -Dan W. <1danwade@gmail.com> -Dan Yang -Darin Morrison -darkf -Darrell Hamilton -Dato Simó -Dave Herman -Dave Hodder -Dave Huseby -David Campbell -David Creswick -David Elliott -David Forsythe -David Halperin -David King -David Klein -David Mally -David Manescu -David Rajchenbach-Teller -David Reid -David Renshaw -David Ripton -David Ross -David Stygstra -David Szotten -David Vazgenovich Shakaryan -David Voit -Davis Silverman -defuz -Denis Defreyne -DenisKolodin -Derecho -Derek Chiang -Derek Guenther -Derek Harland -Devon Hollowood -dgoon -diaphore -Diego Giagio -Diego Ongaro -Diggory Blake -Diggory Hardy -Dimitri Krassovski -Dirk Gadsden -Dirkjan Bussink -Dirkjan Ochtman -Dirk Leifeld -Div Shekhar -diwic -DJUrsus -dmgawel -Dmitry Ermolov -Dmitry Promsky -Dmitry Vasiliev -Dominick Allen -Dominic van Berkel -Dominik Inführ -Dongie Agnir -Dong Zhou -Do Nhat Minh -donkopotamus -Donovan Preston -Don Petersen -Doug Goldstein -Douglas Young -Drew Crawford -Drew Willcoxon -Duane Edwards -Duncan Regan -Dylan Braithwaite -Dylan Ede -Dylan McKay -Dzmitry Malyshau -Earl St Sauver -ebadf -econoplas -Eduard Bopp -Eduard Burtescu -Eduardo Bautista -Edward Wang -Edward Z. Yang -Ehsanul Hoque -Elantsev Serj -Eli Friedman -eliovir -Eljay -Elliott Slaughter -Elly Fong-Jones -elszben -emanueLczirai -Emanuel Czirai -Emanuel Rylke -Emeliov Dmitrii -Emilio Cobos Álvarez -Emily Dunham -Eric Allen -Eric Biggers -Eric Findlay -Eric Holk -Eric Holmes -Eric Kidd -Erick Rivas -Erick Tryzelaar -Eric Martin -Eric Platon -Eric Reed -Eric Ye -Erik Davidson -Erik Lyon -Erik Michaels-Ober -Erik Price -Erik Rose -Erwan -Esption -eternaleye -Etienne Millon -Eunchong Yu -Eunji Jeong -Evan Klitzke -Evan McClanahan -Evgeny Sologubov -Fabian Deutsch -Fabiano Beselga -Fabrice Desré -FakeKane -Falco Hirschenberger -Fedor Indutny -Felix Crux -Felix Raimundo -Felix S. Klock II -fenduru -Fenhl -Filip Szczepański -Flavio Percoco -flo-l -Florian Gilcher -Florian Hahn -Florian Hartwig -Florian Wilkens -Florian Zeitz -fort -Francisco Souza -frankamp -Franklin Chen -Frank McSherry -Franziska Hinkelmann -free-Runner -FuGangqiang -funkill -g3xzh -Gábor Horváth -Gábor Lehel -Gabriel -gamazeps -Gareth Daniel Smith -gareth -Garming Sam -Garrett Heel -Gary Linscott -Gary M. Josack -Gavin Baker -gentlefolk -Geoff Hill -Geoffrey Thomas -Geoffroy Couprie -Geoffry Song -Georg Brandl -George Papanikolaou -Georges Dubus -Germano Gabbianelli -Gil Cottle -Gioele Barabucci -github-monoculture -GlacJAY -Gleb Kozyrev -glendc -Glenn Willen -Gonçalo Cabrita <_@gmcabrita.com> -Grahame Bowland -Graham Fawcett -Graydon Hoare -Greg Chapple -Grigoriy -Guillaume Gomez -Guillaume Pinot -Gulshan Singh -Gyorgy Andrasek -Haitao Li -Hajime Morrita -Hanno Braun -hansjorg -Harry Marr -Heather -Hech -Heejong Ahn -Henrik Schopmans -Herman J. Radtke III -HeroesGrave -Hika Hibariya -Hong Chulju -Honza Strnad -Huachao Huang -Hugo Jobling -Hugo van der Wijst -Hunan Rostomyan -Huon Wilson -Hyeon Kim -Ian Connolly -Ian Daniher -Ian D. Bollinger -Ignacio Corderi -Igor Bukanov -Igor Shuvalov -Igor Strebezhev -Ilya Dmitrichenko -Ilyong Cho -Ingo Blechschmidt -inrustwetrust -Irving A.J. Rivas Z. -Isaac Aggrey -Isaac Dupree -Isaac Ge -Ivan Enderlin -Ivan Ivaschenko -Ivan Jager -Ivan Kozik -Ivano Coppola -Ivan Petkov -Ivan Radanov Ivanov -Ivan Stankovic -Ivan Ukhov -Iven Hsu -Jack Fransham -Jack Heizer -Jack Moffitt -Jack Wilson -Jacob Edelman -Jacob Harris Cryer Kragh -Jacob Hegna -Jacob Parker -Jaemin Moon -Jag Talon -Jake Goulding -Jake Hickey -Jake Kaufman -Jake Kerr -Jake Scott -Jake Shadle -Jake Worth -Jakub Bukaj -Jakub Vrána -Jakub Wieczorek -James Bell -James Deng -James Hurst -James Lal -James Laverack -jamesluke -James McGlashan -James Miller -James Perry -James Rowe -James Sanders -James Tranovich -Jan Andersson -Jan Bujak -Jan-Erik Rediger -Jan Kobler -Jan Likar -Jan Niklas Hasse -Jannis Harder -Jannis Redmann -Jared Roesch -Jarod Liu -Jashank Jeremy -Jason Fager -Jason Orendorff -Jason Schein -Jason Thompson -Jason Toffaletti -Jason Yeo -jatinn -Jauhien Piatlicki -Jay Anderson -Jay True -J Bailey -jbranchaud -J.C. Moyer -Jean Maillard -Jeaye -Jed Davis -Jed Estep -Jeehoon Kang -Jeff Balogh -Jeff Belgum -Jeff Muizelaar -Jeff Olson -Jeff Parsons -Jeffrey Seyfried -Jeffrey Yasskin -Jelte Fennema -Jens Nockert -Jeong YunWon -Jeremy Letang -Jeremy Schlatter -Jesse Jones -Jesse Luehrs -Jesse Ray -Jesse Ruderman -Jessy Diamond Exum -Jesús Espino -Jethro Beekman -jethrogb -Jexell -Jihyeok Seo -Jihyun Yu -Jim Apple -Jim Blandy -Jimmie Elvenmark -Jimmy Lu -Jimmy Zelinskie -Jim Radford -Jiří Stránský -J. J. Weber -jmgrosen -jmu303 -João Oliveira -joaoxsouls -Joe Pletcher -Joe Schafer -Johannes Hoff -Johannes Löthberg -Johannes Muenzel -Johannes Oertel -Johann Hofmann -Johann Tuffe -John Albietz -John Barker -John Clements -John Ericson -John Fresco -John Gallagher -John Hodge -John Kåre Alsaker -John Kleint -John Louis Walker -John Schmidt -John Simon -John Talling -John Thomas -John Van Enk -John Zhang -joliv -Jonas Hietala -Jonas Schievink -Jonathan Bailey -Jonathan Boyett -Jonathan Hansford -Jonathan Reem -Jonathan S -Jonathan Sternberg -Jon Haddad -Jon Morton -JONNALAGADDA Srinivas -jooert -Joonas Javanainen -Jordan Humphreys -Jordan Woehr -Jordi Boggiano -Jorge Aparicio -Jorge Israel Peña -Joris Rehm -Jormundir -Jørn Lode -Jose Narvaez -Joseph Caudle -Joseph Crail -Joseph Martin -Joseph Rushton Wakeling -Josh Austin -Josh Haberman -Josh Matthews -Josh Stone -Josh Triplett -Joshua Clark -Joshua Holmer -Joshua Landau -Joshua Wise -Joshua Yanovski -jotomicron -JP-Ellis -JP Sugarbroad -jrburke -jrincayc -J. Ryan Stinnett -Julia Evans -Julian Orth -Julian Viereck -Junseok Lee -Junyoung Cho -JustAPerson -Justin Noah -juxiliary -jxv -Jyun-Yan You -Kagami Sascha Rosylight -Kang Seonghoon -Kasey Carrothers -Keegan McAllister -Kelly Wilson -Kelvin Ly -Ken Tossell -KernelJ -Keshav Kini -Kevin Atkinson -Kevin Ballard -Kevin Butler -Kevin Cantu -Kevin Mehall -Kevin Murphy -Kevin Rauwolf -Kevin Walter -Kevin Yap -Kevin Yeh -kgv -kickinbahk -Kieran Hunt -Kiet Tran -Kim Røen -kjpgit -klutzy -Kohei Hasegawa -KokaKiwi -korenchkin -Kornel Lesiński -Kostas Karachalios -Kristof Söderström -krumelmonster -Krzysztof Drewniak -Kubilay Kocak -kulakowski -kwantam -Kyeongwoon Lee -Kyle Mayes -Kyle Robinson Young -Lai Jiangshan -Lars Bergstrom -Laurence Tratt -Laurent Bonnans -Lauri Lehmijoki -Lawrence Velázquez -Leah Hanson -Lee Aronson -Lee Jeffery -Lee Jenkins -Lee Wondong -Leif Arne Storset -LemmingAvalanche -Lennart Kudling -Leo Correa -Leonids Maslovs -Leo Testard -leunggamciu -Liam Monahan -Liigo Zhuang -Lindsey Kuper -Lionel Flandrin -llogiq -Logan Chien -Loïc Damien -Lorenz -lpy -Luca Bruno -lucy -Luis de Bethencourt -Łukasz Niemier -Luke Francl -Luke Gallagher -Luke Metz -Luke Steensen -lummax -Luqman Aden -lyuts -madmalik -Magnus Auvinen -Mahmut Bulut -maikklein -Makoto Kato -Makoto Nakashima -Manish Goregaokar -Manuel Hoffmann -Marc-Antoine Perennou -marcell -Marcello Seri -Marcell Pardavi -Marcel Müller -Marcel Rodrigues -Marcus Klaas -Margaret Meyerhofer -Marijn Haverbeke -Marin Atanasov Nikolov -Mário Feroldi -Mark Buer -Mark Lacey <641@rudkx.com> -Mark Mossberg -Marko Lalic -Mark Rowe -Mark Sinclair -Markus Siemens -Markus Unterwaditzer -Markus Westerlind -Mark Vian -Martin DeMello -Martin Olsson -Martin Pool -Martin Wernstål -Marti Raudsepp -Marvin Löbel -masklinn -Matěj Grabovský -Matej Lach -Mateusz Czapliński -Mathieu David -Mathieu Poumeyrol -Mathieu Rochette -Mathijs van de Nes -Matt Brubeck -Matt Carberry -Matt Coffin -Matt Cox -Matt Friedman -Matthew Astley -Matthew Auld -Matthew Iselin -Matthew McPherrin -Matthew O'Connor -Matthias Bussonnier -Matthias Einwag -Matthias Kauer -Matthijs Hofstra -Matthijs van der Vleuten -Matt McPherrin -Matt Murphy -Matt Roche -Matt Windsor -Mátyás Mustoha -Maxime Quandalle -Maximilian Haack -Maxim Kolganov -Max Jacobson -Max Penet -Maya Nitu -mchaput -mdinger -Meyer S. Jacobs -Micah Chalmer -Michael Alexander -Michael Arntzenius -Michael Bebenita -Michael Budde -Michael Choate -Michael Dagitses -Michael Darakananda -Michael Fairley -Michael Gehring -Michael Howell -Michael Kainer -Michael Layzell -Michael Letterle -Michael Macias -Michael Matuzak -Michael McConville -Michael Neumann -Michael Pankov -Michael Park -Michael Pratt -Michael Reinhard -Michael Rosenberg <42micro@gmail.com> -Michael Sproul -Michael Sullivan -Michael Williams -Michael Woerister -Michael Wu -Michael Zhou -Michał Czardybon -Michał Krasnoborski -Mickaël Delahaye -Mickaël Raybaud-Roig -Mickaël Salaün -Mick Koch -midinastasurazz -Mihaly Barasz -Mihnea Dobrescu-Balaur -Mike Boutin -Mike Dilger -Mike English -Mike Marcacci -Mike Pedersen -Mike Robinson -Mike Sampson -Mikhail Zabaluev -Mikko Perttunen -mitaa -mitchmindtree -Mohammed Attia -moonglum -mrec -mr.Shu -Ms2ger -Mukilan Thiagarajan -Murarth -musitdev -Nafis -nathan dotz -Nathan Froyd -Nathaniel Herman -Nathaniel Theis -Nathan Kleyn -Nathan Long -Nathan Stoddard -Nathan Typanski -Nathan Wilson -Nathan Zadoks -Neil Pankey -Nelo Onyiah -Nelson Chen -nham -NiccosSystem -Nicholas Bishop -Nicholas Mazzuca -Nicholas Seckar -Nick Cameron -Nick Desaulniers -Nick Fitzgerald -Nick Hamann -Nick Howell -Nick Platt -Nick Sarten -Nicolas Silva -Nicolette Verlinden -Niels Egberts -Niels langager Ellegaard -Nif Ward -Nikita Pekin -Niklas Koep -Nikolay Kondratyev -Niko Matsakis -Nils Liberg -Nils Winter -Niranjan Padmanabhan -noam -Noam Yorav-Raphael -NODA, Kai -Noufal Ibrahim -novalis -nsf -nwin -nxnfufunezn -Oak -OGINO Masanori -OlegTsyba -Ole Krüger -Oliver Middleton -Oliver Schneider -Olivier Saut -olivren -Olle Jonsson -olombard -Or Brostovski -Oren Hazi -Ori Avtalion -Or Neeman -Orphée Lafond-Lummis -Orpheus Lummis -osa1 -O S K Chaitanya -Overmind JIANG -Ožbolt Menegatti -P1start -Pablo Brasero -Palmer Cox -panicbit -Paolo Falabella -Parker Moore -Pascal Hertleif -Patrick Reisert -Patrick Walton -Patrick Yevsukov -Patrik Kårlin -Paul ADENOT -Paul A. Jungwirth -Paul Banks -Paul Collier -Paul Collins -Paul Crowley -Paul Faria -Paul Oliver -Paul Osborne -Paul Quint -Paul Stansifer -Paul Woolcock -Pavel Panchekha -Pavel Pravosud -Pawel Olzacki -Pedro Larroy -Peer Aramillo Irizar -peferron -Pete Hunt -Peter Atashian -Peter Elmers -Peter Hull -Peter Marheine -Peter Minten -Peter Reid -Peter Schuller -Peter Williams -Peter Zotov -Petter Remen -pez -Phil Dawes -Philip Munksgaard -Philipp Brüschweiler -Philipp Gesang -Philipp Matthias Schäfer -Philipp Oppermann -Phil Ruffwind -Pierre Baillet -pierzchalski -Piotr Czarnecki -Piotr Jawniak -Piotr Szotkowski -Piotr Zolnierek -Poga Po -posixphreak -Potpourri -Pradeep Kumar -Prudhvi Krishna Surapaneni -Przemysław Wesołek -Pyfisch -Pyry Kontio -Pythoner6 -Q.P.Liu -qwitwa -Rafael Ávila de Espíndola -Rahul Horé -Ralf Jung -Ralph Bodenner -Ralph Giles -Ramkumar Ramachandra -Randati -Raphael Catolino -Raphael Nestler -Raphael Speyer -Raul Gutierrez S -Ravi Shankar -Ray Clanan -ray glover -reedlepee -Reilly Watson -Rein Henrichs -Rémi Audebert -Remi Rampin -Renato Alves -Renato Riccieri Santos Zannon -Renato Zannon -Reuben Morais -reus -Reza Akhavan -Ricardo Martins -Ricardo M. Correia -Ricardo Signes -Richard Diamond -Rich Lane -Richo Healey -Rick Waldron -Ricky Taylor -Rizky Luthfianto -rjz -Rob Arnold -Robert Buonpastore -Robert Clipsham -Robert Foss -Robert Gardner -Robert Gawdzik -Robert Irelan -Robert Knight -Robert Millar -Rob Hoelz -Robin Gloster -Robin Kruppe -Robin Stocker -Rob Young -Rohit Joshi -Roland Tanglao -Rolf Timmermans -Rolf van de Krol -Ron Dahlgren -Rory O’Kane -Roy Crihfield -Roy Frostig -Ruby -Rüdiger Sonderfeld -rundrop1 -Russell Johnston -Russell McClellan -Ruud van Asseldonk -Ryan Levick -Ryan Mulligan -Ryan Pendleton -Ryan Prichard -Ryan Riginding -Ryan Scheel -Ryman -らいどっと -Ryo Munakata -Sae-bom Kim -Salem Talha -saml -Samuel Chase -Samuel Neves -Sander Mathijs van Veen -Sangeun Kim -Sankha Narayan Guria -Santiago Pastorino -Santiago Rodriguez -Saurabh Anand -Scott Jenkins -Scott Lawrence -Scott Olson -Sean Bowe -Sean Chalmers -Sean Collins -Sean Gillespie -Sean Jensen-Grey -Sean McArthur -Sean Moon -Sean Patrick Santos -Sean Stangl -Sean T Allen -Sebastian Gesemann -Sebastian Hahn -Sebastian N. Fernandez -Sebastian Rasmussen -Sebastian Wicki -Sebastian Zaha -Sébastien Chauvel -Sébastien Crozet -Sébastien Marie -Sebastien Martini -Sébastien Paolacci -Seeker14491 -Seonghyun Kim -Seo Sanghyeon -Sergio Benitez -Seth Faxon -Seth Pink -Seth Pollack -sevrak -Shamir Khodzha -sheroze1123 -Shmuale Mark -SiegeLord -Simonas Kazlauskas -Simon Barber-Dueck -Simon Kern -Simon Mazur -Simon Persson -Simon Sapin -Simon Wollwage -simplex -Sindre Johansen -sinkuu -skeleten -Skyler -smenardpw -Son -sp3d -S Pradeep Kumar -Squeaky -startling -Stefan Bucur -Stefan O'Rear -Stefan Plantikow -Stepan Koltsov -Sterling Greene -Steve Gury -Steve Klabnik -Steven Allen -Steven Crockett -Steven De Coeyer -Steven Fackler -Steven Sheldon -Steven Stewart-Gallus -Steven Walter -Strahinja Val Markovic -Stuart Pernsteiner -Subhash Bhushan -sumito3478 -Swaroop C H -Sylvestre Ledru -Taliesin Beynon -Tamir Duberstein -Tamir Duberstein -Taras Shpot -tav -Taylor Hutchison -Ted Horst -Ted Mielczarek -Tero Hänninen -Tero Hänninen -th0114nd -Thad Guidry -Theo Belaire -theptrk -Thiago Carvalho -thiagopnts -Thiago Pontes -Thomas Backman -Thomas Bracht Laumann Jespersen -Thomas Daede -Thomas Jespersen -Thomas Karpiniec -Tiago Nobrega -Tibor Benke -Ticki -Till Hoeppner -Tim Brooks -Tim Chevalier -Tim Cuthbertson -Tim Dumol -Tim JIANG -Tim Joseph Dumol -Tim Kuehn -Tim Neumann -Timon Rapp -Timothée Ravier -Tim Parenti -Tim Ringenbach -Tim Taubert -tinaun -Tincan -Ting-Yu Lin -Titouan Vervack -Tobba -Tobias Bucher -Toby Scrace -Tohava -Tomas Sedovic -Tom Chittenden -Tom Jakubowski -Tom Lee -Tommy M. McGuire -Tomoki Aonuma -Toni Cárdenas -Tony Young -Torsten Weber -Travis Watkins -Trent Nadeau -Trent Ogren -Trinick -Tristan Storch -tshakah -Tshepang Lekhonkhobe -Tuncer Ayaz -Tycho Sci -Tyler Bindon -Tyler Thrailkill -tynopex -Ty Overby -Ulrik Sverdrup -Ulysse Carion -U-NOV2010\eugals -User Jyyou -Utkarsh Kukreti -Uwe Dauernheim -Vadim Chugunov -Vadim Petrochenkov -Valentin Tsatskin -Valerii Hiora -Viacheslav Chimishuk -Victor Berger -Victor van den Elzen -Victory -Vijay Korapaty -Viktor Dahl -ville-h -Vincent Belliard -Vincent Bernat -Vinzent Steinberg -Virgile Andreani -visualfc -Vitali Haravy -Vivek Galatage -Vladimir Matveev -Vladimir Pouzanov -Vladimir Rutsky -Vladimir Smola -Vojtech Kral -Volker Mische -w00ns -Wade Mealing -Wangshan Lu -WebeWizard -webmobster -Wei-Ming Yang -Wendell Smith -Wesley Wiser -whataloadofwhat -wickerwaka -Wilfred Hughes -Will Andrews -Will Engler -Will Hipschman -William Throwe -William Ting -Willson Mock -Will Speak -Will -Willy Aguirre -Without Boats -Wojciech Ogrodowczyk -wonyong kim -xales -Xavier Shay -xd1le -Xiao Chuan Yu -Xuefeng Wu -XuefengWu -Xuefeng Wu -Xue Fuqiao -Yasuhiro Fujii -YawarRaza7349 -Yazhong Liu -Yehuda Katz -Yongqian Li -York Xiang -Yoshito Komatsu -Young-il Choi -Youngmin Yoo -Youngsoo Son -Young Wu -Yuri Albuquerque -Yuri Kunde Schlesner -Z1 -Zach Kamsler -Zach Pomerantz -Zack Corr -Zack Slayton -Zbigniew Siciarz -Ziad Hatahet -zofrex -Zooko Wilcox-O'Hearn -克雷 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 515e6e18f7..a11e9a7d68 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -34,6 +34,9 @@ While bugs are unfortunate, they're a reality in software. We can't fix what we don't know about, so please report liberally. If you're not sure if something is a bug or not, feel free to file a bug anyway. +**If you believe reporting your bug publicly represents a security risk to Rust users, +please follow our [instructions for reporting security vulnerabilities](https://www.rust-lang.org/security.html)**. + If you have the chance, before reporting a bug, please [search existing issues](https://github.com/rust-lang/rust/search?q=&type=Issues&utf8=%E2%9C%93), as it's possible that someone else has already reported your error. This doesn't diff --git a/README.md b/README.md index acd9cb6afc..8eb742f0a2 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ # The Rust Programming Language -Rust is a fast systems programming language that guarantees -memory safety and offers painless concurrency ([no data races]). -It does not employ a garbage collector and has minimal runtime overhead. +This is the main source code repository for [Rust]. It contains the compiler, standard library, +and documentation. -This repo contains the code for the compiler (`rustc`), as well -as standard libraries, tools and documentation for Rust. - -[no data races]: http://blog.rust-lang.org/2015/04/10/Fearless-Concurrency.html +[Rust]: https://www.rust-lang.org ## Quick Start @@ -68,7 +64,8 @@ Read ["Installing Rust"] from [The Book]. # Update package mirrors (may be needed if you have a fresh install of MSYS2) $ pacman -Sy pacman-mirrors - # Choose one based on platform: + # Choose one based on platform: + # *** see the note below *** $ pacman -S mingw-w64-i686-toolchain $ pacman -S mingw-w64-x86_64-toolchain @@ -89,9 +86,12 @@ Read ["Installing Rust"] from [The Book]. ``` > ***Note:*** gcc versions >= 5 currently have issues building LLVM on Windows > resulting in a segmentation fault when building Rust. In order to avoid this -> it may be necessary to obtain an earlier version of gcc such as 4.9.x. -> Installers for earlier Windows builds of gcc are available at the -> [Mingw-Builds] project. For more information on this see issue #28260. +> it may be necessary to obtain an earlier version of gcc such as 4.9.x. +> Msys's `pacman` will install the latest version, so for the time being it is +> recommended to skip gcc toolchain installation step above and use [Mingw-Builds] +> project's installer instead. Be sure to add gcc `bin` directory to the path +> before running `configure`. +> For more information on this see issue #28260. [Mingw-Builds]: http://sourceforge.net/projects/mingw-w64/ diff --git a/RELEASES.md b/RELEASES.md index f867943133..ee08ea5a44 100644 --- a/RELEASES.md +++ b/RELEASES.md @@ -1,3 +1,156 @@ +Version 1.6.0 (2016-01-21) +========================== + +Language +-------- + +* The `#![no_std]` attribute causes a crate to not be linked to the + standard library, but only the [core library][1.6co], as described + in [RFC 1184]. The core library defines common types and traits but + has no platform dependencies whatsoever, and is the basis for Rust + software in environments that cannot support a full port of the + standard library, such as operating systems. Most of the core + library is now stable. + +Libraries +--------- + +* Stabilized APIs: + [`Read::read_exact`], [`ErrorKind::UnexpectedEof`] (renamed from + `UnexpectedEOF`), [`fs::DirBuilder`], [`fs::DirBuilder::new`], + [`fs::DirBuilder::recursive`], [`fs::DirBuilder::create`], + [`os::unix::fs::DirBuilderExt`], + [`os::unix::fs::DirBuilderExt::mode`], [`vec::Drain`], + [`vec::Vec::drain`], [`string::Drain`], [`string::String::drain`], + [`vec_deque::Drain`], [`vec_deque::VecDeque::drain`], + [`collections::hash_map::Drain`], + [`collections::hash_map::HashMap::drain`], + [`collections::hash_set::Drain`], + [`collections::hash_set::HashSet::drain`], + [`collections::binary_heap::Drain`], + [`collections::binary_heap::BinaryHeap::drain`], + [`Vec::extend_from_slice`] (renamed from `push_all`), + [`Mutex::get_mut`], [`Mutex::into_inner`], [`RwLock::get_mut`], + [`RwLock::into_inner`], [`Iterator::min_by_key`] (renamed from + `min_by`), [`Iterator::max_by_key`] (renamed from `max_by`). +* The [core library][1.6co] is stable, as are most of its APIs. +* [The `assert_eq!` macro supports arguments that don't implement + `Sized`][1.6ae], such as arrays. In this way it behaves more like + `assert!`. +* Several timer functions that take duration in milliseconds [are + deprecated in favor of those that take `Duration`][1.6ms]. These + include `Condvar::wait_timeout_ms`, `thread::sleep_ms`, and + `thread_park_timeout_ms`. +* The algorithm by which `Vec` reserves additional elements was + [tweaked to not allocate excessive space][1.6a] while still growing + exponentially. +* `From` conversions are [implemented from integers to floats][1.6f] + in cases where the conversion is lossless. Thus they are not + implemented for 32-bit ints to `f32`, nor for 64-bit ints to `f32` + or `f64`. They are also not implemented for `isize` and `usize` + because the implementations would be platform-specific. `From` is + also implemented from `f32` to `f64`. +* `From<&Path>` and `From` are implemented for `Cow`. +* `From` is implemented for `Box`, `Rc` and `Arc`. +* `IntoIterator` is implemented for `&PathBuf` and `&Path`. +* [`BinaryHeap` was refactored][1.6bh] for modest performance + improvements. +* Sorting slices that are already sorted [is 50% faster in some + cases][1.6s]. + +Cargo +----- + +* Cargo will look in `$CARGO_HOME/bin` for subcommands [by default][1.6c]. +* Cargo build scripts can specify their dependencies by emitting the + [`rerun-if-changed`][1.6rr] key. +* crates.io will reject publication of crates with dependencies that + have a wildcard version constraint. Crates with wildcard + dependencies were seen to cause a variety of problems, as described + in [RFC 1241]. Disallowing them will create more predictable + development experience and a more stable ecosystem. Since 1.5 + publication of such crates has emitted a warning. +* `cargo clean` [accepts a `--release` flag][1.6cc] to clean the + release folder. A variety of artifacts that Cargo failed to clean + are now correctly deleted. + +Misc +---- + +* The `unreachable_code` lint [warns when a function call's argument + diverges][1.6dv]. +* The parser indicates [failures that may be caused by + confusingly-similar Unicode characters][1.6uc] +* Certain macro errors [are reported at definition time][1.6m], not + expansion. + +Compatibility Notes +------------------- + +* The compiler no longer makes use of the [`RUST_PATH`][1.6rp] + environment variable when locating crates. This was a pre-cargo + feature for integrating with the package manager that was + accidentally never removed. +* [A number of bugs were fixed in the privacy checker][1.6p] that + could cause previously-accepted code to break. +* [Modules and unit/tuple structs may not share the same name][1.6ts]. +* [Bugs in pattern matching unit structs were fixed][1.6us]: the tuple + struct pattern syntax (`Foo(..)`) no longer can be used with unit + structs; patterns that share the same name as a const are now an + error. +* A bug was fixed that causes [rustc not to apply default type + parameters][1.6xc] when resolving certain method implementations of + traits defined in other crates. + +[1.6a]: https://github.com/rust-lang/rust/pull/29454 +[1.6ae]: https://github.com/rust-lang/rust/pull/29770 +[1.6bh]: https://github.com/rust-lang/rust/pull/29811 +[1.6c]: https://github.com/rust-lang/cargo/pull/2192 +[1.6cc]: https://github.com/rust-lang/cargo/pull/2131 +[1.6co]: http://doc.rust-lang.org/beta/core/index.html +[1.6dv]: https://github.com/rust-lang/rust/pull/30000 +[1.6f]: https://github.com/rust-lang/rust/pull/29129 +[1.6m]: https://github.com/rust-lang/rust/pull/29828 +[1.6ms]: https://github.com/rust-lang/rust/pull/29604 +[1.6p]: https://github.com/rust-lang/rust/pull/29726 +[1.6rp]: https://github.com/rust-lang/rust/pull/30034 +[1.6rr]: https://github.com/rust-lang/cargo/pull/2134 +[1.6s]: https://github.com/rust-lang/rust/pull/29675 +[1.6ts]: https://github.com/rust-lang/rust/issues/21546 +[1.6uc]: https://github.com/rust-lang/rust/pull/29837 +[1.6us]: https://github.com/rust-lang/rust/pull/29383 +[1.6xc]: https://github.com/rust-lang/rust/issues/30123 +[RFC 1184]: https://github.com/rust-lang/rfcs/blob/master/text/1184-stabilize-no_std.md +[RFC 1241]: https://github.com/rust-lang/rfcs/blob/master/text/1241-no-wildcard-deps.md +[`ErrorKind::UnexpectedEof`]: http://doc.rust-lang.org/nightly/std/io/enum.ErrorKind.html#variant.UnexpectedEof +[`Iterator::max_by_key`]: http://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.max_by_key +[`Iterator::min_by_key`]: http://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.min_by_key +[`Mutex::get_mut`]: http://doc.rust-lang.org/nightly/std/sync/struct.Mutex.html#method.get_mut +[`Mutex::into_inner`]: http://doc.rust-lang.org/nightly/std/sync/struct.Mutex.html#method.into_inner +[`Read::read_exact`]: http://doc.rust-lang.org/nightly/std/io/trait.Read.html#method.read_exact +[`RwLock::get_mut`]: http://doc.rust-lang.org/nightly/std/sync/struct.RwLock.html#method.get_mut +[`RwLock::into_inner`]: http://doc.rust-lang.org/nightly/std/sync/struct.RwLock.html#method.into_inner +[`Vec::extend_from_slice`]: http://doc.rust-lang.org/nightly/collections/vec/struct.Vec.html#method.extend_from_slice +[`collections::binary_heap::BinaryHeap::drain`]: http://doc.rust-lang.org/nightly/std/collections/binary_heap/struct.BinaryHeap.html#method.drain +[`collections::binary_heap::Drain`]: http://doc.rust-lang.org/nightly/std/collections/binary_heap/struct.Drain.html +[`collections::hash_map::Drain`]: http://doc.rust-lang.org/nightly/std/collections/hash_map/struct.Drain.html +[`collections::hash_map::HashMap::drain`]: http://doc.rust-lang.org/nightly/std/collections/hash_map/struct.HashMap.html#method.drain +[`collections::hash_set::Drain`]: http://doc.rust-lang.org/nightly/std/collections/hash_set/struct.Drain.html +[`collections::hash_set::HashSet::drain`]: http://doc.rust-lang.org/nightly/std/collections/hash_set/struct.HashSet.html#method.drain +[`fs::DirBuilder::create`]: http://doc.rust-lang.org/nightly/std/fs/struct.DirBuilder.html#method.create +[`fs::DirBuilder::new`]: http://doc.rust-lang.org/nightly/std/fs/struct.DirBuilder.html#method.new +[`fs::DirBuilder::recursive`]: http://doc.rust-lang.org/nightly/std/fs/struct.DirBuilder.html#method.recursive +[`fs::DirBuilder`]: http://doc.rust-lang.org/nightly/std/fs/struct.DirBuilder.html +[`os::unix::fs::DirBuilderExt::mode`]: http://doc.rust-lang.org/nightly/std/os/unix/fs/trait.DirBuilderExt.html#tymethod.mode +[`os::unix::fs::DirBuilderExt`]: http://doc.rust-lang.org/nightly/std/os/unix/fs/trait.DirBuilderExt.html +[`string::Drain`]: http://doc.rust-lang.org/nightly/std/string/struct.Drain.html +[`string::String::drain`]: http://doc.rust-lang.org/nightly/std/string/struct.String.html#method.drain +[`vec::Drain`]: http://doc.rust-lang.org/nightly/std/vec/struct.Drain.html +[`vec::Vec::drain`]: http://doc.rust-lang.org/nightly/std/vec/struct.Vec.html#method.drain +[`vec_deque::Drain`]: http://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.Drain.html +[`vec_deque::VecDeque::drain`]: http://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.VecDeque.html#method.drain + + Version 1.5.0 (2015-12-10) ========================== diff --git a/configure b/configure index 60d366100f..c505af5c4d 100755 --- a/configure +++ b/configure @@ -541,6 +541,16 @@ CFG_BUILD_DIR="$(pwd)/" CFG_SELF="$0" CFG_CONFIGURE_ARGS="$@" + +case "${CFG_SRC_DIR}" in + *\ * ) + err "The path to the rust source directory contains spaces, which is not supported" + ;; + *) + ;; +esac + + OPTIONS="" HELP=0 if [ "$1" = "--help" ] @@ -632,18 +642,9 @@ putvar CFG_BUILD # Yes, this creates a duplicate entry, but the last one wins. CFG_HOST=$(to_llvm_triple $CFG_HOST) CFG_TARGET=$(to_llvm_triple $CFG_TARGET) -# On windows we just store the libraries in the bin directory because -# there's no rpath. This is where the build system itself puts libraries; -# --libdir is used to configure the installation directory. -# FIXME: This needs to parameterized over target triples. Do it in platform.mk -if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ] -then - CFG_LIBDIR_RELATIVE=bin -else - CFG_LIBDIR_RELATIVE=lib -fi - -valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (do not set it on windows platform)" +# On Windows this determines root of the subtree for target libraries. +# Host runtime libs always go to 'bin'. +valopt libdir "${CFG_PREFIX}/lib" "install libraries" case "$CFG_LIBDIR" in "$CFG_PREFIX"/*) CAT_INC=2;; @@ -654,11 +655,6 @@ esac CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-` -if ( [ "$CFG_OSTYPE" = "pc-windows-gnu" ] || [ "$CFG_OSTYPE" = "pc-windows-msvc" ] ) \ - && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then - err "libdir on windows should be set to 'bin'" -fi - if [ $HELP -eq 1 ] then echo @@ -1067,12 +1063,13 @@ fi # point in the script; after this point, script logic should inspect # $CFG_USING_CLANG rather than $CFG_ENABLE_CLANG. -# Set CFG_{CC,CXX,CPP,CFLAGS,CXXFLAGS} +# Set CFG_{CC,CXX,CPP,CFLAGS,CXXFLAGS,LDFLAGS} envopt CC envopt CXX envopt CPP envopt CFLAGS envopt CXXFLAGS +envopt LDFLAGS # stdc++ name in use # used to manage non-standard name (on OpenBSD for example) @@ -1498,25 +1495,9 @@ do done fi - if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ] + # We need the generator later on for compiler-rt even if LLVM's not built + if [ ${is_msvc} -ne 0 ] then - msg "configuring LLVM for $t with cmake" - - CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF" - if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug" - else - CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release" - fi - if [ -z "$CFG_ENABLE_LLVM_ASSERTIONS" ] - then - CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=OFF" - else - CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=ON" - fi - - msg "configuring LLVM with:" - msg "$CMAKE_ARGS" case "$CFG_MSVC_ROOT" in *14.0*) generator="Visual Studio 14 2015" @@ -1538,8 +1519,32 @@ do err "can only build LLVM for x86 platforms" ;; esac + CFG_CMAKE_GENERATOR=$generator + putvar CFG_CMAKE_GENERATOR + fi + + if [ ${do_reconfigure} -ne 0 ] && [ ${is_msvc} -ne 0 ] + then + msg "configuring LLVM for $t with cmake" + + CMAKE_ARGS="-DLLVM_INCLUDE_TESTS=OFF" + if [ -n "$CFG_DISABLE_OPTIMIZE_LLVM" ]; then + CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Debug" + else + CMAKE_ARGS="$CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release" + fi + if [ -z "$CFG_ENABLE_LLVM_ASSERTIONS" ] + then + CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=OFF" + else + CMAKE_ARGS="$CMAKE_ARGS -DLLVM_ENABLE_ASSERTIONS=ON" + fi + + msg "configuring LLVM with:" + msg "$CMAKE_ARGS" + (cd $LLVM_BUILD_DIR && "$CFG_CMAKE" $CFG_LLVM_SRC_DIR \ - -G "$generator" \ + -G "$CFG_CMAKE_GENERATOR" \ $CMAKE_ARGS) need_ok "LLVM cmake configure failed" fi @@ -1673,9 +1678,9 @@ do CXX=$LLVM_CXX CC=$LLVM_CC - CFLAGS=$LLVM_CFLAGS - CXXFLAGS=$LLVM_CXXFLAGS - LDFLAGS=$LLVM_LDFLAGS + CFLAGS="$CFLAGS $LLVM_CFLAGS" + CXXFLAGS="$CXXFLAGS $LLVM_CXXFLAGS" + LDFLAGS="$LDFLAGS $LLVM_LDFLAGS" if [ -z "$CFG_DISABLE_LIBCPP" ] && [ -n "$CFG_USING_CLANG" ]; then LLVM_OPTS="$LLVM_OPTS --enable-libcpp" diff --git a/man/rustc.1 b/man/rustc.1 index 56e3fe0515..f383f51052 100644 --- a/man/rustc.1 +++ b/man/rustc.1 @@ -52,10 +52,11 @@ Comma separated list of types of crates for the compiler to emit. \fB\-\-crate\-name\fR \fINAME\fR Specify the name of the crate being built. .TP -\fB\-\-emit\fR [asm|llvm\-bc|llvm\-ir|obj|link|dep\-info] -Configure the output that \fBrustc\fR will produce. Each option may also be of -the form KIND=PATH to specify the explicit output location for that particular -emission kind. +\fB\-\-emit\fR [asm|llvm\-bc|llvm\-ir|obj|link|dep\-info][=\fIPATH\fR] +Configure the output that \fBrustc\fR will produce. + +Each emission may also have an optional explicit output \fIPATH\fR specified for that particular +emission kind. This path takes precedence over the \fB-o\fR option. .TP \fB\-\-print\fR [crate\-name|file\-names|sysroot] Comma separated list of compiler information to print on stdout. diff --git a/mk/cfg/i686-pc-windows-gnu.mk b/mk/cfg/i686-pc-windows-gnu.mk index 174671a9a8..3426b30aee 100644 --- a/mk/cfg/i686-pc-windows-gnu.mk +++ b/mk/cfg/i686-pc-windows-gnu.mk @@ -22,3 +22,6 @@ CFG_LDPATH_i686-pc-windows-gnu := CFG_RUN_i686-pc-windows-gnu=$(2) CFG_RUN_TARG_i686-pc-windows-gnu=$(call CFG_RUN_i686-pc-windows-gnu,,$(2)) CFG_GNU_TRIPLE_i686-pc-windows-gnu := i686-w64-mingw32 +CFG_THIRD_PARTY_OBJECTS_i686-pc-windows-gnu := crt2.o dllcrt2.o +CFG_INSTALLED_OBJECTS_i686-pc-windows-gnu := crt2.o dllcrt2.o rsbegin.o rsend.o +CFG_RUSTRT_HAS_STARTUP_OBJS_i686-pc-windows-gnu := 1 diff --git a/mk/cfg/x86_64-pc-windows-gnu.mk b/mk/cfg/x86_64-pc-windows-gnu.mk index 4118ea26c0..f0732d08c7 100644 --- a/mk/cfg/x86_64-pc-windows-gnu.mk +++ b/mk/cfg/x86_64-pc-windows-gnu.mk @@ -22,3 +22,6 @@ CFG_LDPATH_x86_64-pc-windows-gnu := CFG_RUN_x86_64-pc-windows-gnu=$(2) CFG_RUN_TARG_x86_64-pc-windows-gnu=$(call CFG_RUN_x86_64-pc-windows-gnu,,$(2)) CFG_GNU_TRIPLE_x86_64-pc-windows-gnu := x86_64-w64-mingw32 +CFG_THIRD_PARTY_OBJECTS_x86_64-pc-windows-gnu := crt2.o dllcrt2.o +CFG_INSTALLED_OBJECTS_x86_64-pc-windows-gnu := crt2.o dllcrt2.o rsbegin.o rsend.o +CFG_RUSTRT_HAS_STARTUP_OBJS_x86_64-pc-windows-gnu := 1 diff --git a/mk/cfg/x86_64-unknown-linux-musl.mk b/mk/cfg/x86_64-unknown-linux-musl.mk index 960dabdcf9..9d6dd5c73d 100644 --- a/mk/cfg/x86_64-unknown-linux-musl.mk +++ b/mk/cfg/x86_64-unknown-linux-musl.mk @@ -21,8 +21,8 @@ CFG_LDPATH_x86_64-unknown-linux-musl := CFG_RUN_x86_64-unknown-linux-musl=$(2) CFG_RUN_TARG_x86_64-unknown-linux-musl=$(call CFG_RUN_x86_64-unknown-linux-musl,,$(2)) CFG_GNU_TRIPLE_x86_64-unknown-linux-musl := x86_64-unknown-linux-musl +CFG_THIRD_PARTY_OBJECTS_x86_64-unknown-linux-musl := crt1.o crti.o crtn.o +CFG_INSTALLED_OBJECTS_x86_64-unknown-linux-musl := crt1.o crti.o crtn.o NATIVE_DEPS_libc_T_x86_64-unknown-linux-musl += libc.a -NATIVE_DEPS_std_T_x86_64-unknown-linux-musl += libunwind.a \ - crt1.o crti.o crtn.o -INSTALLED_OBJECTS_x86_64-unknown-linux-musl += crt1.o crti.o crtn.o +NATIVE_DEPS_std_T_x86_64-unknown-linux-musl += libunwind.a crt1.o crti.o crtn.o diff --git a/mk/clean.mk b/mk/clean.mk index bb79e2186a..ac34ac506b 100644 --- a/mk/clean.mk +++ b/mk/clean.mk @@ -65,7 +65,8 @@ clean-generic-$(2)-$(1): -name '*.def' -o \ -name '*.py' -o \ -name '*.pyc' -o \ - -name '*.bc' \ + -name '*.bc' -o \ + -name '*.rs' \ \) \ | xargs rm -f $(Q)find $(1) \ diff --git a/mk/crates.mk b/mk/crates.mk index 6673b9b28e..8ce0a41d97 100644 --- a/mk/crates.mk +++ b/mk/crates.mk @@ -56,7 +56,8 @@ TARGET_CRATES := libc std flate arena term \ alloc_system RUSTC_CRATES := rustc rustc_typeck rustc_mir rustc_borrowck rustc_resolve rustc_driver \ rustc_trans rustc_back rustc_llvm rustc_privacy rustc_lint \ - rustc_data_structures rustc_front rustc_platform_intrinsics + rustc_data_structures rustc_front rustc_platform_intrinsics \ + rustc_plugin rustc_metadata HOST_CRATES := syntax $(RUSTC_CRATES) rustdoc fmt_macros TOOLS := compiletest rustdoc rustc rustbook error-index-generator @@ -87,23 +88,25 @@ DEPS_test := std getopts serialize rbml term native:rust_test_helpers DEPS_syntax := std term serialize log fmt_macros arena libc rustc_bitflags -DEPS_rustc := syntax flate arena serialize getopts rbml rustc_front\ +DEPS_rustc := syntax flate arena serialize getopts rustc_front\ log graphviz rustc_llvm rustc_back rustc_data_structures DEPS_rustc_back := std syntax rustc_llvm rustc_front flate log libc DEPS_rustc_borrowck := rustc rustc_front log graphviz syntax DEPS_rustc_data_structures := std log serialize DEPS_rustc_driver := arena flate getopts graphviz libc rustc rustc_back rustc_borrowck \ rustc_typeck rustc_mir rustc_resolve log syntax serialize rustc_llvm \ - rustc_trans rustc_privacy rustc_lint rustc_front - + rustc_trans rustc_privacy rustc_lint rustc_front rustc_plugin \ + rustc_metadata DEPS_rustc_front := std syntax log serialize DEPS_rustc_lint := rustc log syntax DEPS_rustc_llvm := native:rustllvm libc std rustc_bitflags +DEPS_rustc_metadata := rustc rustc_front syntax rbml DEPS_rustc_mir := rustc rustc_front syntax DEPS_rustc_resolve := rustc rustc_front log syntax DEPS_rustc_platform_intrinsics := rustc rustc_llvm +DEPS_rustc_plugin := rustc rustc_metadata syntax DEPS_rustc_privacy := rustc rustc_front log syntax -DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back \ +DEPS_rustc_trans := arena flate getopts graphviz libc rustc rustc_back rustc_mir \ log syntax serialize rustc_llvm rustc_front rustc_platform_intrinsics DEPS_rustc_typeck := rustc syntax rustc_front rustc_platform_intrinsics @@ -174,3 +177,6 @@ $(foreach crate,$(TOOLS),$(eval $(call RUST_TOOL,$(crate)))) ifdef CFG_DISABLE_ELF_TLS RUSTFLAGS_std := --cfg no_elf_tls endif + +CRATEFILE_libc := $(SREL)src/liblibc/src/lib.rs +RUSTFLAGS_libc := --cfg stdbuild diff --git a/mk/dist.mk b/mk/dist.mk index 4cdee8bda9..685fb2b5b4 100644 --- a/mk/dist.mk +++ b/mk/dist.mk @@ -42,7 +42,6 @@ PKG_FILES := \ $(S)COPYRIGHT \ $(S)LICENSE-APACHE \ $(S)LICENSE-MIT \ - $(S)AUTHORS.txt \ $(S)CONTRIBUTING.md \ $(S)README.md \ $(S)RELEASES.md \ @@ -59,6 +58,7 @@ PKG_FILES := \ libcoretest \ libbacktrace \ rt \ + rtstartup \ rustllvm \ snapshots.txt \ rust-installer \ diff --git a/mk/docs.mk b/mk/docs.mk index 644fbde323..f76368e3d0 100644 --- a/mk/docs.mk +++ b/mk/docs.mk @@ -22,14 +22,14 @@ # L10N_LANGS are the languages for which the docs have been # translated. ###################################################################### -DOCS := index intro tutorial \ +DOCS := index \ complement-lang-faq complement-design-faq complement-project-faq \ rustdoc reference grammar # Legacy guides, preserved for a while to reduce the number of 404s DOCS += guide-crates guide-error-handling guide-ffi guide-macros guide \ guide-ownership guide-plugins guide-pointers guide-strings guide-tasks \ - guide-testing + guide-testing tutorial intro RUSTDOC_DEPS_reference := doc/full-toc.inc @@ -65,7 +65,7 @@ ERR_IDX_GEN = $(RPATH_VAR2_T_$(CFG_BUILD)_H_$(CFG_BUILD)) $(ERR_IDX_GEN_EXE) D := $(S)src/doc -DOC_TARGETS := trpl nomicon style error-index +DOC_TARGETS := book nomicon style error-index COMPILER_DOC_TARGETS := DOC_L10N_TARGETS := @@ -194,12 +194,12 @@ docs: $(DOC_TARGETS) doc: docs compiler-docs: $(COMPILER_DOC_TARGETS) -trpl: doc/book/index.html +book: doc/book/index.html -doc/book/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/trpl/*.md) | doc/ +doc/book/index.html: $(RUSTBOOK_EXE) $(wildcard $(S)/src/doc/book/*.md) | doc/ @$(call E, rustbook: $@) $(Q)rm -rf doc/book - $(Q)$(RUSTBOOK) build $(S)src/doc/trpl doc/book + $(Q)$(RUSTBOOK) build $(S)src/doc/book doc/book nomicon: doc/nomicon/index.html diff --git a/mk/install.mk b/mk/install.mk index 8b8170220c..af6f3ff6ad 100644 --- a/mk/install.mk +++ b/mk/install.mk @@ -8,7 +8,7 @@ # option. This file may not be copied, modified, or distributed # except according to those terms. -RUN_INSALLER = cd tmp/empty_dir && \ +RUN_INSTALLER = cd tmp/empty_dir && \ sh ../../tmp/dist/$(1)/install.sh \ --prefix="$(DESTDIR)$(CFG_PREFIX)" \ --libdir="$(DESTDIR)$(CFG_LIBDIR)" \ @@ -22,11 +22,11 @@ else $(Q)$(MAKE) prepare_install endif ifeq ($(CFG_DISABLE_DOCS),) - $(Q)$(call RUN_INSALLER,$(DOC_PKG_NAME)-$(CFG_BUILD)) --disable-ldconfig + $(Q)$(call RUN_INSTALLER,$(DOC_PKG_NAME)-$(CFG_BUILD)) --disable-ldconfig endif $(Q)$(foreach target,$(CFG_TARGET),\ - ($(call RUN_INSALLER,$(STD_PKG_NAME)-$(target)) --disable-ldconfig);) - $(Q)$(call RUN_INSALLER,$(PKG_NAME)-$(CFG_BUILD)) + ($(call RUN_INSTALLER,$(STD_PKG_NAME)-$(target)) --disable-ldconfig);) + $(Q)$(call RUN_INSTALLER,$(PKG_NAME)-$(CFG_BUILD)) # Remove tmp files because it's a decent amount of disk space $(Q)rm -R tmp/dist @@ -40,11 +40,11 @@ else $(Q)$(MAKE) prepare_uninstall endif ifeq ($(CFG_DISABLE_DOCS),) - $(Q)$(call RUN_INSALLER,$(DOC_PKG_NAME)-$(CFG_BUILD)) --uninstall + $(Q)$(call RUN_INSTALLER,$(DOC_PKG_NAME)-$(CFG_BUILD)) --uninstall endif - $(Q)$(call RUN_INSALLER,$(PKG_NAME)-$(CFG_BUILD)) --uninstall + $(Q)$(call RUN_INSTALLER,$(PKG_NAME)-$(CFG_BUILD)) --uninstall $(Q)$(foreach target,$(CFG_TARGET),\ - ($(call RUN_INSALLER,$(STD_PKG_NAME)-$(target)) --uninstall);) + ($(call RUN_INSTALLER,$(STD_PKG_NAME)-$(target)) --uninstall);) # Remove tmp files because it's a decent amount of disk space $(Q)rm -R tmp/dist diff --git a/mk/llvm.mk b/mk/llvm.mk index 1cbf4a9fb8..b2a90f583f 100644 --- a/mk/llvm.mk +++ b/mk/llvm.mk @@ -64,10 +64,10 @@ $$(LLVM_AR_$(1)): $$(LLVM_CONFIG_$(1)) # when we changed something not otherwise captured by builtin # dependencies. In these cases, commit a change that touches # the stamp in the source dir. -$$(LLVM_STAMP_$(1)): $(S)src/rustllvm/llvm-auto-clean-trigger +$$(LLVM_STAMP_$(1)): $$(S)src/rustllvm/llvm-auto-clean-trigger @$$(call E, make: cleaning llvm) - $(Q)touch $$@.start_time - $(Q)$(MAKE) clean-llvm$(1) + $$(Q)touch $$@.start_time + $$(Q)$$(MAKE) clean-llvm$(1) @$$(call E, make: done cleaning llvm) touch -r $$@.start_time $$@ && rm $$@.start_time diff --git a/mk/main.mk b/mk/main.mk index 34f8247966..7108824b49 100644 --- a/mk/main.mk +++ b/mk/main.mk @@ -13,12 +13,12 @@ ###################################################################### # The version number -CFG_RELEASE_NUM=1.5.0 +CFG_RELEASE_NUM=1.6.0 # An optional number to put after the label, e.g. '.2' -> '-beta.2' # NB Make sure it starts with a dot to conform to semver pre-release # versions (section 9) -CFG_PRERELEASE_VERSION=.5 +CFG_PRERELEASE_VERSION=.4 # Append a version-dependent hash to each library, so we can install different # versions in the same place @@ -111,8 +111,7 @@ CFG_RUSTC_FLAGS := $(RUSTFLAGS) CFG_GCCISH_CFLAGS := CFG_GCCISH_LINK_FLAGS := -# Turn off broken quarantine (see jemalloc/jemalloc#161) -CFG_JEMALLOC_FLAGS := --disable-fill +CFG_JEMALLOC_FLAGS := ifdef CFG_DISABLE_OPTIMIZE $(info cfg: disabling rustc optimization (CFG_DISABLE_OPTIMIZE)) @@ -184,7 +183,7 @@ include $(CFG_SRC_DIR)mk/platform.mk # Run the stage1/2 compilers under valgrind ifdef VALGRIND_COMPILE - CFG_VALGRIND_COMPILE :=$(CFG_VALGRIND) + CFG_VALGRIND_COMPILE := $(CFG_VALGRIND) else CFG_VALGRIND_COMPILE := endif @@ -202,6 +201,7 @@ endif ifdef CFG_ENABLE_VALGRIND $(info cfg: enabling valgrind (CFG_ENABLE_VALGRIND)) + CFG_JEMALLOC_FLAGS += --enable-valgrind else CFG_VALGRIND := endif @@ -276,7 +276,6 @@ endif # LLVM macros ###################################################################### -# FIXME: x86-ism LLVM_COMPONENTS=x86 arm aarch64 mips powerpc ipo bitreader bitwriter linker asmparser mcjit \ interpreter instrumentation @@ -376,18 +375,30 @@ define SREQ # Destinations of artifacts for the host compiler HROOT$(1)_H_$(3) = $(3)/stage$(1) HBIN$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/bin + ifeq ($$(CFG_WINDOWSY_$(3)),1) -HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) +# On Windows we always store host runtime libraries in the 'bin' directory because +# there's no rpath. Target libraries go under $CFG_LIBDIR_RELATIVE (usually 'lib'). +HLIB_RELATIVE$(1)_H_$(3) = bin +TROOT$(1)_T_$(2)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE)/rustlib/$(2) +# Remove the next 3 lines after a snapshot +ifeq ($(1),0) +RUSTFLAGS_STAGE0 += -L $$(TROOT$(1)_T_$(2)_H_$(3))/lib +endif + else + ifeq ($(1),0) -HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/lib +HLIB_RELATIVE$(1)_H_$(3) = lib else -HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(CFG_LIBDIR_RELATIVE) +HLIB_RELATIVE$(1)_H_$(3) = $$(CFG_LIBDIR_RELATIVE) endif +TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) + endif +HLIB$(1)_H_$(3) = $$(HROOT$(1)_H_$(3))/$$(HLIB_RELATIVE$(1)_H_$(3)) # Destinations of artifacts for target architectures -TROOT$(1)_T_$(2)_H_$(3) = $$(HLIB$(1)_H_$(3))/rustlib/$(2) TBIN$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/bin TLIB$(1)_T_$(2)_H_$(3) = $$(TROOT$(1)_T_$(2)_H_$(3))/lib @@ -404,7 +415,7 @@ endif # Prerequisites for using the stageN compiler to build target artifacts TSREQ$(1)_T_$(2)_H_$(3) = \ $$(HSREQ$(1)_H_$(3)) \ - $$(foreach obj,$$(INSTALLED_OBJECTS_$(2)),\ + $$(foreach obj,$$(REQUIRED_OBJECTS_$(2)),\ $$(TLIB$(1)_T_$(2)_H_$(3))/$$(obj)) # Prerequisites for a working stageN compiler and libraries, for a specific diff --git a/mk/platform.mk b/mk/platform.mk index 856a22dc60..fd8416e8a6 100644 --- a/mk/platform.mk +++ b/mk/platform.mk @@ -14,7 +14,7 @@ # would create a variable HOST_i686-darwin-macos with the value # i386. define DEF_HOST_VAR - HOST_$(1) = $(subst i686,i386,$(word 1,$(subst -, ,$(1)))) + HOST_$(1) = $(patsubst i%86,i386,$(word 1,$(subst -, ,$(1)))) endef $(foreach t,$(CFG_TARGET),$(eval $(call DEF_HOST_VAR,$(t)))) $(foreach t,$(CFG_TARGET),$(info cfg: host for $(t) is $(HOST_$(t)))) @@ -113,7 +113,10 @@ CFG_RLIB_GLOB=lib$(1)-*.rlib include $(wildcard $(CFG_SRC_DIR)mk/cfg/*.mk) define ADD_INSTALLED_OBJECTS + INSTALLED_OBJECTS_$(1) += $$(CFG_INSTALLED_OBJECTS_$(1)) + REQUIRED_OBJECTS_$(1) += $$(CFG_THIRD_PARTY_OBJECTS_$(1)) INSTALLED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt) + REQUIRED_OBJECTS_$(1) += $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt) endef $(foreach target,$(CFG_TARGET), \ @@ -186,21 +189,25 @@ define CFG_MAKE_TOOLCHAIN endif CFG_COMPILE_C_$(1) = $$(CC_$(1)) \ + $$(CFLAGS) \ $$(CFG_GCCISH_CFLAGS) \ $$(CFG_GCCISH_CFLAGS_$(1)) \ -c $$(call CFG_CC_OUTPUT_$(1),$$(1)) $$(2) CFG_LINK_C_$(1) = $$(CC_$(1)) \ + $$(LDFLAGS) \ $$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \ $$(CFG_GCCISH_LINK_FLAGS_$(1)) \ $$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \ $$(call CFG_INSTALL_NAME_$(1),$$(4)) CFG_COMPILE_CXX_$(1) = $$(CXX_$(1)) \ + $$(CXXFLAGS) \ $$(CFG_GCCISH_CFLAGS) \ $$(CFG_GCCISH_CXXFLAGS) \ $$(CFG_GCCISH_CFLAGS_$(1)) \ $$(CFG_GCCISH_CXXFLAGS_$(1)) \ -c $$(call CFG_CC_OUTPUT_$(1),$$(1)) $$(2) CFG_LINK_CXX_$(1) = $$(CXX_$(1)) \ + $$(LDFLAGS) \ $$(CFG_GCCISH_LINK_FLAGS) -o $$(1) \ $$(CFG_GCCISH_LINK_FLAGS_$(1)) \ $$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \ @@ -211,9 +218,11 @@ define CFG_MAKE_TOOLCHAIN # On OpenBSD, we need to pass the path of libstdc++.so to the linker # (use path of libstdc++.a which is a known name for the same path) ifeq ($(OSTYPE_$(1)),unknown-openbsd) - RUSTC_FLAGS_$(1)=-L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \ - -print-file-name=lib$(CFG_STDCPP_NAME).a))" \ - $(RUSTC_FLAGS_$(1)) + STDCPP_LIBDIR_RUSTFLAGS_$(1)= \ + -L "$$(dir $$(shell $$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) \ + -print-file-name=lib$(CFG_STDCPP_NAME).a))" + else + STDCPP_LIBDIR_RUSTFLAGS_$(1)= endif # On Bitrig, we need the relocation model to be PIC for everything diff --git a/mk/prepare.mk b/mk/prepare.mk index e263a6d2e4..87a445000a 100644 --- a/mk/prepare.mk +++ b/mk/prepare.mk @@ -90,6 +90,8 @@ PREPARE_TOOLS = $(filter-out compiletest rustbook error-index-generator, $(TOOLS # $(3) is host # $(4) tag define DEF_PREPARE_HOST_TOOL +prepare-host-tool-$(1)-$(2)-$(3)-$(4): \ + PREPARE_SOURCE_BIN_DIR=$$(HBIN$(2)_H_$(3)) prepare-host-tool-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \ $$(foreach dep,$$(TOOL_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4)) \ $$(HBIN$(2)_H_$(3))/$(1)$$(X_$(3)) \ @@ -102,6 +104,11 @@ prepare-host-tool-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \ $$(call PREPARE_MAN,$(1).1),),) endef +# Libraries are compiled using the --libdir provided to configure, but +# we store them in the tarball using just "lib" so that the install +# script can then rewrite them back to the correct path. +PREPARE_TAR_LIB_DIR = $(patsubst $(CFG_LIBDIR_RELATIVE)%,lib%,$(1)) + # For host libraries only install dylibs, not rlibs since the host libs are only # used to support rustc and rustc uses dynamic linking # @@ -110,8 +117,10 @@ endef # $(3) is host # $(4) tag define DEF_PREPARE_HOST_LIB -prepare-host-lib-$(1)-$(2)-$(3)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR) -prepare-host-lib-$(1)-$(2)-$(3)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR) +prepare-host-lib-$(1)-$(2)-$(3)-$(4): \ + PREPARE_WORKING_SOURCE_LIB_DIR=$$(HLIB$(2)_H_$(3)) +prepare-host-lib-$(1)-$(2)-$(3)-$(4): \ + PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(call PREPARE_TAR_LIB_DIR,$$(HLIB_RELATIVE$(2)_H_$(3))) prepare-host-lib-$(1)-$(2)-$(3)-$(4): prepare-maybe-clean-$(4) \ $$(foreach dep,$$(RUST_DEPS_$(1)),prepare-host-lib-$$(dep)-$(2)-$(3)-$(4)) \ $$(HLIB$(2)_H_$(3))/stamp.$(1) \ @@ -129,10 +138,14 @@ endef # $(4) tag define DEF_PREPARE_TARGET_N # Rebind PREPARE_*_LIB_DIR to point to rustlib, then install the libs for the targets -prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_LIB_DIR)/rustlib/$(2)/lib -prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(2)/lib -prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_LIB_DIR)/rustlib/$(3)/bin -prepare-target-$(2)-host-$(3)-$(1)-$(4): PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(3)/bin +prepare-target-$(2)-host-$(3)-$(1)-$(4): \ + PREPARE_WORKING_SOURCE_LIB_DIR=$$(TLIB$(1)_T_$(2)_H_$(3)) +prepare-target-$(2)-host-$(3)-$(1)-$(4): \ + PREPARE_WORKING_DEST_LIB_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(2)/lib +prepare-target-$(2)-host-$(3)-$(1)-$(4): \ + PREPARE_SOURCE_BIN_DIR=$$(TBIN$(1)_T_$(2)_H_$(3)) +prepare-target-$(2)-host-$(3)-$(1)-$(4): \ + PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_LIB_DIR)/rustlib/$(3)/bin prepare-target-$(2)-host-$(3)-$(1)-$(4): prepare-maybe-clean-$(4) \ $$(foreach crate,$$(TARGET_CRATES), \ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate)) \ @@ -185,12 +198,9 @@ INSTALL_DEBUGGER_SCRIPT_COMMANDS=$(if $(findstring windows,$(1)),\ define DEF_PREPARE -prepare-base-$(1)-%: PREPARE_SOURCE_DIR=$$(PREPARE_HOST)/stage$$(PREPARE_STAGE) -prepare-base-$(1)-%: PREPARE_SOURCE_BIN_DIR=$$(PREPARE_SOURCE_DIR)/bin -prepare-base-$(1)-%: PREPARE_SOURCE_LIB_DIR=$$(PREPARE_SOURCE_DIR)/$$(CFG_LIBDIR_RELATIVE) prepare-base-$(1)-%: PREPARE_SOURCE_MAN_DIR=$$(S)/man prepare-base-$(1)-%: PREPARE_DEST_BIN_DIR=$$(PREPARE_DEST_DIR)/bin -prepare-base-$(1)-%: PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(CFG_LIBDIR_RELATIVE) +prepare-base-$(1)-%: PREPARE_DEST_LIB_DIR=$$(PREPARE_DEST_DIR)/$$(call PREPARE_TAR_LIB_DIR,$$(CFG_LIBDIR_RELATIVE)) prepare-base-$(1)-%: PREPARE_DEST_MAN_DIR=$$(PREPARE_DEST_DIR)/share/man/man1 prepare-base-$(1)-target: prepare-target-$(1) diff --git a/mk/rt.mk b/mk/rt.mk index 1f60aaed47..8433b588e6 100644 --- a/mk/rt.mk +++ b/mk/rt.mk @@ -216,22 +216,31 @@ COMPRT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt) COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1)) COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt -# Note that on MSVC-targeting builds we hardwire CC/AR to gcc/ar even though -# we're targeting MSVC. This is because although compiler-rt has a CMake build -# config I can't actually figure out how to use it, so I'm not sure how to use -# cl.exe to build the objects. Additionally, the compiler-rt library when built -# with gcc has the same ABI as cl.exe, so they're largely compatible -COMPRT_CC_$(1) := $$(CC_$(1)) -COMPRT_AR_$(1) := $$(AR_$(1)) -COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) ifeq ($$(findstring msvc,$(1)),msvc) -COMPRT_CC_$(1) := gcc -COMPRT_AR_$(1) := ar -ifeq ($$(findstring i686,$(1)),i686) -COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -m32 +$$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS) $$(LLVM_CONFIG_$(1)) + @$$(call E, cmake: compiler-rt) + $$(Q)cd "$$(COMPRT_BUILD_DIR_$(1))"; $$(CFG_CMAKE) "$(S)src/compiler-rt" \ + -DCMAKE_BUILD_TYPE=$$(LLVM_BUILD_CONFIG_MODE) \ + -DLLVM_CONFIG_PATH=$$(LLVM_CONFIG_$(1)) \ + -G"$$(CFG_CMAKE_GENERATOR)" + $$(Q)$$(CFG_CMAKE) --build "$$(COMPRT_BUILD_DIR_$(1))" \ + --target lib/builtins/builtins \ + --config $$(LLVM_BUILD_CONFIG_MODE) \ + -- //v:m //nologo + $$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/lib/windows/$$(LLVM_BUILD_CONFIG_MODE)/clang_rt.builtins-$$(HOST_$(1)).lib $$@ else -COMPRT_CFLAGS_$(1) := $$(CFG_GCCISH_CFLAGS_$(1)) -m64 -endif +COMPRT_CC_$(1) := $$(CC_$(1)) +COMPRT_AR_$(1) := $$(AR_$(1)) +# We chomp -Werror here because GCC warns about the type signature of +# builtins not matching its own and the build fails. It's a bit hacky, +# but what can we do, we're building libclang-rt using GCC ...... +COMPRT_CFLAGS_$(1) := $$(subst -Werror,,$$(CFG_GCCISH_CFLAGS_$(1))) -std=c99 + +# FreeBSD Clang's packaging is problematic; it doesn't copy unwind.h to +# the standard include directory. This should really be in our changes to +# compiler-rt, but we override the CFLAGS here so there isn't much choice +ifeq ($$(findstring freebsd,$(1)),freebsd) + COMPRT_CFLAGS_$(1) += -I/usr/include/c++/v1 endif $$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS) @@ -246,7 +255,7 @@ $$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS) TargetTriple=$(1) \ triple-builtins $$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/builtins/libcompiler_rt.a $$@ - +endif ################################################################################ # libbacktrace # @@ -343,6 +352,10 @@ endif # endif for darwin ifeq ($$(findstring musl,$(1)),musl) $$(RT_OUTPUT_DIR_$(1))/%: $$(CFG_MUSL_ROOT)/lib/% cp $$^ $$@ +else +# Ask gcc where it is +$$(RT_OUTPUT_DIR_$(1))/%: + cp $$(shell $$(CC_$(1)) -print-file-name=$$(@F)) $$@ endif endef diff --git a/mk/snap.mk b/mk/snap.mk index 86c89cf021..0b34f52b7e 100644 --- a/mk/snap.mk +++ b/mk/snap.mk @@ -18,8 +18,8 @@ snap-stage$(1)-H-$(2): $$(HSREQ$(1)_H_$(2)) endef $(foreach host,$(CFG_HOST), \ - $(eval $(foreach stage,1 2 3, \ - $(eval $(call DEF_SNAP_FOR_STAGE_H,$(stage),$(host)))))) + $(foreach stage,1 2 3, \ + $(eval $(call DEF_SNAP_FOR_STAGE_H,$(stage),$(host))))) snap-stage1: snap-stage1-H-$(CFG_BUILD) diff --git a/mk/target.mk b/mk/target.mk index d6fa55bf7f..f1b5f9e315 100644 --- a/mk/target.mk +++ b/mk/target.mk @@ -95,6 +95,7 @@ $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \ $$(RUSTFLAGS_$(4)) \ $$(RUSTFLAGS$(1)_$(4)) \ $$(RUSTFLAGS$(1)_$(4)_T_$(2)) \ + $$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) \ --out-dir $$(@D) \ -C extra-filename=-$$(CFG_FILENAME_EXTRA) \ $$< @@ -128,7 +129,37 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \ $$(TSREQ$(1)_T_$(2)_H_$(3)) \ | $$(TBIN$(1)_T_$(2)_H_$(3))/ @$$(call E, rustc: $$@) - $$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4) + $$(STAGE$(1)_T_$(2)_H_$(3)) \ + $$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) \ + -o $$@ $$< --cfg $(4) + +endef + +# Macro for building runtime startup/shutdown object files; +# these are Rust's equivalent of crti.o, crtn.o +# +# $(1) - stage +# $(2) - target triple +# $(3) - host triple +# $(4) - object basename +define TARGET_RUSTRT_STARTUP_OBJ + +$$(TLIB$(1)_T_$(2)_H_$(3))/$(4).o: \ + $(S)src/rtstartup/$(4).rs \ + $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.core \ + $$(HSREQ$(1)_T_$(2)_H_$(3)) \ + | $$(TBIN$(1)_T_$(2)_H_$(3))/ + @$$(call E, rustc: $$@) + $$(STAGE$(1)_T_$(2)_H_$(3)) --emit=obj -o $$@ $$< + +ifeq ($$(CFG_RUSTRT_HAS_STARTUP_OBJS_$(2)), 1) +# Add dependencies on Rust startup objects to all crates that depend on core. +# This ensures that they are built after core (since they depend on it), +# but before everything else (since they are needed for linking dylib crates). +$$(foreach crate, $$(TARGET_CRATES), \ + $$(if $$(findstring core,$$(DEPS_$$(crate))), \ + $$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(crate))) : $$(TLIB$(1)_T_$(2)_H_$(3))/$(4).o +endif endef @@ -174,3 +205,9 @@ $(foreach host,$(CFG_HOST), \ $(foreach stage,$(STAGES), \ $(foreach tool,$(TOOLS), \ $(eval $(call TARGET_TOOL,$(stage),$(target),$(host),$(tool))))))) + +$(foreach host,$(CFG_HOST), \ + $(foreach target,$(CFG_TARGET), \ + $(foreach stage,$(STAGES), \ + $(foreach obj,rsbegin rsend, \ + $(eval $(call TARGET_RUSTRT_STARTUP_OBJ,$(stage),$(target),$(host),$(obj))))))) diff --git a/mk/tests.mk b/mk/tests.mk index d004558d1b..b41eaba190 100644 --- a/mk/tests.mk +++ b/mk/tests.mk @@ -22,10 +22,11 @@ $(eval $(call RUST_CRATE,coretest)) DEPS_collectionstest := $(eval $(call RUST_CRATE,collectionstest)) -TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system \ +TEST_TARGET_CRATES = $(filter-out core rustc_unicode alloc_system libc \ alloc_jemalloc,$(TARGET_CRATES)) \ collectionstest coretest -TEST_DOC_CRATES = $(DOC_CRATES) +TEST_DOC_CRATES = $(DOC_CRATES) arena flate fmt_macros getopts graphviz \ + log rand rbml serialize syntax term test TEST_HOST_CRATES = $(filter-out rustc_typeck rustc_borrowck rustc_resolve \ rustc_trans rustc_lint,\ $(HOST_CRATES)) @@ -162,8 +163,8 @@ endef $(foreach doc,$(DOCS), \ $(eval $(call DOCTEST,md-$(doc),$(S)src/doc/$(doc).md))) -$(foreach file,$(wildcard $(S)src/doc/trpl/*.md), \ - $(eval $(call DOCTEST,$(file:$(S)src/doc/trpl/%.md=trpl-%),$(file)))) +$(foreach file,$(wildcard $(S)src/doc/book/*.md), \ + $(eval $(call DOCTEST,$(file:$(S)src/doc/book/%.md=book-%),$(file)))) $(foreach file,$(wildcard $(S)src/doc/nomicon/*.md), \ $(eval $(call DOCTEST,$(file:$(S)src/doc/nomicon/%.md=nomicon-%),$(file)))) ###################################################################### @@ -283,6 +284,7 @@ tidy-binaries: | grep '^$(S)src/compiler-rt' -v \ | grep '^$(S)src/libbacktrace' -v \ | grep '^$(S)src/rust-installer' -v \ + | grep '^$(S)src/liblibc' -v \ | xargs $(CFG_PYTHON) $(S)src/etc/check-binaries.py .PHONY: tidy-errors @@ -391,7 +393,8 @@ $(3)/stage$(1)/test/$(4)test-$(2)$$(X_$(2)): \ $$(subst @,,$$(STAGE$(1)_T_$(2)_H_$(3))) -o $$@ $$< --test \ -L "$$(RT_OUTPUT_DIR_$(2))" \ $$(LLVM_LIBDIR_RUSTFLAGS_$(2)) \ - $$(RUSTFLAGS_$(4)) + $$(RUSTFLAGS_$(4)) \ + $$(STDCPP_LIBDIR_RUSTFLAGS_$(2)) endef @@ -605,7 +608,7 @@ endif # CTEST_DISABLE_NONSELFHOST_$(TEST_GROUP), if set, will cause that # test group to be disabled *unless* the target is able to build a -# compiler (i.e. when the target triple is in the set of of host +# compiler (i.e. when the target triple is in the set of host # triples). The associated message will be printed as a warning # during attempts to run those tests. @@ -661,9 +664,9 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) := \ --android-cross-path=$(CFG_ANDROID_CROSS_PATH) \ --adb-path=$(CFG_ADB) \ --adb-test-dir=$(CFG_ADB_TEST_DIR) \ - --host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3))" \ + --host-rustcflags "$(RUSTC_FLAGS_$(3)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(3)) $$(STDCPP_LIBDIR_RUSTFLAGS_$(3))" \ --lldb-python-dir=$(CFG_LLDB_PYTHON_DIR) \ - --target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2))" \ + --target-rustcflags "$(RUSTC_FLAGS_$(2)) $$(CTEST_RUSTC_FLAGS) -L $$(RT_OUTPUT_DIR_$(2)) $$(STDCPP_LIBDIR_RUSTFLAGS_$(2))" \ $$(CTEST_TESTARGS) ifdef CFG_VALGRIND_RPASS diff --git a/src/compiler-rt/CMakeLists.txt b/src/compiler-rt/CMakeLists.txt index e1a7a1f041..6f0b867463 100644 --- a/src/compiler-rt/CMakeLists.txt +++ b/src/compiler-rt/CMakeLists.txt @@ -9,7 +9,7 @@ # Check if compiler-rt is built as a standalone project. if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR) - project(CompilerRT) + project(CompilerRT C CXX ASM) set(COMPILER_RT_STANDALONE_BUILD TRUE) else() set(COMPILER_RT_STANDALONE_BUILD FALSE) @@ -22,7 +22,7 @@ endif() if (NOT MSVC) cmake_minimum_required(VERSION 2.8.8) else() - # Version 2.8.12.1 is required to build with Visual Studion 2013. + # Version 2.8.12.1 is required to build with Visual Studio 2013. cmake_minimum_required(VERSION 2.8.12.1) endif() @@ -43,6 +43,11 @@ endif() # Top level target used to build all compiler-rt libraries. add_custom_target(compiler-rt ALL) +option(COMPILER_RT_BUILD_BUILTINS "Build builtins" ON) +mark_as_advanced(COMPILER_RT_BUILD_BUILTINS) +option(COMPILER_RT_BUILD_SANITIZERS "Build sanitizers" ON) +mark_as_advanced(COMPILER_RT_BUILD_SANITIZERS) + if (NOT COMPILER_RT_STANDALONE_BUILD) # Compute the Clang version from the LLVM version. # FIXME: We should be able to reuse CLANG_VERSION variable calculated @@ -57,8 +62,13 @@ if (NOT COMPILER_RT_STANDALONE_BUILD) ${LLVM_INCLUDE_TESTS}) option(COMPILER_RT_ENABLE_WERROR "Fail and stop if warning is triggered" ${LLVM_ENABLE_WERROR}) - # Use just-built Clang to compile/link tests. - set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) + # Use just-built Clang to compile/link tests on all platforms, except for + # Windows where we need to use clang-cl instead. + if(NOT MSVC) + set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang) + else() + set(COMPILER_RT_TEST_COMPILER ${LLVM_RUNTIME_OUTPUT_INTDIR}/clang.exe) + endif() else() # Take output dir and install path from the user. set(COMPILER_RT_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR} CACHE PATH @@ -99,7 +109,8 @@ else() # Get some LLVM variables from LLVMConfig. include("${LLVM_CMAKE_PATH}/LLVMConfig.cmake") - set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib) + set(LLVM_LIBRARY_OUTPUT_INTDIR + ${CMAKE_BINARY_DIR}/${CMAKE_CFG_INTDIR}/lib${LLVM_LIBDIR_SUFFIX}) # Find Python interpreter. set(Python_ADDITIONAL_VERSIONS 2.7 2.6 2.5) @@ -120,10 +131,36 @@ endif() if("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang[+]*$") set(COMPILER_RT_TEST_COMPILER_ID Clang) +elseif("${COMPILER_RT_TEST_COMPILER}" MATCHES "clang.*.exe$") + set(COMPILER_RT_TEST_COMPILER_ID Clang) else() set(COMPILER_RT_TEST_COMPILER_ID GNU) endif() +set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${TARGET_TRIPLE} CACHE STRING + "Default triple for which compiler-rt runtimes will be built.") +if(DEFINED COMPILER_RT_TEST_TARGET_TRIPLE) + # Backwards compatibility: this variable used to be called + # COMPILER_RT_TEST_TARGET_TRIPLE. + set(COMPILER_RT_DEFAULT_TARGET_TRIPLE ${COMPILER_RT_TEST_TARGET_TRIPLE}) +endif() + +string(REPLACE "-" ";" TARGET_TRIPLE_LIST ${COMPILER_RT_DEFAULT_TARGET_TRIPLE}) +list(GET TARGET_TRIPLE_LIST 0 COMPILER_RT_DEFAULT_TARGET_ARCH) +list(GET TARGET_TRIPLE_LIST 1 COMPILER_RT_DEFAULT_TARGET_OS) +list(GET TARGET_TRIPLE_LIST 2 COMPILER_RT_DEFAULT_TARGET_ABI) +# Determine if test target triple is specified explicitly, and doesn't match the +# default. +if(NOT COMPILER_RT_DEFAULT_TARGET_TRIPLE STREQUAL TARGET_TRIPLE) + set(COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE TRUE) +else() + set(COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE FALSE) +endif() + +if ("${COMPILER_RT_DEFAULT_TARGET_ABI}" STREQUAL "androideabi") + set(ANDROID 1) +endif() + string(TOLOWER ${CMAKE_SYSTEM_NAME} COMPILER_RT_OS_DIR) set(COMPILER_RT_LIBRARY_OUTPUT_DIR ${COMPILER_RT_OUTPUT_DIR}/lib/${COMPILER_RT_OS_DIR}) @@ -140,106 +177,27 @@ include(CompilerRTUtils) set(COMPILER_RT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}) set(COMPILER_RT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}) -# Setup custom SDK sysroots. -set(COMPILER_RT_DARWIN_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/darwin) -set(COMPILER_RT_LINUX_SDK_SYSROOT ${COMPILER_RT_SOURCE_DIR}/SDKs/linux) - -set(COMPILER_RT_EXTRA_ANDROID_HEADERS ${COMPILER_RT_SOURCE_DIR}/android/include) -# 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 (NOT CMAKE_SIZEOF_VOID_P EQUAL 4 AND - NOT CMAKE_SIZEOF_VOID_P EQUAL 8) - message(FATAL_ERROR "Please use architecture with 4 or 8 byte pointers.") -endif() -if (NOT MSVC) - set(TARGET_64_BIT_CFLAGS "-m64") - set(TARGET_32_BIT_CFLAGS "-m32") -else() - set(TARGET_64_BIT_CFLAGS "") - set(TARGET_32_BIT_CFLAGS "") -endif() - -# List of architectures we can target. -set(COMPILER_RT_SUPPORTED_ARCH) - -function(get_target_flags_for_arch arch out_var) - list(FIND COMPILER_RT_SUPPORTED_ARCH ${arch} ARCH_INDEX) - 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_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc) -file(WRITE ${SIMPLE_SOURCE} "#include \n#include \nint main() {}\n") - -# test_target_arch( ) -# Sets the target flags for a given architecture and determines if this -# architecture is supported by trying to build a simple file. -macro(test_target_arch arch) - set(TARGET_${arch}_CFLAGS ${ARGN}) - try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} - COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}" - CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${TARGET_${arch}_CFLAGS}") - if(${CAN_TARGET_${arch}}) - list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) - endif() -endmacro() - -if(ANDROID_COMMON_FLAGS) - test_target_arch(arm_android "${ANDROID_COMMON_FLAGS}") -else() - if("${LLVM_NATIVE_ARCH}" STREQUAL "X86") - if (NOT MSVC) - test_target_arch(x86_64 ${TARGET_64_BIT_CFLAGS}) - endif() - test_target_arch(i386 ${TARGET_32_BIT_CFLAGS}) - elseif("${LLVM_NATIVE_ARCH}" STREQUAL "PowerPC") - test_target_arch(powerpc64 ${TARGET_64_BIT_CFLAGS}) - elseif("${LLVM_NATIVE_ARCH}" STREQUAL "ARM") - test_target_arch(arm "") - endif() -endif() - -# We only support running instrumented tests when we're not cross compiling -# and target a unix-like system. We can run tests on Android even when we are -# cross-compiling. -if(("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND UNIX) OR ANDROID) +# We support running instrumented tests when we're not cross compiling +# and target a UNIX-like system or Windows. +# We can run tests on Android even when we are cross-compiling. +if(("${CMAKE_HOST_SYSTEM}" STREQUAL "${CMAKE_SYSTEM}" AND (UNIX OR WIN32)) OR ANDROID + OR COMPILER_RT_EMULATOR) option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" ON) else() option(COMPILER_RT_CAN_EXECUTE_TESTS "Can we execute instrumented tests" OFF) endif() -# Check if compiler-rt is built with libc++. -find_flag_in_string("${CMAKE_CXX_FLAGS}" "-stdlib=libc++" - COMPILER_RT_USES_LIBCXX) - -function(filter_available_targets out_var) - set(archs) - foreach(arch ${ARGN}) - 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(${out_var} ${archs} PARENT_SCOPE) -endfunction() - option(COMPILER_RT_DEBUG "Build runtimes with full debug info" OFF) # COMPILER_RT_DEBUG_PYBOOL is used by lit.common.configured.in. pythonize_bool(COMPILER_RT_DEBUG) -option(COMPILER_RT_BUILD_SHARED_ASAN "Build shared version of AddressSanitizer runtime" OFF) - #================================ # Setup Compiler Flags #================================ +include(CheckIncludeFile) +check_include_file(unwind.h HAVE_UNWIND_H) + include(config-ix) if(MSVC) @@ -260,33 +218,56 @@ if(NOT COMPILER_RT_HAS_FUNC_SYMBOL) endif() # Provide some common commmandline flags for Sanitizer runtimes. -append_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_FNO_BUILTIN_FLAG -fno-builtin SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG -fno-exceptions SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG -fomit-frame-pointer SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_FUNWIND_TABLES_FLAG -funwind-tables SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG -fno-stack-protector SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG -fno-function-sections SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FPIC_FLAG -fPIC SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_BUILTIN_FLAG -fno-builtin SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG -fno-exceptions SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG -fomit-frame-pointer SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FUNWIND_TABLES_FLAG -funwind-tables SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG -fno-stack-protector SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG -fno-sanitize=safe-stack SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG -fvisibility=hidden SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG -fno-function-sections SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_FNO_LTO_FLAG -fno-lto SANITIZER_COMMON_CFLAGS) if(MSVC) - # Remove /MD flag so that it doesn't conflict with /MT. + # Replace the /M[DT][d] flags with /MT, and strip any definitions of _DEBUG, + # which cause definition mismatches at link time. + # FIXME: In fact, sanitizers should support both /MT and /MD, see PR20214. if(COMPILER_RT_HAS_MT_FLAG) - string(REGEX REPLACE "(^| ) */MDd? *( |$)" "\\1 \\2" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") - list(APPEND SANITIZER_COMMON_CFLAGS /MT) + foreach(flag_var + CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE + CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO) + string(REGEX REPLACE "/M[DT]d" "/MT" ${flag_var} "${${flag_var}}") + string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}") + string(REGEX REPLACE "/D_DEBUG" "" ${flag_var} "${${flag_var}}") + endforeach() endif() - append_if(COMPILER_RT_HAS_Oy_FLAG /Oy- SANITIZER_COMMON_CFLAGS) - append_if(COMPILER_RT_HAS_GS_FLAG /GS- SANITIZER_COMMON_CFLAGS) + append_list_if(COMPILER_RT_HAS_Oy_FLAG /Oy- SANITIZER_COMMON_CFLAGS) + append_list_if(COMPILER_RT_HAS_GS_FLAG /GS- SANITIZER_COMMON_CFLAGS) endif() +append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 SANITIZER_COMMON_CFLAGS) + # Build with optimization, unless we're in debug mode. If we're using MSVC, # always respect the optimization flags set by CMAKE_BUILD_TYPE instead. if(NOT COMPILER_RT_DEBUG AND NOT MSVC) list(APPEND SANITIZER_COMMON_CFLAGS -O3) endif() +# Determine if we should restrict stack frame sizes. +# Stack frames on PowerPC and Mips and in debug biuld can be much larger than +# anticipated. +# FIXME: Fix all sanitizers and add -Wframe-larger-than to +# SANITIZER_COMMON_FLAGS +if(COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG AND NOT COMPILER_RT_DEBUG + AND NOT ${COMPILER_RT_DEFAULT_TARGET_ARCH} MATCHES "powerpc|mips") + set(SANITIZER_LIMIT_FRAME_SIZE TRUE) +else() + set(SANITIZER_LIMIT_FRAME_SIZE FALSE) +endif() + # Build sanitizer runtimes with debug info. -if(COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG) +if(COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG AND NOT COMPILER_RT_DEBUG) list(APPEND SANITIZER_COMMON_CFLAGS -gline-tables-only) elseif(COMPILER_RT_HAS_G_FLAG) list(APPEND SANITIZER_COMMON_CFLAGS -g) @@ -295,52 +276,24 @@ elseif(COMPILER_RT_HAS_Zi_FLAG) endif() # Turn off several warnings. -append_if(COMPILER_RT_HAS_WNO_GNU_FLAG -Wno-gnu SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_WNO_VARIADIC_MACROS_FLAG -Wno-variadic-macros SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_WNO_C99_EXTENSIONS_FLAG -Wno-c99-extensions SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_WNO_NON_VIRTUAL_DTOR_FLAG -Wno-non-virtual-dtor SANITIZER_COMMON_CFLAGS) -append_if(COMPILER_RT_HAS_WD4722_FLAG /wd4722 SANITIZER_COMMON_CFLAGS) - -if(APPLE) - # Obtain the iOS Simulator SDK path from xcodebuild. - execute_process( - COMMAND xcodebuild -version -sdk iphonesimulator Path - OUTPUT_VARIABLE IOSSIM_SDK_DIR - OUTPUT_STRIP_TRAILING_WHITESPACE - ) - string(REGEX MATCH "-mmacosx-version-min=" - MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}") - set(SANITIZER_COMMON_SUPPORTED_DARWIN_OS osx) - if (IOSSIM_SDK_DIR AND NOT MACOSX_VERSION_MIN_FLAG) - list(APPEND SANITIZER_COMMON_SUPPORTED_DARWIN_OS iossim) - endif() - - if(COMPILER_RT_USES_LIBCXX) - set(SANITIZER_MIN_OSX_VERSION 10.7) - else() - set(SANITIZER_MIN_OSX_VERSION 10.6) - endif() - set(DARWIN_osx_CFLAGS -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) - set(DARWIN_iossim_CFLAGS - -mios-simulator-version-min=7.0 -isysroot ${IOSSIM_SDK_DIR}) - set(DARWIN_osx_LINKFLAGS) - set(DARWIN_iossim_LINKFLAGS - -Wl,-ios_simulator_version_min,7.0.0 - -mios-simulator-version-min=7.0 - -isysroot ${IOSSIM_SDK_DIR}) +append_list_if(COMPILER_RT_HAS_WGNU_FLAG -Wno-gnu SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG -Wno-variadic-macros SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WC99_EXTENSIONS_FLAG -Wno-c99-extensions SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WNON_VIRTUAL_DTOR_FLAG -Wno-non-virtual-dtor SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4146_FLAG /wd4146 SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4291_FLAG /wd4291 SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4391_FLAG /wd4391 SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4722_FLAG /wd4722 SANITIZER_COMMON_CFLAGS) +append_list_if(COMPILER_RT_HAS_WD4800_FLAG /wd4800 SANITIZER_COMMON_CFLAGS) + +if(APPLE AND SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.9") + # Mac OS X prior to 10.9 had problems with exporting symbols from + # libc++/libc++abi. + set(SANITIZER_CAN_USE_CXXABI FALSE) +else() + set(SANITIZER_CAN_USE_CXXABI TRUE) 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 powerpc64 arm) -filter_available_targets(ASAN_SUPPORTED_ARCH x86_64 i386 powerpc64) -filter_available_targets(DFSAN_SUPPORTED_ARCH x86_64) -filter_available_targets(LSAN_SUPPORTED_ARCH x86_64) -filter_available_targets(MSAN_SUPPORTED_ARCH x86_64) -filter_available_targets(PROFILE_SUPPORTED_ARCH x86_64 i386 arm) -filter_available_targets(TSAN_SUPPORTED_ARCH x86_64) -filter_available_targets(UBSAN_SUPPORTED_ARCH x86_64 i386) +pythonize_bool(SANITIZER_CAN_USE_CXXABI) add_subdirectory(include) @@ -351,9 +304,17 @@ else() set(COMPILER_RT_HAS_LIBCXX_SOURCES FALSE) endif() +set(COMPILER_RT_LLD_PATH ${LLVM_MAIN_SRC_DIR}/tools/lld) +if(EXISTS ${COMPILER_RT_LLD_PATH}/) + set(COMPILER_RT_HAS_LLD_SOURCES TRUE) +else() + set(COMPILER_RT_HAS_LLD_SOURCES FALSE) +endif() +pythonize_bool(COMPILER_RT_HAS_LLD_SOURCES) + add_subdirectory(lib) if(COMPILER_RT_INCLUDE_TESTS) add_subdirectory(unittests) + add_subdirectory(test) endif() -add_subdirectory(test) diff --git a/src/compiler-rt/CREDITS.TXT b/src/compiler-rt/CREDITS.TXT index 4b7ef51aea..6964eba020 100644 --- a/src/compiler-rt/CREDITS.TXT +++ b/src/compiler-rt/CREDITS.TXT @@ -23,6 +23,10 @@ N: Howard Hinnant E: hhinnant@apple.com D: Architect and primary author of compiler-rt +N: Guan-Hong Liu +E: koviankevin@hotmail.com +D: IEEE Quad-precision functions + N: Joerg Sonnenberger E: joerg@NetBSD.org D: Maintains NetBSD port. diff --git a/src/compiler-rt/LICENSE.TXT b/src/compiler-rt/LICENSE.TXT index aee8347b0c..aa4115e2a7 100644 --- a/src/compiler-rt/LICENSE.TXT +++ b/src/compiler-rt/LICENSE.TXT @@ -14,7 +14,7 @@ Full text of the relevant licenses is included below. 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 diff --git a/src/compiler-rt/Makefile b/src/compiler-rt/Makefile index 49dc71bd3a..ac3daac5fc 100644 --- a/src/compiler-rt/Makefile +++ b/src/compiler-rt/Makefile @@ -247,12 +247,12 @@ $(call Set,Tmp.CFLAGS,$(strip \ -mkernel -DKERNEL_USE,)\ $(call GetCNAVar,CFLAGS,$(Tmp.Key),$(Tmp.Config),$(Tmp.Arch)))) -$(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.S $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir - $(Summary) " ASSEMBLE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" - $(Verb) $(Tmp.CC) $(COMMON_ASMFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$< $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.s $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir $(Summary) " ASSEMBLE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" $(Verb) $(Tmp.CC) $(COMMON_ASMFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$< +$(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.S $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir + $(Summary) " ASSEMBLE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" + $(Verb) $(Tmp.CC) $(COMMON_ASMFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$< $(Tmp.ObjPath)/%.o: $(Tmp.SrcPath)/%.c $(Tmp.Dependencies) $(Tmp.ObjPath)/.dir $(Summary) " COMPILE: $(Tmp.Name)/$(Tmp.Config)/$(Tmp.Arch): $$<" $(Verb) $(Tmp.CC) $(COMMON_CFLAGS) $(Tmp.CFLAGS) -c -o $$@ $$< diff --git a/src/compiler-rt/README.txt b/src/compiler-rt/README.txt index b37c0aecde..fc8843246e 100644 --- a/src/compiler-rt/README.txt +++ b/src/compiler-rt/README.txt @@ -9,335 +9,3 @@ terms of the license agreement found in LICENSE.txt. ================================ -This is a replacement library for libgcc. Each function is contained -in its own file. Each function has a corresponding unit test under -test/Unit. - -A rudimentary script to test each file is in the file called -test/Unit/test. - -Here is the specification for this library: - -http://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc - -Here is a synopsis of the contents of this library: - -typedef int si_int; -typedef unsigned su_int; - -typedef long long di_int; -typedef unsigned long long du_int; - -// Integral bit manipulation - -di_int __ashldi3(di_int a, si_int b); // a << b -ti_int __ashlti3(ti_int a, si_int b); // a << b - -di_int __ashrdi3(di_int a, si_int b); // a >> b arithmetic (sign fill) -ti_int __ashrti3(ti_int a, si_int b); // a >> b arithmetic (sign fill) -di_int __lshrdi3(di_int a, si_int b); // a >> b logical (zero fill) -ti_int __lshrti3(ti_int a, si_int b); // a >> b logical (zero fill) - -si_int __clzsi2(si_int a); // count leading zeros -si_int __clzdi2(di_int a); // count leading zeros -si_int __clzti2(ti_int a); // count leading zeros -si_int __ctzsi2(si_int a); // count trailing zeros -si_int __ctzdi2(di_int a); // count trailing zeros -si_int __ctzti2(ti_int a); // count trailing zeros - -si_int __ffsdi2(di_int a); // find least significant 1 bit -si_int __ffsti2(ti_int a); // find least significant 1 bit - -si_int __paritysi2(si_int a); // bit parity -si_int __paritydi2(di_int a); // bit parity -si_int __parityti2(ti_int a); // bit parity - -si_int __popcountsi2(si_int a); // bit population -si_int __popcountdi2(di_int a); // bit population -si_int __popcountti2(ti_int a); // bit population - -uint32_t __bswapsi2(uint32_t a); // a byteswapped, arm only -uint64_t __bswapdi2(uint64_t a); // a byteswapped, arm only - -// Integral arithmetic - -di_int __negdi2 (di_int a); // -a -ti_int __negti2 (ti_int a); // -a -di_int __muldi3 (di_int a, di_int b); // a * b -ti_int __multi3 (ti_int a, ti_int b); // a * b -si_int __divsi3 (si_int a, si_int b); // a / b signed -di_int __divdi3 (di_int a, di_int b); // a / b signed -ti_int __divti3 (ti_int a, ti_int b); // a / b signed -su_int __udivsi3 (su_int n, su_int d); // a / b unsigned -du_int __udivdi3 (du_int a, du_int b); // a / b unsigned -tu_int __udivti3 (tu_int a, tu_int b); // a / b unsigned -si_int __modsi3 (si_int a, si_int b); // a % b signed -di_int __moddi3 (di_int a, di_int b); // a % b signed -ti_int __modti3 (ti_int a, ti_int b); // a % b signed -su_int __umodsi3 (su_int a, su_int b); // a % b unsigned -du_int __umoddi3 (du_int a, du_int b); // a % b unsigned -tu_int __umodti3 (tu_int a, tu_int b); // a % b unsigned -du_int __udivmoddi4(du_int a, du_int b, du_int* rem); // a / b, *rem = a % b unsigned -tu_int __udivmodti4(tu_int a, tu_int b, tu_int* rem); // a / b, *rem = a % b unsigned -su_int __udivmodsi4(su_int a, su_int b, su_int* rem); // a / b, *rem = a % b unsigned -si_int __divmodsi4(si_int a, si_int b, si_int* rem); // a / b, *rem = a % b signed - - - -// Integral arithmetic with trapping overflow - -si_int __absvsi2(si_int a); // abs(a) -di_int __absvdi2(di_int a); // abs(a) -ti_int __absvti2(ti_int a); // abs(a) - -si_int __negvsi2(si_int a); // -a -di_int __negvdi2(di_int a); // -a -ti_int __negvti2(ti_int a); // -a - -si_int __addvsi3(si_int a, si_int b); // a + b -di_int __addvdi3(di_int a, di_int b); // a + b -ti_int __addvti3(ti_int a, ti_int b); // a + b - -si_int __subvsi3(si_int a, si_int b); // a - b -di_int __subvdi3(di_int a, di_int b); // a - b -ti_int __subvti3(ti_int a, ti_int b); // a - b - -si_int __mulvsi3(si_int a, si_int b); // a * b -di_int __mulvdi3(di_int a, di_int b); // a * b -ti_int __mulvti3(ti_int a, ti_int b); // a * b - - -// Integral arithmetic which returns if overflow - -si_int __mulosi4(si_int a, si_int b, int* overflow); // a * b, overflow set to one if result not in signed range -di_int __mulodi4(di_int a, di_int b, int* overflow); // a * b, overflow set to one if result not in signed range -ti_int __muloti4(ti_int a, ti_int b, int* overflow); // a * b, overflow set to - one if result not in signed range - - -// Integral comparison: a < b -> 0 -// a == b -> 1 -// a > b -> 2 - -si_int __cmpdi2 (di_int a, di_int b); -si_int __cmpti2 (ti_int a, ti_int b); -si_int __ucmpdi2(du_int a, du_int b); -si_int __ucmpti2(tu_int a, tu_int b); - -// Integral / floating point conversion - -di_int __fixsfdi( float a); -di_int __fixdfdi( double a); -di_int __fixxfdi(long double a); - -ti_int __fixsfti( float a); -ti_int __fixdfti( double a); -ti_int __fixxfti(long double a); -uint64_t __fixtfdi(long double input); // ppc only, doesn't match documentation - -su_int __fixunssfsi( float a); -su_int __fixunsdfsi( double a); -su_int __fixunsxfsi(long double a); - -du_int __fixunssfdi( float a); -du_int __fixunsdfdi( double a); -du_int __fixunsxfdi(long double a); - -tu_int __fixunssfti( float a); -tu_int __fixunsdfti( double a); -tu_int __fixunsxfti(long double a); -uint64_t __fixunstfdi(long double input); // ppc only - -float __floatdisf(di_int a); -double __floatdidf(di_int a); -long double __floatdixf(di_int a); -long double __floatditf(int64_t a); // ppc only - -float __floattisf(ti_int a); -double __floattidf(ti_int a); -long double __floattixf(ti_int a); - -float __floatundisf(du_int a); -double __floatundidf(du_int a); -long double __floatundixf(du_int a); -long double __floatunditf(uint64_t a); // ppc only - -float __floatuntisf(tu_int a); -double __floatuntidf(tu_int a); -long double __floatuntixf(tu_int a); - -// Floating point raised to integer power - -float __powisf2( float a, si_int b); // a ^ b -double __powidf2( double a, si_int b); // a ^ b -long double __powixf2(long double a, si_int b); // a ^ b -long double __powitf2(long double a, si_int b); // ppc only, a ^ b - -// Complex arithmetic - -// (a + ib) * (c + id) - - float _Complex __mulsc3( float a, float b, float c, float d); - double _Complex __muldc3(double a, double b, double c, double d); -long double _Complex __mulxc3(long double a, long double b, - long double c, long double d); -long double _Complex __multc3(long double a, long double b, - long double c, long double d); // ppc only - -// (a + ib) / (c + id) - - float _Complex __divsc3( float a, float b, float c, float d); - double _Complex __divdc3(double a, double b, double c, double d); -long double _Complex __divxc3(long double a, long double b, - long double c, long double d); -long double _Complex __divtc3(long double a, long double b, - long double c, long double d); // ppc only - - -// Runtime support - -// __clear_cache() is used to tell process that new instructions have been -// written to an address range. Necessary on processors that do not have -// a unified instuction and data cache. -void __clear_cache(void* start, void* end); - -// __enable_execute_stack() is used with nested functions when a trampoline -// function is written onto the stack and that page range needs to be made -// executable. -void __enable_execute_stack(void* addr); - -// __gcc_personality_v0() is normally only called by the system unwinder. -// C code (as opposed to C++) normally does not need a personality function -// because there are no catch clauses or destructors to be run. But there -// is a C language extension __attribute__((cleanup(func))) which marks local -// variables as needing the cleanup function "func" to be run when the -// variable goes out of scope. That includes when an exception is thrown, -// so a personality handler is needed. -_Unwind_Reason_Code __gcc_personality_v0(int version, _Unwind_Action actions, - uint64_t exceptionClass, struct _Unwind_Exception* exceptionObject, - _Unwind_Context_t context); - -// for use with some implementations of assert() in -void __eprintf(const char* format, const char* assertion_expression, - const char* line, const char* file); - - - -// Power PC specific functions - -// There is no C interface to the saveFP/restFP functions. They are helper -// functions called by the prolog and epilog of functions that need to save -// a number of non-volatile float point registers. -saveFP -restFP - -// PowerPC has a standard template for trampoline functions. This function -// generates a custom trampoline function with the specific realFunc -// and localsPtr values. -void __trampoline_setup(uint32_t* trampOnStack, int trampSizeAllocated, - const void* realFunc, void* localsPtr); - -// adds two 128-bit double-double precision values ( x + y ) -long double __gcc_qadd(long double x, long double y); - -// subtracts two 128-bit double-double precision values ( x - y ) -long double __gcc_qsub(long double x, long double y); - -// multiples two 128-bit double-double precision values ( x * y ) -long double __gcc_qmul(long double x, long double y); - -// divides two 128-bit double-double precision values ( x / y ) -long double __gcc_qdiv(long double a, long double b); - - -// ARM specific functions - -// There is no C interface to the switch* functions. These helper functions -// are only needed by Thumb1 code for efficient switch table generation. -switch16 -switch32 -switch8 -switchu8 - -// There is no C interface to the *_vfp_d8_d15_regs functions. There are -// called in the prolog and epilog of Thumb1 functions. When the C++ ABI use -// SJLJ for exceptions, each function with a catch clause or destuctors needs -// to save and restore all registers in it prolog and epliog. But there is -// no way to access vector and high float registers from thumb1 code, so the -// compiler must add call outs to these helper functions in the prolog and -// epilog. -restore_vfp_d8_d15_regs -save_vfp_d8_d15_regs - - -// Note: long ago ARM processors did not have floating point hardware support. -// Floating point was done in software and floating point parameters were -// passed in integer registers. When hardware support was added for floating -// point, new *vfp functions were added to do the same operations but with -// floating point parameters in floating point registers. - -// Undocumented functions - -float __addsf3vfp(float a, float b); // Appears to return a + b -double __adddf3vfp(double a, double b); // Appears to return a + b -float __divsf3vfp(float a, float b); // Appears to return a / b -double __divdf3vfp(double a, double b); // Appears to return a / b -int __eqsf2vfp(float a, float b); // Appears to return one - // iff a == b and neither is NaN. -int __eqdf2vfp(double a, double b); // Appears to return one - // iff a == b and neither is NaN. -double __extendsfdf2vfp(float a); // Appears to convert from - // float to double. -int __fixdfsivfp(double a); // Appears to convert from - // double to int. -int __fixsfsivfp(float a); // Appears to convert from - // float to int. -unsigned int __fixunssfsivfp(float a); // Appears to convert from - // float to unsigned int. -unsigned int __fixunsdfsivfp(double a); // Appears to convert from - // double to unsigned int. -double __floatsidfvfp(int a); // Appears to convert from - // int to double. -float __floatsisfvfp(int a); // Appears to convert from - // int to float. -double __floatunssidfvfp(unsigned int a); // Appears to convert from - // unisgned int to double. -float __floatunssisfvfp(unsigned int a); // Appears to convert from - // unisgned int to float. -int __gedf2vfp(double a, double b); // Appears to return __gedf2 - // (a >= b) -int __gesf2vfp(float a, float b); // Appears to return __gesf2 - // (a >= b) -int __gtdf2vfp(double a, double b); // Appears to return __gtdf2 - // (a > b) -int __gtsf2vfp(float a, float b); // Appears to return __gtsf2 - // (a > b) -int __ledf2vfp(double a, double b); // Appears to return __ledf2 - // (a <= b) -int __lesf2vfp(float a, float b); // Appears to return __lesf2 - // (a <= b) -int __ltdf2vfp(double a, double b); // Appears to return __ltdf2 - // (a < b) -int __ltsf2vfp(float a, float b); // Appears to return __ltsf2 - // (a < b) -double __muldf3vfp(double a, double b); // Appears to return a * b -float __mulsf3vfp(float a, float b); // Appears to return a * b -int __nedf2vfp(double a, double b); // Appears to return __nedf2 - // (a != b) -double __negdf2vfp(double a); // Appears to return -a -float __negsf2vfp(float a); // Appears to return -a -float __negsf2vfp(float a); // Appears to return -a -double __subdf3vfp(double a, double b); // Appears to return a - b -float __subsf3vfp(float a, float b); // Appears to return a - b -float __truncdfsf2vfp(double a); // Appears to convert from - // double to float. -int __unorddf2vfp(double a, double b); // Appears to return __unorddf2 -int __unordsf2vfp(float a, float b); // Appears to return __unordsf2 - - -Preconditions are listed for each function at the definition when there are any. -Any preconditions reflect the specification at -http://gcc.gnu.org/onlinedocs/gccint/Libgcc.html#Libgcc. - -Assumptions are listed in "int_lib.h", and in individual files. Where possible -assumptions are checked at compile time. diff --git a/src/compiler-rt/SDKs/README.txt b/src/compiler-rt/SDKs/README.txt deleted file mode 100644 index b95575e8c9..0000000000 --- a/src/compiler-rt/SDKs/README.txt +++ /dev/null @@ -1,9 +0,0 @@ -It is often convenient to be able to build compiler-rt libraries for a certain -platform without having a full SDK or development environment installed. - -This makes it easy for users to build a compiler which can target a number of -different platforms, without having to actively maintain full development -environments for those platforms. - -Since compiler-rt's libraries typically have minimal interaction with the -system, we achieve this by stubbing out the SDKs of certain platforms. diff --git a/src/compiler-rt/SDKs/darwin/README.txt b/src/compiler-rt/SDKs/darwin/README.txt deleted file mode 100644 index ea30af358b..0000000000 --- a/src/compiler-rt/SDKs/darwin/README.txt +++ /dev/null @@ -1,3 +0,0 @@ -The Darwin platforms are all similar enough we roll them into one SDK, and use -preprocessor tricks to get the right definitions for the few things which -diverge between OS X and iOS. diff --git a/src/compiler-rt/SDKs/darwin/usr/include/errno.h b/src/compiler-rt/SDKs/darwin/usr/include/errno.h deleted file mode 100644 index f06e537133..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/errno.h +++ /dev/null @@ -1,17 +0,0 @@ -/* ===-- errno.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#include diff --git a/src/compiler-rt/SDKs/darwin/usr/include/fcntl.h b/src/compiler-rt/SDKs/darwin/usr/include/fcntl.h deleted file mode 100644 index a5f91e3a5b..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/fcntl.h +++ /dev/null @@ -1,17 +0,0 @@ -/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#include diff --git a/src/compiler-rt/SDKs/darwin/usr/include/inttypes.h b/src/compiler-rt/SDKs/darwin/usr/include/inttypes.h deleted file mode 100644 index 406fa6fada..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/inttypes.h +++ /dev/null @@ -1,86 +0,0 @@ -/* ===-- inttypes.h - stub SDK header for compiler-rt -----------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __INTTYPES_H__ -#define __INTTYPES_H__ - -#if __WORDSIZE == 64 -#define __INTTYPE_PRI64__ "l" -#else -#define __INTTYPE_PRI64__ "ll" -#endif - -#define PRId8 "hhd" -#define PRId16 "hd" -#define PRId32 "d" -#define PRId64 __INTTYPE_PRI64__ "d" - -#define PRIi8 "hhi" -#define PRIi16 "hi" -#define PRIi32 "i" -#define PRIi64 __INTTYPE_PRI64__ "i" - -#define PRIo8 "hho" -#define PRIo16 "ho" -#define PRIo32 "o" -#define PRIo64 __INTTYPE_PRI64__ "o" - -#define PRIu8 "hhu" -#define PRIu16 "hu" -#define PRIu32 "u" -#define PRIu64 __INTTYPE_PRI64__ "u" - -#define PRIx8 "hhx" -#define PRIx16 "hx" -#define PRIx32 "x" -#define PRIx64 __INTTYPE_PRI64__ "x" - -#define PRIX8 "hhX" -#define PRIX16 "hX" -#define PRIX32 "X" -#define PRIX64 __INTTYPE_PRI64__ "X" - -#define SCNd8 "hhd" -#define SCNd16 "hd" -#define SCNd32 "d" -#define SCNd64 __INTTYPE_PRI64__ "d" - -#define SCNi8 "hhi" -#define SCNi16 "hi" -#define SCNi32 "i" -#define SCNi64 __INTTYPE_PRI64__ "i" - -#define SCNo8 "hho" -#define SCNo16 "ho" -#define SCNo32 "o" -#define SCNo64 __INTTYPE_PRI64__ "o" - -#define SCNu8 "hhu" -#define SCNu16 "hu" -#define SCNu32 "u" -#define SCNu64 __INTTYPE_PRI64__ "u" - -#define SCNx8 "hhx" -#define SCNx16 "hx" -#define SCNx32 "x" -#define SCNx64 __INTTYPE_PRI64__ "x" - -#define SCNX8 "hhX" -#define SCNX16 "hX" -#define SCNX32 "X" -#define SCNX64 __INTTYPE_PRI64__ "X" - -#endif /* __INTTYPES_H__ */ diff --git a/src/compiler-rt/SDKs/darwin/usr/include/limits.h b/src/compiler-rt/SDKs/darwin/usr/include/limits.h deleted file mode 100644 index 5495a784f1..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/limits.h +++ /dev/null @@ -1,23 +0,0 @@ -/* ===-- limits.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __LIMITS_H__ -#define __LIMITS_H__ - -/* This is only here as a landing pad for the include_next from the compiler's - built-in limits.h. */ - -#endif /* __LIMITS_H__ */ diff --git a/src/compiler-rt/SDKs/darwin/usr/include/stdio.h b/src/compiler-rt/SDKs/darwin/usr/include/stdio.h deleted file mode 100644 index ab5f1a3b24..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/stdio.h +++ /dev/null @@ -1,90 +0,0 @@ -/* ===-- stdio.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __STDIO_H__ -#define __STDIO_H__ - -#if defined(__cplusplus) -extern "C" { -#endif - -typedef struct __sFILE FILE; -typedef __SIZE_TYPE__ size_t; - -/* Determine the appropriate fdopen, fopen(), and fwrite() functions. */ -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -# if defined(__i386) -# define __FDOPEN_NAME "_fdopen$UNIX2003" -# define __FOPEN_NAME "_fopen$UNIX2003" -# define __FWRITE_NAME "_fwrite$UNIX2003" -# elif defined(__x86_64__) -# define __FDOPEN_NAME "_fdopen" -# define __FOPEN_NAME "_fopen" -# define __FWRITE_NAME "_fwrite" -# elif defined(__arm) -# define __FDOPEN_NAME "_fdopen" -# define __FOPEN_NAME "_fopen" -# define __FWRITE_NAME "_fwrite" -# else -# error "unrecognized architecture for targetting OS X" -# endif -#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) -# if defined(__i386) || defined (__x86_64) -# define __FDOPEN_NAME "_fdopen" -# define __FOPEN_NAME "_fopen" -# define __FWRITE_NAME "_fwrite" -# elif defined(__arm) -# define __FDOPEN_NAME "_fdopen" -# define __FOPEN_NAME "_fopen" -# define __FWRITE_NAME "_fwrite" -# else -# error "unrecognized architecture for targetting iOS" -# endif -#else -# error "unrecognized architecture for targetting Darwin" -#endif - -# 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); -FILE *fdopen(int, const char *) __asm(__FDOPEN_NAME); -int fprintf(FILE * __restrict, const char * __restrict, ...); -int fputc(int, FILE *); -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__ */ diff --git a/src/compiler-rt/SDKs/darwin/usr/include/stdlib.h b/src/compiler-rt/SDKs/darwin/usr/include/stdlib.h deleted file mode 100644 index b6d3171cff..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/stdlib.h +++ /dev/null @@ -1,32 +0,0 @@ -/* ===-- stdlib.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __STDLIB_H__ -#define __STDLIB_H__ - -#define NULL ((void *)0) - -typedef __SIZE_TYPE__ size_t; - -void abort(void) __attribute__((__noreturn__)); -int atexit(void (*)(void)); -int atoi(const char *); -void free(void *); -char *getenv(const char *); -void *malloc(size_t); -void *realloc(void *, size_t); - -#endif /* __STDLIB_H__ */ diff --git a/src/compiler-rt/SDKs/darwin/usr/include/string.h b/src/compiler-rt/SDKs/darwin/usr/include/string.h deleted file mode 100644 index c6ab5d8e58..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/string.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ===-- string.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __STRING_H__ -#define __STRING_H__ - -typedef __SIZE_TYPE__ size_t; - -int memcmp(const void *, const void *, size_t); -void *memcpy(void *, const void *, size_t); -void *memset(void *, int, size_t); -char *strcat(char *, const char *); -char *strcpy(char *, const char *); -char *strdup(const char *); -size_t strlen(const char *); -char *strncpy(char *, const char *, size_t); - -/* Determine the appropriate strerror() function. */ -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -# if defined(__i386) -# define __STRERROR_NAME "_strerror$UNIX2003" -# elif defined(__x86_64__) || defined(__arm) -# define __STRERROR_NAME "_strerror" -# else -# error "unrecognized architecture for targetting OS X" -# endif -#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) -# if defined(__i386) || defined (__x86_64) || defined(__arm) -# define __STRERROR_NAME "_strerror" -# else -# error "unrecognized architecture for targetting iOS" -# endif -#else -# error "unrecognized architecture for targetting Darwin" -#endif - -char *strerror(int) __asm(__STRERROR_NAME); - -#endif /* __STRING_H__ */ diff --git a/src/compiler-rt/SDKs/darwin/usr/include/sys/errno.h b/src/compiler-rt/SDKs/darwin/usr/include/sys/errno.h deleted file mode 100644 index 4befe38553..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/sys/errno.h +++ /dev/null @@ -1,31 +0,0 @@ -/* ===-- errno.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef _SYS_ERRNO_H_ -#define _SYS_ERRNO_H_ - -#if defined(__cplusplus) -extern "C" { -#endif - -extern int *__error(void); -#define errno (*__error()) - -#if defined(__cplusplus) -} -#endif - -#endif diff --git a/src/compiler-rt/SDKs/darwin/usr/include/sys/fcntl.h b/src/compiler-rt/SDKs/darwin/usr/include/sys/fcntl.h deleted file mode 100644 index b71706bf45..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/sys/fcntl.h +++ /dev/null @@ -1,52 +0,0 @@ -/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef _SYS_FCNTL_H_ -#define _SYS_FCNTL_H_ - -/* Determine the appropriate open function. */ -#if defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) -# if defined(__i386) -# define __OPEN_NAME "_open$UNIX2003" -# elif defined(__x86_64__) -# define __OPEN_NAME "_open" -# elif defined(__arm) -# define __OPEN_NAME "_open" -# else -# error "unrecognized architecture for targetting OS X" -# endif -#elif defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) -# if defined(__i386) || defined (__x86_64) -# define __OPEN_NAME "_open" -# elif defined(__arm) -# define __OPEN_NAME "_open" -# else -# error "unrecognized architecture for targetting iOS" -# endif -#else -# error "unrecognized architecture for targetting Darwin" -#endif - -#define O_RDONLY 0x0000 /* open for reading only */ -#define O_WRONLY 0x0001 /* open for writing only */ -#define O_RDWR 0x0002 /* open for reading and writing */ -#define O_ACCMODE 0x0003 /* mask for above modes */ - -#define O_CREAT 0x0200 /* create if nonexistant */ - -int open(const char *, int, ...) __asm(__OPEN_NAME); - -#endif /* !_SYS_FCNTL_H_ */ diff --git a/src/compiler-rt/SDKs/darwin/usr/include/sys/mman.h b/src/compiler-rt/SDKs/darwin/usr/include/sys/mman.h deleted file mode 100644 index 84561f1b6a..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/sys/mman.h +++ /dev/null @@ -1,42 +0,0 @@ -/* ===-- mman.h - stub SDK header for compiler-rt ---------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __SYS_MMAN_H__ -#define __SYS_MMAN_H__ - -typedef __SIZE_TYPE__ size_t; - -#define PROT_NONE 0x00 -#define PROT_READ 0x01 -#define PROT_WRITE 0x02 -#define PROT_EXEC 0x04 - -#define MAP_SHARED 0x0001 -#define MAP_PRIVATE 0x0002 - -#define MAP_FILE 0x0000 -#define MAP_ANON 0x1000 - -#define MS_ASYNC 0x0001 -#define MS_INVALIDATE 0x0002 -#define MS_SYNC 0x0010 - -void *mmap(void *addr, size_t len, int prot, int flags, int fd, - long long offset); -int munmap(void *addr, size_t len); -int msync(void *addr, size_t len, int flags); - -#endif /* __SYS_MMAN_H__ */ diff --git a/src/compiler-rt/SDKs/darwin/usr/include/sys/stat.h b/src/compiler-rt/SDKs/darwin/usr/include/sys/stat.h deleted file mode 100644 index 6225f90816..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/sys/stat.h +++ /dev/null @@ -1,25 +0,0 @@ -/* ===-- stat.h - stub SDK header for compiler-rt ---------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __SYS_STAT_H__ -#define __SYS_STAT_H__ - -typedef unsigned short uint16_t; -typedef uint16_t mode_t; - -int mkdir(const char *, mode_t); - -#endif /* __SYS_STAT_H__ */ diff --git a/src/compiler-rt/SDKs/darwin/usr/include/sys/types.h b/src/compiler-rt/SDKs/darwin/usr/include/sys/types.h deleted file mode 100644 index b425767b83..0000000000 --- a/src/compiler-rt/SDKs/darwin/usr/include/sys/types.h +++ /dev/null @@ -1,20 +0,0 @@ -/* ===-- types.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __SYS_TYPES_H__ -#define __SYS_TYPES_H__ - -#endif /* __SYS_TYPES_H__ */ diff --git a/src/compiler-rt/SDKs/linux/README.txt b/src/compiler-rt/SDKs/linux/README.txt deleted file mode 100644 index aa0604af79..0000000000 --- a/src/compiler-rt/SDKs/linux/README.txt +++ /dev/null @@ -1,2 +0,0 @@ -This is a stub SDK for Linux. Currently, this has only been tested on i386 and -x86_64 using the Clang compiler. diff --git a/src/compiler-rt/SDKs/linux/usr/include/endian.h b/src/compiler-rt/SDKs/linux/usr/include/endian.h deleted file mode 100644 index 95528db157..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/endian.h +++ /dev/null @@ -1,29 +0,0 @@ -/* ===-- endian.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __ENDIAN_H__ -#define __ENDIAN_H__ - -#define __LITTLE_ENDIAN 1234 -#define __BIG_ENDIAN 4321 - -#if defined(__LITTLE_ENDIAN__) || defined(__ORDER_LITTLE_ENDIAN__) -#define __BYTE_ORDER __LITTLE_ENDIAN -#else -#define __BYTE_ORDER __BIG_ENDIAN -#endif - -#endif /* __ENDIAN_H__ */ diff --git a/src/compiler-rt/SDKs/linux/usr/include/fcntl.h b/src/compiler-rt/SDKs/linux/usr/include/fcntl.h deleted file mode 100644 index a5f91e3a5b..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/fcntl.h +++ /dev/null @@ -1,17 +0,0 @@ -/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#include diff --git a/src/compiler-rt/SDKs/linux/usr/include/limits.h b/src/compiler-rt/SDKs/linux/usr/include/limits.h deleted file mode 100644 index 5495a784f1..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/limits.h +++ /dev/null @@ -1,23 +0,0 @@ -/* ===-- limits.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __LIMITS_H__ -#define __LIMITS_H__ - -/* This is only here as a landing pad for the include_next from the compiler's - built-in limits.h. */ - -#endif /* __LIMITS_H__ */ diff --git a/src/compiler-rt/SDKs/linux/usr/include/stdio.h b/src/compiler-rt/SDKs/linux/usr/include/stdio.h deleted file mode 100644 index e2161daa46..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/stdio.h +++ /dev/null @@ -1,44 +0,0 @@ -/* ===-- stdio.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __STDIO_H__ -#define __STDIO_H__ - -typedef __SIZE_TYPE__ size_t; - -struct _IO_FILE; -typedef struct _IO_FILE FILE; - -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 FILE *fdopen(int, const char * restrict); -extern int fprintf(FILE * restrict, const char * restrict, ...); -extern int fputc(int, FILE *); -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__ */ diff --git a/src/compiler-rt/SDKs/linux/usr/include/stdlib.h b/src/compiler-rt/SDKs/linux/usr/include/stdlib.h deleted file mode 100644 index 966b29db6e..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/stdlib.h +++ /dev/null @@ -1,36 +0,0 @@ -/* ===-- stdlib.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __STDLIB_H__ -#define __STDLIB_H__ - -#define NULL ((void *)0) - -typedef __SIZE_TYPE__ size_t; - -void abort(void) __attribute__((__nothrow__)) __attribute__((__noreturn__)); -int atexit(void (*)(void)) __attribute__((__nothrow__)); -int atoi(const char *) __attribute__((__nothrow__)); -void free(void *) __attribute__((__nothrow__)); -char *getenv(const char *) __attribute__((__nothrow__)) - __attribute__((__nonnull__(1))); - __attribute__((__warn_unused_result__)); -void *malloc(size_t) __attribute__((__nothrow__)) __attribute((__malloc__)) - __attribute__((__warn_unused_result__)); -void *realloc(void *, size_t) __attribute__((__nothrow__)) __attribute((__malloc__)) - __attribute__((__warn_unused_result__)); - -#endif /* __STDLIB_H__ */ diff --git a/src/compiler-rt/SDKs/linux/usr/include/string.h b/src/compiler-rt/SDKs/linux/usr/include/string.h deleted file mode 100644 index c7da1f57ba..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/string.h +++ /dev/null @@ -1,31 +0,0 @@ -/* ===-- string.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __STRING_H__ -#define __STRING_H__ - -typedef __SIZE_TYPE__ size_t; - -int memcmp(const void *, const void *, size_t); -void *memcpy(void *, const void *, size_t); -void *memset(void *, int, size_t); -char *strcat(char *, const char *); -char *strcpy(char *, const char *); -char *strdup(const char *); -size_t strlen(const char *); -char *strncpy(char *, const char *, size_t); - -#endif /* __STRING_H__ */ diff --git a/src/compiler-rt/SDKs/linux/usr/include/sys/fcntl.h b/src/compiler-rt/SDKs/linux/usr/include/sys/fcntl.h deleted file mode 100644 index 1512bf9b4e..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/sys/fcntl.h +++ /dev/null @@ -1,29 +0,0 @@ -/* ===-- fcntl.h - stub SDK header for compiler-rt --------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef _SYS_FCNTL_H_ -#define _SYS_FCNTL_H_ - -#define O_RDONLY 0x0000 -#define O_WRONLY 0x0001 -#define O_RDWR 0x0002 -#define O_ACCMODE 0x0003 - -#define O_CREAT 0x0200 - -int open(const char *, int, ...); - -#endif /* _SYS_FCNTL_H_ */ diff --git a/src/compiler-rt/SDKs/linux/usr/include/sys/mman.h b/src/compiler-rt/SDKs/linux/usr/include/sys/mman.h deleted file mode 100644 index bfb7f8bb02..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/sys/mman.h +++ /dev/null @@ -1,47 +0,0 @@ -/* ===-- limits.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __SYS_MMAN_H__ -#define __SYS_MMAN_H__ - -typedef __SIZE_TYPE__ size_t; - -#define PROT_NONE 0x00 -#define PROT_READ 0x01 -#define PROT_WRITE 0x02 -#define PROT_EXEC 0x04 - -#define MAP_SHARED 0x0001 -#define MAP_PRIVATE 0x0002 - -#define MAP_FILE 0x0000 -#define MAP_ANON 0x1000 - -#define MS_ASYNC 0x0001 -#define MS_INVALIDATE 0x0002 -#define MS_SYNC 0x0010 - -extern void *mmap(void *addr, size_t len, int prot, int flags, int fd, - long long offset) - __attribute__((__nothrow__)); -extern int munmap(void *addr, size_t len) - __attribute__((__nothrow__)); -extern int msync(void *addr, size_t len, int flags) - __attribute__((__nothrow__)); -extern int mprotect (void *__addr, size_t __len, int __prot) - __attribute__((__nothrow__)); - -#endif /* __SYS_MMAN_H__ */ diff --git a/src/compiler-rt/SDKs/linux/usr/include/sys/stat.h b/src/compiler-rt/SDKs/linux/usr/include/sys/stat.h deleted file mode 100644 index 0449fddb06..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/sys/stat.h +++ /dev/null @@ -1,24 +0,0 @@ -/* ===-- stat.h - stub SDK header for compiler-rt ---------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __SYS_STAT_H__ -#define __SYS_STAT_H__ - -typedef unsigned int mode_t; - -int mkdir(const char *, mode_t); - -#endif /* __SYS_STAT_H__ */ diff --git a/src/compiler-rt/SDKs/linux/usr/include/sys/types.h b/src/compiler-rt/SDKs/linux/usr/include/sys/types.h deleted file mode 100644 index 10e74bbd0b..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/sys/types.h +++ /dev/null @@ -1,20 +0,0 @@ -/* ===-- stat.h - stub SDK header for compiler-rt ---------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __SYS_TYPES_H__ -#define __SYS_TYPES_H__ - -#endif /* __SYS_TYPES_H__ */ diff --git a/src/compiler-rt/SDKs/linux/usr/include/unistd.h b/src/compiler-rt/SDKs/linux/usr/include/unistd.h deleted file mode 100644 index 773b081d45..0000000000 --- a/src/compiler-rt/SDKs/linux/usr/include/unistd.h +++ /dev/null @@ -1,26 +0,0 @@ -/* ===-- unistd.h - stub SDK header for compiler-rt -------------------------=== - * - * The LLVM Compiler Infrastructure - * - * This file is dual licensed under the MIT and the University of Illinois Open - * Source Licenses. See LICENSE.TXT for details. - * - * ===-----------------------------------------------------------------------=== - * - * This is a stub SDK header file. This file is not part of the interface of - * this library nor an official version of the appropriate SDK header. It is - * intended only to stub the features of this header required by compiler-rt. - * - * ===-----------------------------------------------------------------------=== - */ - -#ifndef __UNISTD_H__ -#define __UNISTD_H__ - -enum { - _SC_PAGESIZE = 30 -}; - -extern long int sysconf (int __name) __attribute__ ((__nothrow__)); - -#endif /* __UNISTD_H__ */ diff --git a/src/compiler-rt/android/README.LLVM b/src/compiler-rt/android/README.LLVM deleted file mode 100644 index 4a249e570d..0000000000 --- a/src/compiler-rt/android/README.LLVM +++ /dev/null @@ -1,9 +0,0 @@ -LLVM notes ----------- - -This directory contains Android header ucontext.h missing from the NDK. -This version of the header was copied from google-breakpad at r1279. - -Local changes: - * Re-licensed under the standard dual license of compiler-rt. - diff --git a/src/compiler-rt/android/include/sys/ucontext.h b/src/compiler-rt/android/include/sys/ucontext.h deleted file mode 100644 index 81e65a5c5d..0000000000 --- a/src/compiler-rt/android/include/sys/ucontext.h +++ /dev/null @@ -1,154 +0,0 @@ -//===-- ucontext.h ----------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -// ===----------------------------------------------------------------------=== - -#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_UCONTEXT_H -#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_UCONTEXT_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -#ifndef __BIONIC_HAVE_UCONTEXT_T - -// Ensure that 'stack_t' is defined. -#include - -// This version of the Android C library headers do not provide ucontext_t. -// Provide custom definitions for Google Breakpad. -#if defined(__arm__) - -// Ensure that 'struct sigcontext' is defined. -#include -typedef struct sigcontext mcontext_t; - -// The ARM kernel uses a 64-bit signal mask. -typedef uint32_t kernel_sigmask_t[2]; - -typedef struct ucontext { - uint32_t uc_flags; - struct ucontext* uc_link; - stack_t uc_stack; - mcontext_t uc_mcontext; - kernel_sigmask_t uc_sigmask; - // Other fields are not used by Google Breakpad. Don't define them. -} ucontext_t; - -#elif defined(__i386__) - -/* 80-bit floating-point register */ -struct _libc_fpreg { - unsigned short significand[4]; - unsigned short exponent; -}; - -/* Simple floating-point state, see FNSTENV instruction */ -struct _libc_fpstate { - unsigned long cw; - unsigned long sw; - unsigned long tag; - unsigned long ipoff; - unsigned long cssel; - unsigned long dataoff; - unsigned long datasel; - struct _libc_fpreg _st[8]; - unsigned long status; -}; - -typedef uint32_t greg_t; - -typedef struct { - uint32_t gregs[19]; - struct _libc_fpstate* fpregs; - uint32_t oldmask; - uint32_t cr2; -} mcontext_t; - -enum { - REG_GS = 0, - REG_FS, - REG_ES, - REG_DS, - REG_EDI, - REG_ESI, - REG_EBP, - REG_ESP, - REG_EBX, - REG_EDX, - REG_ECX, - REG_EAX, - REG_TRAPNO, - REG_ERR, - REG_EIP, - REG_CS, - REG_EFL, - REG_UESP, - REG_SS, -}; - -// The i386 kernel uses a 64-bit signal mask. -typedef uint32_t kernel_sigmask_t[2]; - -typedef struct ucontext { - uint32_t uc_flags; - struct ucontext* uc_link; - stack_t uc_stack; - mcontext_t uc_mcontext; - kernel_sigmask_t uc_sigmask; - struct _libc_fpstate __fpregs_mem; -} ucontext_t; - -#elif defined(__mips__) - -typedef struct { - uint32_t regmask; - uint32_t status; - uint64_t pc; - uint64_t gregs[32]; - uint64_t fpregs[32]; - uint32_t acx; - uint32_t fpc_csr; - uint32_t fpc_eir; - uint32_t used_math; - uint32_t dsp; - uint64_t mdhi; - uint64_t mdlo; - uint32_t hi1; - uint32_t lo1; - uint32_t hi2; - uint32_t lo2; - uint32_t hi3; - uint32_t lo3; -} mcontext_t; - -// The MIPS kernel uses a 128-bit signal mask. -typedef uint32_t kernel_sigmask_t[4]; - -typedef struct ucontext { - uint32_t uc_flags; - struct ucontext* uc_link; - stack_t uc_stack; - mcontext_t uc_mcontext; - kernel_sigmask_t uc_sigmask; - // Other fields are not used by Google Breakpad. Don't define them. -} ucontext_t; - -#else -# error "Unsupported Android CPU ABI!" -#endif - -#endif // __BIONIC_HAVE_UCONTEXT_T - -#ifdef __cplusplus -} // extern "C" -#endif // __cplusplus - -#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_SYS_UCONTEXT_H diff --git a/src/compiler-rt/android/include/ucontext.h b/src/compiler-rt/android/include/ucontext.h deleted file mode 100644 index 178ddf3d4f..0000000000 --- a/src/compiler-rt/android/include/ucontext.h +++ /dev/null @@ -1,36 +0,0 @@ -//===-- ucontext.h ----------------------------------------------*- C++ -*-===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -// ===----------------------------------------------------------------------=== - -#ifndef GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_UCONTEXT_H -#define GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_UCONTEXT_H - -#include - -#ifdef __BIONIC_UCONTEXT_H -#include -#else - -#include - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -// Provided by src/android/common/breakpad_getcontext.S -int breakpad_getcontext(ucontext_t* ucp); - -#define getcontext(x) breakpad_getcontext(x) - -#ifdef __cplusplus -} // extern "C" -#endif // __cplusplus - -#endif // __BIONIC_UCONTEXT_H - -#endif // GOOGLE_BREAKPAD_COMMON_ANDROID_INCLUDE_UCONTEXT_H diff --git a/src/compiler-rt/cmake/Modules/AddCompilerRT.cmake b/src/compiler-rt/cmake/Modules/AddCompilerRT.cmake index 82947eac4e..284cf1de70 100644 --- a/src/compiler-rt/cmake/Modules/AddCompilerRT.cmake +++ b/src/compiler-rt/cmake/Modules/AddCompilerRT.cmake @@ -1,142 +1,235 @@ include(AddLLVM) -include(LLVMParseArguments) +include(ExternalProject) 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 -# DEFS ) -macro(add_compiler_rt_object_library name arch) - if(CAN_TARGET_${arch}) - parse_arguments(LIB "SOURCES;CFLAGS;DEFS" "" ${ARGN}) - add_library(${name}.${arch} OBJECT ${LIB_SOURCES}) - set_target_compile_flags(${name}.${arch} - ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) - set_property(TARGET ${name}.${arch} APPEND PROPERTY - COMPILE_DEFINITIONS ${LIB_DEFS}) +# Tries to add an "object library" target for a given list of OSs and/or +# architectures with name "." for non-Darwin platforms if +# architecture can be targeted, and "." for Darwin platforms. +# add_compiler_rt_object_libraries( +# OS +# ARCHS +# SOURCES +# CFLAGS +# DEFS ) +function(add_compiler_rt_object_libraries name) + cmake_parse_arguments(LIB "" "" "OS;ARCHS;SOURCES;CFLAGS;DEFS" ${ARGN}) + set(libnames) + if(APPLE) + foreach(os ${LIB_OS}) + set(libname "${name}.${os}") + set(libnames ${libnames} ${libname}) + set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS}) + list_union(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) + endforeach() else() - message(FATAL_ERROR "Archtecture ${arch} can't be targeted") + foreach(arch ${LIB_ARCHS}) + set(libname "${name}.${arch}") + set(libnames ${libnames} ${libname}) + set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS}) + if(NOT CAN_TARGET_${arch}) + message(FATAL_ERROR "Architecture ${arch} can't be targeted") + return() + endif() + endforeach() endif() -endmacro() + + foreach(libname ${libnames}) + add_library(${libname} OBJECT ${LIB_SOURCES}) + set_target_compile_flags(${libname} + ${CMAKE_CXX_FLAGS} ${extra_cflags_${libname}} ${LIB_CFLAGS}) + set_property(TARGET ${libname} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + if(APPLE) + set_target_properties(${libname} PROPERTIES + OSX_ARCHITECTURES "${LIB_ARCHS_${libname}}") + endif() + endforeach() +endfunction() -# Same as above, but adds universal osx library for either OSX or iOS simulator -# with name "." targeting multiple architectures. -# add_compiler_rt_darwin_object_library( ARCH -# SOURCES -# CFLAGS -# DEFS ) -macro(add_compiler_rt_darwin_object_library name os) - parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN}) - set(libname "${name}.${os}") - add_library(${libname} OBJECT ${LIB_SOURCES}) - set_target_compile_flags(${libname} ${LIB_CFLAGS} ${DARWIN_${os}_CFLAGS}) - set_target_properties(${libname} PROPERTIES OSX_ARCHITECTURES "${LIB_ARCH}") - set_property(TARGET ${libname} APPEND PROPERTY - COMPILE_DEFINITIONS ${LIB_DEFS}) +# Takes a list of object library targets, and a suffix and appends the proper +# TARGET_OBJECTS string to the output variable. +# format_object_libs( ...) +macro(format_object_libs output suffix) + foreach(lib ${ARGN}) + list(APPEND ${output} $) + endforeach() endmacro() -# Adds static or shared runtime for a given architecture and puts it in the -# proper directory in the build and install trees. -# add_compiler_rt_runtime( {STATIC,SHARED} +# Adds static or shared runtime for a list of architectures and operating +# systems and puts it in the proper directory in the build and install trees. +# add_compiler_rt_runtime( +# {STATIC|SHARED} +# ARCHS +# OS # SOURCES # CFLAGS -# DEFS ) -macro(add_compiler_rt_runtime name arch type) - if(CAN_TARGET_${arch}) - parse_arguments(LIB "SOURCES;CFLAGS;DEFS;OUTPUT_NAME" "" ${ARGN}) - add_library(${name} ${type} ${LIB_SOURCES}) - # Setup compile flags and definitions. - set_target_compile_flags(${name} - ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) - set_target_link_flags(${name} - ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) - set_property(TARGET ${name} APPEND PROPERTY - COMPILE_DEFINITIONS ${LIB_DEFS}) - # Setup correct output directory in the build tree. - set_target_properties(${name} PROPERTIES - ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} - LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) - if (LIB_OUTPUT_NAME) - set_target_properties(${name} PROPERTIES - OUTPUT_NAME ${LIB_OUTPUT_NAME}) - endif() - # Add installation command. - install(TARGETS ${name} - ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} - LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) +# LINKFLAGS +# DEFS +# LINK_LIBS (only for shared library) +# OBJECT_LIBS +# PARENT_TARGET ) +function(add_compiler_rt_runtime name type) + if(NOT type MATCHES "^(STATIC|SHARED)$") + message(FATAL_ERROR "type argument must be STATIC or SHARED") + return() + endif() + cmake_parse_arguments(LIB + "" + "PARENT_TARGET" + "OS;ARCHS;SOURCES;CFLAGS;LINKFLAGS;DEFS;LINK_LIBS;OBJECT_LIBS" + ${ARGN}) + set(libnames) + if(APPLE) + foreach(os ${LIB_OS}) + if(type STREQUAL "STATIC") + set(libname "${name}_${os}") + else() + set(libname "${name}_${os}_dynamic") + set(extra_linkflags_${libname} ${DARWIN_${os}_LINKFLAGS} ${LIB_LINKFLAGS}) + endif() + list_union(LIB_ARCHS_${libname} DARWIN_${os}_ARCHS LIB_ARCHS) + if(LIB_ARCHS_${libname}) + list(APPEND libnames ${libname}) + set(extra_cflags_${libname} ${DARWIN_${os}_CFLAGS} ${LIB_CFLAGS}) + set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) + set(sources_${libname} ${LIB_SOURCES}) + format_object_libs(sources_${libname} ${os} ${LIB_OBJECT_LIBS}) + endif() + endforeach() else() - message(FATAL_ERROR "Archtecture ${arch} can't be targeted") + foreach(arch ${LIB_ARCHS}) + if(NOT CAN_TARGET_${arch}) + message(FATAL_ERROR "Architecture ${arch} can't be targeted") + return() + endif() + if(type STREQUAL "STATIC") + set(libname "${name}-${arch}") + set(output_name_${libname} ${libname}${COMPILER_RT_OS_SUFFIX}) + else() + set(libname "${name}-dynamic-${arch}") + set(extra_linkflags_${libname} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS} ${LIB_LINKFLAGS}) + if(WIN32) + set(output_name_${libname} ${name}_dynamic-${arch}${COMPILER_RT_OS_SUFFIX}) + else() + set(output_name_${libname} ${name}-${arch}${COMPILER_RT_OS_SUFFIX}) + endif() + endif() + set(sources_${libname} ${LIB_SOURCES}) + format_object_libs(sources_${libname} ${arch} ${LIB_OBJECT_LIBS}) + set(libnames ${libnames} ${libname}) + set(extra_cflags_${libname} ${TARGET_${arch}_CFLAGS} ${LIB_CFLAGS}) + endforeach() endif() -endmacro() -# Same as add_compiler_rt_runtime(... STATIC), but creates a universal library -# for several architectures. -# add_compiler_rt_osx_static_runtime( ARCH -# SOURCES -# CFLAGS -# DEFS ) -macro(add_compiler_rt_osx_static_runtime name) - parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS" "" ${ARGN}) - add_library(${name} STATIC ${LIB_SOURCES}) - set_target_compile_flags(${name} ${LIB_CFLAGS}) - set_property(TARGET ${name} APPEND PROPERTY - COMPILE_DEFINITIONS ${LIB_DEFS}) - set_target_properties(${name} PROPERTIES - OSX_ARCHITECTURES "${LIB_ARCH}" - ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) - install(TARGETS ${name} - ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) -endmacro() + if(NOT libnames) + return() + endif() -# Adds dynamic runtime library on osx/iossim, which supports multiple -# architectures. -# add_compiler_rt_darwin_dynamic_runtime( -# ARCH -# SOURCES -# CFLAGS -# DEFS -# LINKFLAGS ) -macro(add_compiler_rt_darwin_dynamic_runtime name os) - parse_arguments(LIB "ARCH;SOURCES;CFLAGS;DEFS;LINKFLAGS" "" ${ARGN}) - add_library(${name} SHARED ${LIB_SOURCES}) - set_target_compile_flags(${name} ${LIB_CFLAGS} ${DARWIN_${os}_CFLAGS}) - set_target_link_flags(${name} ${LIB_LINKFLAGS} ${DARWIN_${os}_LINKFLAGS}) - set_property(TARGET ${name} APPEND PROPERTY - COMPILE_DEFINITIONS ${LIB_DEFS}) - set_target_properties(${name} PROPERTIES - OSX_ARCHITECTURES "${LIB_ARCH}" - LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) - install(TARGETS ${name} - LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) -endmacro() + if(LIB_PARENT_TARGET) + set(COMPONENT_OPTION COMPONENT ${LIB_PARENT_TARGET}) + endif() + + foreach(libname ${libnames}) + add_library(${libname} ${type} ${sources_${libname}}) + set_target_compile_flags(${libname} ${extra_cflags_${libname}}) + set_target_link_flags(${libname} ${extra_linkflags_${libname}}) + set_property(TARGET ${libname} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + set_target_properties(${libname} PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + LIBRARY_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + RUNTIME_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + set_target_properties(${libname} PROPERTIES + OUTPUT_NAME ${output_name_${libname}}) + if(LIB_LINK_LIBS AND ${type} STREQUAL "SHARED") + target_link_libraries(${libname} ${LIB_LINK_LIBS}) + endif() + install(TARGETS ${libname} + ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} + ${COMPONENT_OPTION} + LIBRARY DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} + ${COMPONENT_OPTION} + RUNTIME DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR} + ${COMPONENT_OPTION}) + if(APPLE) + set_target_properties(${libname} PROPERTIES + OSX_ARCHITECTURES "${LIB_ARCHS_${libname}}") + endif() + endforeach() + if(LIB_PARENT_TARGET) + add_dependencies(${LIB_PARENT_TARGET} ${libnames}) + endif() +endfunction() + +set(COMPILER_RT_TEST_CFLAGS) # Unittests support. set(COMPILER_RT_GTEST_PATH ${LLVM_MAIN_SRC_DIR}/utils/unittest/googletest) set(COMPILER_RT_GTEST_SOURCE ${COMPILER_RT_GTEST_PATH}/src/gtest-all.cc) set(COMPILER_RT_GTEST_CFLAGS -DGTEST_NO_LLVM_RAW_OSTREAM=1 + -DGTEST_HAS_RTTI=0 -I${COMPILER_RT_GTEST_PATH}/include -I${COMPILER_RT_GTEST_PATH} ) +append_list_if(COMPILER_RT_DEBUG -DSANITIZER_DEBUG=1 COMPILER_RT_TEST_CFLAGS) + +if(MSVC) + # clang doesn't support exceptions on Windows yet. + list(APPEND COMPILER_RT_TEST_CFLAGS -D_HAS_EXCEPTIONS=0) + + # We should teach clang to understand "#pragma intrinsic", see PR19898. + list(APPEND COMPILER_RT_TEST_CFLAGS -Wno-undefined-inline) + + # Clang doesn't support SEH on Windows yet. + list(APPEND COMPILER_RT_GTEST_CFLAGS -DGTEST_HAS_SEH=0) + + # gtest use a lot of stuff marked as deprecated on Windows. + list(APPEND COMPILER_RT_GTEST_CFLAGS -Wno-deprecated-declarations) + + # Visual Studio 2012 only supports up to 8 template parameters in + # std::tr1::tuple by default, but gtest requires 10 + if(MSVC_VERSION EQUAL 1700) + list(APPEND COMPILER_RT_GTEST_CFLAGS -D_VARIADIC_MAX=10) + endif() +endif() + # Link objects into a single executable with COMPILER_RT_TEST_COMPILER, # using specified link flags. Make executable a part of provided # test_suite. # add_compiler_rt_test( +# SUBDIR # OBJECTS # DEPS # LINK_FLAGS ) macro(add_compiler_rt_test test_suite test_name) - parse_arguments(TEST "OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN}) - set(output_bin "${CMAKE_CURRENT_BINARY_DIR}/${test_name}") + cmake_parse_arguments(TEST "" "SUBDIR" "OBJECTS;DEPS;LINK_FLAGS" "" ${ARGN}) + if(TEST_SUBDIR) + set(output_bin "${CMAKE_CURRENT_BINARY_DIR}/${TEST_SUBDIR}/${test_name}") + else() + set(output_bin "${CMAKE_CURRENT_BINARY_DIR}/${test_name}") + endif() + if(MSVC) + set(output_bin "${output_bin}.exe") + endif() # Use host compiler in a standalone build, and just-built Clang otherwise. if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND TEST_DEPS clang) endif() + # If we're not on MSVC, include the linker flags from CMAKE but override them + # with the provided link flags. This ensures that flags which are required to + # link programs at all are included, but the changes needed for the test + # trump. With MSVC we can't do that because CMake is set up to run link.exe + # when linking, not the compiler. Here, we hack it to use the compiler + # because we want to use -fsanitize flags. + if(NOT MSVC) + set(TEST_LINK_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${TEST_LINK_FLAGS}") + separate_arguments(TEST_LINK_FLAGS) + endif() add_custom_target(${test_name} - COMMAND ${COMPILER_RT_TEST_COMPILER} ${TEST_OBJECTS} -o "${output_bin}" + COMMAND ${COMPILER_RT_TEST_COMPILER} ${TEST_OBJECTS} + -o "${output_bin}" ${TEST_LINK_FLAGS} DEPENDS ${TEST_DEPS}) # Make the test suite depend on the binary. @@ -167,3 +260,52 @@ macro(add_compiler_rt_script name) PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE DESTINATION ${COMPILER_RT_INSTALL_PATH}/bin) endmacro(add_compiler_rt_script src name) + +# Builds custom version of libc++ and installs it in . +# Can be used to build sanitized versions of libc++ for running unit tests. +# add_custom_libcxx( +# DEPS +# CFLAGS ) +macro(add_custom_libcxx name prefix) + if(NOT COMPILER_RT_HAS_LIBCXX_SOURCES) + message(FATAL_ERROR "libcxx not found!") + endif() + + cmake_parse_arguments(LIBCXX "" "" "DEPS;CFLAGS" ${ARGN}) + foreach(flag ${LIBCXX_CFLAGS}) + set(flagstr "${flagstr} ${flag}") + endforeach() + set(LIBCXX_CFLAGS ${flagstr}) + + if(NOT COMPILER_RT_STANDALONE_BUILD) + list(APPEND LIBCXX_DEPS clang) + endif() + + ExternalProject_Add(${name} + PREFIX ${prefix} + SOURCE_DIR ${COMPILER_RT_LIBCXX_PATH} + CMAKE_ARGS -DCMAKE_C_COMPILER=${COMPILER_RT_TEST_COMPILER} + -DCMAKE_CXX_COMPILER=${COMPILER_RT_TEST_COMPILER} + -DCMAKE_C_FLAGS=${LIBCXX_CFLAGS} + -DCMAKE_CXX_FLAGS=${LIBCXX_CFLAGS} + -DCMAKE_BUILD_TYPE=Release + -DCMAKE_INSTALL_PREFIX:PATH= + LOG_BUILD 1 + LOG_CONFIGURE 1 + LOG_INSTALL 1 + ) + set_target_properties(${name} PROPERTIES EXCLUDE_FROM_ALL TRUE) + + ExternalProject_Add_Step(${name} force-reconfigure + DEPENDERS configure + ALWAYS 1 + ) + + ExternalProject_Add_Step(${name} clobber + COMMAND ${CMAKE_COMMAND} -E remove_directory + COMMAND ${CMAKE_COMMAND} -E make_directory + COMMENT "Clobberring ${name} build directory..." + DEPENDERS configure + DEPENDS ${LIBCXX_DEPS} + ) +endmacro() diff --git a/src/compiler-rt/cmake/Modules/CompilerRTCompile.cmake b/src/compiler-rt/cmake/Modules/CompilerRTCompile.cmake index b3482e9ce8..850d109c26 100644 --- a/src/compiler-rt/cmake/Modules/CompilerRTCompile.cmake +++ b/src/compiler-rt/cmake/Modules/CompilerRTCompile.cmake @@ -1,4 +1,41 @@ -include(LLVMParseArguments) +# On Windows, CMAKE_*_FLAGS are built for MSVC but we use the GCC clang.exe, +# which uses completely different flags. Translate some common flag types, and +# drop the rest. +function(translate_msvc_cflags out_flags msvc_flags) + # Insert an empty string in the list to simplify processing. + set(msvc_flags ";${msvc_flags}") + + # Canonicalize /flag to -flag. + string(REPLACE ";/" ";-" msvc_flags "${msvc_flags}") + + # Make space separated -D and -U flags into joined flags. + string(REGEX REPLACE ";-\([DU]\);" ";-\\1" msvc_flags "${msvc_flags}") + + set(clang_flags "") + foreach(flag ${msvc_flags}) + if ("${flag}" MATCHES "^-[DU]") + # Pass through basic command line macro definitions (-DNDEBUG). + list(APPEND clang_flags "${flag}") + elseif ("${flag}" MATCHES "^-O[2x]") + # Canonicalize normal optimization flags to -O2. + list(APPEND clang_flags "-O2") + endif() + endforeach() + set(${out_flags} "${clang_flags}" PARENT_SCOPE) +endfunction() + +if (APPLE) + # On Darwin if /usr/include doesn't exist, the user probably has Xcode but not + # the command line tools. If this is the case, we need to find the OS X + # sysroot to pass to clang. + if(NOT EXISTS /usr/include) + execute_process(COMMAND xcodebuild -version -sdk macosx Path + OUTPUT_VARIABLE OSX_SYSROOT + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + set(OSX_SYSROOT_FLAG "-isysroot${OSX_SYSROOT}") + endif() +endif() # Compile a source into an object file with COMPILER_RT_TEST_COMPILER using # a provided compile flags and dependenices. @@ -6,10 +43,13 @@ include(LLVMParseArguments) # CFLAGS # DEPS ) macro(clang_compile object_file source) - parse_arguments(SOURCE "CFLAGS;DEPS" "" ${ARGN}) + cmake_parse_arguments(SOURCE "" "" "CFLAGS;DEPS" ${ARGN}) get_filename_component(source_rpath ${source} REALPATH) if(NOT COMPILER_RT_STANDALONE_BUILD) - list(APPEND SOURCE_DEPS clang) + list(APPEND SOURCE_DEPS clang compiler-rt-headers) + endif() + if (TARGET CompilerRTUnitTestCheckCxx) + list(APPEND SOURCE_DEPS CompilerRTUnitTestCheckCxx) endif() string(REGEX MATCH "[.](cc|cpp)$" is_cxx ${source_rpath}) if(is_cxx) @@ -17,14 +57,64 @@ macro(clang_compile object_file source) else() string(REPLACE " " ";" global_flags "${CMAKE_C_FLAGS}") endif() + + if (MSVC) + translate_msvc_cflags(global_flags "${global_flags}") + endif() + + if (APPLE) + set(global_flags ${OSX_SYSROOT_FLAG} ${global_flags}) + endif() + # Ignore unknown warnings. CMAKE_CXX_FLAGS may contain GCC-specific options # which are not supported by Clang. list(APPEND global_flags -Wno-unknown-warning-option) set(compile_flags ${global_flags} ${SOURCE_CFLAGS}) add_custom_command( OUTPUT ${object_file} - COMMAND ${COMPILER_RT_TEST_COMPILER} ${compile_flags} -c -o "${object_file}" + COMMAND ${COMPILER_RT_TEST_COMPILER} ${compile_flags} -c + -o "${object_file}" ${source_rpath} MAIN_DEPENDENCY ${source} DEPENDS ${SOURCE_DEPS}) endmacro() + +# On Darwin, there are no system-wide C++ headers and the just-built clang is +# therefore not able to compile C++ files unless they are copied/symlinked into +# ${LLVM_BINARY_DIR}/include/c++ +# The just-built clang is used to build compiler-rt unit tests. Let's detect +# this before we try to build the tests and print out a suggestion how to fix +# it. +# On other platforms, this is currently not an issue. +macro(clang_compiler_add_cxx_check) + if (APPLE) + set(CMD + "echo '#include ' | ${COMPILER_RT_TEST_COMPILER} ${OSX_SYSROOT_FLAG} -E -x c++ - > /dev/null" + "if [ $? != 0 ] " + " then echo" + " echo 'Your just-built clang cannot find C++ headers, which are needed to build and run compiler-rt tests.'" + " echo 'You should copy or symlink your system C++ headers into ${LLVM_BINARY_DIR}/include/c++'" + " if [ -d $(dirname $(dirname $(xcrun -f clang)))/include/c++ ]" + " then echo 'e.g. with:'" + " echo ' cp -r' $(dirname $(dirname $(xcrun -f clang)))/include/c++ '${LLVM_BINARY_DIR}/include/'" + " elif [ -d $(dirname $(dirname $(xcrun -f clang)))/lib/c++ ]" + " then echo 'e.g. with:'" + " echo ' cp -r' $(dirname $(dirname $(xcrun -f clang)))/lib/c++ '${LLVM_BINARY_DIR}/include/'" + " fi" + " echo 'This can also be fixed by checking out the libcxx project from llvm.org and installing the headers'" + " echo 'into your build directory:'" + " echo ' cd ${LLVM_SOURCE_DIR}/projects && svn co http://llvm.org/svn/llvm-project/libcxx/trunk libcxx'" + " echo ' cd ${LLVM_BINARY_DIR} && make -C ${LLVM_SOURCE_DIR}/projects/libcxx installheaders HEADER_DIR=${LLVM_BINARY_DIR}/include'" + " echo" + " false" + "fi" + ) + add_custom_target(CompilerRTUnitTestCheckCxx + COMMAND bash -c "${CMD}" + COMMENT "Checking that just-built clang can find C++ headers..." + VERBATIM) + if (TARGET clang) + ADD_DEPENDENCIES(CompilerRTUnitTestCheckCxx clang) + endif() + endif() +endmacro() diff --git a/src/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake b/src/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake new file mode 100644 index 0000000000..c52ba09b8f --- /dev/null +++ b/src/compiler-rt/cmake/Modules/CompilerRTDarwinUtils.cmake @@ -0,0 +1,434 @@ +# On OS X SDKs can be installed anywhere on the base system and xcode-select can +# set the default Xcode to use. This function finds the SDKs that are present in +# the current Xcode. +function(find_darwin_sdk_dir var sdk_name) + # Let's first try the internal SDK, otherwise use the public SDK. + execute_process( + COMMAND xcodebuild -version -sdk ${sdk_name}.internal Path + OUTPUT_VARIABLE var_internal + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_FILE /dev/null + ) + if("" STREQUAL "${var_internal}") + execute_process( + COMMAND xcodebuild -version -sdk ${sdk_name} Path + OUTPUT_VARIABLE var_internal + OUTPUT_STRIP_TRAILING_WHITESPACE + ERROR_FILE /dev/null + ) + endif() + set(${var} ${var_internal} PARENT_SCOPE) +endfunction() + +# There isn't a clear mapping of what architectures are supported with a given +# target platform, but ld's version output does list the architectures it can +# link for. +function(darwin_get_toolchain_supported_archs output_var) + execute_process( + COMMAND ld -v + ERROR_VARIABLE LINKER_VERSION) + + string(REGEX MATCH "configured to support archs: ([^\n]+)" + ARCHES_MATCHED "${LINKER_VERSION}") + if(ARCHES_MATCHED) + set(ARCHES "${CMAKE_MATCH_1}") + message(STATUS "Got ld supported ARCHES: ${ARCHES}") + string(REPLACE " " ";" ARCHES ${ARCHES}) + else() + # If auto-detecting fails, fall back to a default set + message(WARNING "Detecting supported architectures from 'ld -v' failed. Returning default set.") + set(ARCHES "i386;x86_64;armv7;armv7s;arm64") + endif() + + set(${output_var} ${ARCHES} PARENT_SCOPE) +endfunction() + +# This function takes an OS and a list of architectures and identifies the +# subset of the architectures list that the installed toolchain can target. +function(darwin_test_archs os valid_archs) + set(archs ${ARGN}) + message(STATUS "Finding valid architectures for ${os}...") + set(SIMPLE_CPP ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/src.cpp) + file(WRITE ${SIMPLE_CPP} "#include \nint main() { std::cout << std::endl; return 0; }\n") + + set(os_linker_flags) + foreach(flag ${DARWIN_${os}_LINKFLAGS}) + set(os_linker_flags "${os_linker_flags} ${flag}") + endforeach() + + # The simple program will build for x86_64h on the simulator because it is + # compatible with x86_64 libraries (mostly), but since x86_64h isn't actually + # a valid or useful architecture for the iOS simulator we should drop it. + if(${os} STREQUAL "iossim") + list(REMOVE_ITEM archs "x86_64h") + endif() + + set(working_archs) + foreach(arch ${archs}) + + set(arch_linker_flags "-arch ${arch} ${os_linker_flags}") + try_compile(CAN_TARGET_${os}_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_CPP} + COMPILE_DEFINITIONS "-v -arch ${arch}" ${DARWIN_${os}_CFLAGS} + CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS=${arch_linker_flags}" + OUTPUT_VARIABLE TEST_OUTPUT) + if(${CAN_TARGET_${os}_${arch}}) + list(APPEND working_archs ${arch}) + endif() + endforeach() + set(${valid_archs} ${working_archs} PARENT_SCOPE) +endfunction() + +# This function checks the host cpusubtype to see if it is post-haswell. Haswell +# and later machines can run x86_64h binaries. Haswell is cpusubtype 8. +function(darwin_filter_host_archs input output) + list_union(tmp_var DARWIN_osx_ARCHS ${input}) + execute_process( + COMMAND sysctl hw.cpusubtype + OUTPUT_VARIABLE SUBTYPE) + + string(REGEX MATCH "hw.cpusubtype: ([0-9]*)" + SUBTYPE_MATCHED "${SUBTYPE}") + set(HASWELL_SUPPORTED Off) + if(SUBTYPE_MATCHED) + if(${CMAKE_MATCH_1} GREATER 7) + set(HASWELL_SUPPORTED On) + endif() + endif() + if(NOT HASWELL_SUPPORTED) + list(REMOVE_ITEM tmp_var x86_64h) + endif() + set(${output} ${tmp_var} PARENT_SCOPE) +endfunction() + +# Read and process the exclude file into a list of symbols +function(darwin_read_list_from_file output_var file) + if(EXISTS ${file}) + file(READ ${file} EXCLUDES) + string(REPLACE "\n" ";" EXCLUDES ${EXCLUDES}) + set(${output_var} ${EXCLUDES} PARENT_SCOPE) + endif() +endfunction() + +# this function takes an OS, architecture and minimum version and provides a +# list of builtin functions to exclude +function(darwin_find_excluded_builtins_list output_var) + cmake_parse_arguments(LIB + "" + "OS;ARCH;MIN_VERSION" + "" + ${ARGN}) + + if(NOT LIB_OS OR NOT LIB_ARCH) + message(FATAL_ERROR "Must specify OS and ARCH to darwin_find_excluded_builtins_list!") + endif() + + darwin_read_list_from_file(${LIB_OS}_BUILTINS + ${DARWIN_EXCLUDE_DIR}/${LIB_OS}.txt) + darwin_read_list_from_file(${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS + ${DARWIN_EXCLUDE_DIR}/${LIB_OS}-${LIB_ARCH}.txt) + + if(LIB_MIN_VERSION) + file(GLOB builtin_lists ${DARWIN_EXCLUDE_DIR}/${LIB_OS}*-${LIB_ARCH}.txt) + foreach(builtin_list ${builtin_lists}) + string(REGEX MATCH "${LIB_OS}([0-9\\.]*)-${LIB_ARCH}.txt" VERSION_MATCHED "${builtin_list}") + if (VERSION_MATCHED AND NOT CMAKE_MATCH_1 VERSION_LESS LIB_MIN_VERSION) + if(NOT smallest_version) + set(smallest_version ${CMAKE_MATCH_1}) + elseif(CMAKE_MATCH_1 VERSION_LESS smallest_version) + set(smallest_version ${CMAKE_MATCH_1}) + endif() + endif() + endforeach() + + if(smallest_version) + darwin_read_list_from_file(${LIB_ARCH}_${LIB_OS}_BUILTINS + ${DARWIN_EXCLUDE_DIR}/${LIB_OS}${smallest_version}-${LIB_ARCH}.txt) + endif() + endif() + + set(${output_var} + ${${LIB_ARCH}_${LIB_OS}_BUILTINS} + ${${LIB_OS}_${LIB_ARCH}_BASE_BUILTINS} + ${${LIB_OS}_BUILTINS} PARENT_SCOPE) +endfunction() + +# adds a single builtin library for a single OS & ARCH +macro(darwin_add_builtin_library name suffix) + cmake_parse_arguments(LIB + "" + "PARENT_TARGET;OS;ARCH" + "SOURCES;CFLAGS;DEFS" + ${ARGN}) + set(libname "${name}.${suffix}_${LIB_ARCH}_${LIB_OS}") + add_library(${libname} STATIC ${LIB_SOURCES}) + set_target_compile_flags(${libname} + -isysroot ${DARWIN_${LIB_OS}_SYSROOT} + ${DARWIN_${LIB_OS}_BUILTIN_MIN_VER_FLAG} + ${LIB_CFLAGS}) + set_property(TARGET ${libname} APPEND PROPERTY + COMPILE_DEFINITIONS ${LIB_DEFS}) + set_target_properties(${libname} PROPERTIES + OUTPUT_NAME ${libname}${COMPILER_RT_OS_SUFFIX}) + set_target_properties(${libname} PROPERTIES + OSX_ARCHITECTURES ${LIB_ARCH}) + + if(LIB_PARENT_TARGET) + add_dependencies(${LIB_PARENT_TARGET} ${libname}) + endif() + + list(APPEND ${LIB_OS}_${suffix}_libs ${libname}) + list(APPEND ${LIB_OS}_${suffix}_lipo_flags -arch ${arch} $) +endmacro() + +function(darwin_lipo_libs name) + cmake_parse_arguments(LIB + "" + "PARENT_TARGET;OUTPUT_DIR;INSTALL_DIR" + "LIPO_FLAGS;DEPENDS" + ${ARGN}) + add_custom_command(OUTPUT ${LIB_OUTPUT_DIR}/lib${name}.a + COMMAND ${CMAKE_COMMAND} -E make_directory ${LIB_OUTPUT_DIR} + COMMAND lipo -output + ${LIB_OUTPUT_DIR}/lib${name}.a + -create ${LIB_LIPO_FLAGS} + DEPENDS ${LIB_DEPENDS} + ) + add_custom_target(${name} + DEPENDS ${LIB_OUTPUT_DIR}/lib${name}.a) + add_dependencies(${LIB_PARENT_TARGET} ${name}) + install(FILES ${LIB_OUTPUT_DIR}/lib${name}.a + DESTINATION ${LIB_INSTALL_DIR}) +endfunction() + +# Filter out generic versions of routines that are re-implemented in +# architecture specific manner. This prevents multiple definitions of the +# same symbols, making the symbol selection non-deterministic. +function(darwin_filter_builtin_sources output_var exclude_or_include excluded_list) + if(exclude_or_include STREQUAL "EXCLUDE") + set(filter_action GREATER) + set(filter_value -1) + elseif(exclude_or_include STREQUAL "INCLUDE") + set(filter_action LESS) + set(filter_value 0) + else() + message(FATAL_ERROR "darwin_filter_builtin_sources called without EXCLUDE|INCLUDE") + endif() + + set(intermediate ${ARGN}) + foreach (_file ${intermediate}) + get_filename_component(_name_we ${_file} NAME_WE) + list(FIND ${excluded_list} ${_name_we} _found) + if(_found ${filter_action} ${filter_value}) + list(REMOVE_ITEM intermediate ${_file}) + elseif(${_file} MATCHES ".*/.*\\.S") + get_filename_component(_name ${_file} NAME) + string(REPLACE ".S" ".c" _cname "${_name}") + list(REMOVE_ITEM intermediate ${_cname}) + endif () + endforeach () + set(${output_var} ${intermediate} PARENT_SCOPE) +endfunction() + +function(darwin_add_eprintf_library) + add_library(clang_rt.eprintf STATIC eprintf.c) + set_target_compile_flags(clang_rt.eprintf + -isysroot ${DARWIN_osx_SYSROOT} + ${DARWIN_osx_BUILTIN_MIN_VER_FLAG} + -arch i386) + set_target_properties(clang_rt.eprintf PROPERTIES + OUTPUT_NAME clang_rt.eprintf${COMPILER_RT_OS_SUFFIX}) + set_target_properties(clang_rt.eprintf PROPERTIES + OSX_ARCHITECTURES i386) + add_dependencies(builtins clang_rt.eprintf) + set_target_properties(clang_rt.eprintf PROPERTIES + ARCHIVE_OUTPUT_DIRECTORY ${COMPILER_RT_LIBRARY_OUTPUT_DIR}) + install(TARGETS clang_rt.eprintf + ARCHIVE DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) +endfunction() + +# Generates builtin libraries for all operating systems specified in ARGN. Each +# OS library is constructed by lipo-ing together single-architecture libraries. +macro(darwin_add_builtin_libraries) + set(DARWIN_EXCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Darwin-excludes) + + if(CMAKE_CONFIGURATION_TYPES) + foreach(type ${CMAKE_CONFIGURATION_TYPES}) + set(CMAKE_C_FLAGS_${type} -O3) + set(CMAKE_CXX_FLAGS_${type} -O3) + endforeach() + else() + set(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} -O3) + endif() + + set(CMAKE_C_FLAGS "-fPIC -fvisibility=hidden -DVISIBILITY_HIDDEN -Wall -fomit-frame-pointer") + set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) + set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS}) + + set(PROFILE_SOURCES ../profile/InstrProfiling + ../profile/InstrProfilingBuffer + ../profile/InstrProfilingPlatformDarwin) + foreach (os ${ARGN}) + list_union(DARWIN_BUILTIN_ARCHS DARWIN_${os}_ARCHS BUILTIN_SUPPORTED_ARCH) + foreach (arch ${DARWIN_BUILTIN_ARCHS}) + darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS + OS ${os} + ARCH ${arch} + MIN_VERSION ${DARWIN_${os}_BUILTIN_MIN_VER}) + + darwin_filter_builtin_sources(filtered_sources + EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS + ${${arch}_SOURCES}) + + darwin_add_builtin_library(clang_rt builtins + OS ${os} + ARCH ${arch} + SOURCES ${filtered_sources} + CFLAGS -arch ${arch} + PARENT_TARGET builtins) + endforeach() + + # Don't build cc_kext libraries for simulator platforms + if(NOT DARWIN_${os}_SKIP_CC_KEXT) + foreach (arch ${DARWIN_BUILTIN_ARCHS}) + # By not specifying MIN_VERSION this only reads the OS and OS-arch lists. + # We don't want to filter out the builtins that are present in libSystem + # because kexts can't link libSystem. + darwin_find_excluded_builtins_list(${arch}_${os}_EXCLUDED_BUILTINS + OS ${os} + ARCH ${arch}) + + darwin_filter_builtin_sources(filtered_sources + EXCLUDE ${arch}_${os}_EXCLUDED_BUILTINS + ${${arch}_SOURCES}) + + # In addition to the builtins cc_kext includes some profile sources + darwin_add_builtin_library(clang_rt cc_kext + OS ${os} + ARCH ${arch} + SOURCES ${filtered_sources} ${PROFILE_SOURCES} + CFLAGS -arch ${arch} -mkernel + DEFS KERNEL_USE + PARENT_TARGET builtins) + endforeach() + set(archive_name clang_rt.cc_kext_${os}) + if(${os} STREQUAL "osx") + set(archive_name clang_rt.cc_kext) + endif() + darwin_lipo_libs(${archive_name} + PARENT_TARGET builtins + LIPO_FLAGS ${${os}_cc_kext_lipo_flags} + DEPENDS ${${os}_cc_kext_libs} + OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + INSTALL_DIR ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + endif() + endforeach() + + darwin_add_eprintf_library() + + # We put the x86 sim slices into the archives for their base OS + foreach (os ${ARGN}) + if(NOT ${os} MATCHES ".*sim$") + darwin_lipo_libs(clang_rt.${os} + PARENT_TARGET builtins + LIPO_FLAGS ${${os}_builtins_lipo_flags} ${${os}sim_builtins_lipo_flags} + DEPENDS ${${os}_builtins_libs} ${${os}sim_builtins_libs} + OUTPUT_DIR ${COMPILER_RT_LIBRARY_OUTPUT_DIR} + INSTALL_DIR ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + endif() + endforeach() + darwin_add_embedded_builtin_libraries() +endmacro() + +function(darwin_add_embedded_builtin_libraries) + set(MACHO_SYM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/macho_embedded) + if(CMAKE_CONFIGURATION_TYPES) + foreach(type ${CMAKE_CONFIGURATION_TYPES}) + set(CMAKE_C_FLAGS_${type} -Oz) + set(CMAKE_CXX_FLAGS_${type} -Oz) + endforeach() + else() + set(CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE} -Oz) + endif() + + set(CMAKE_C_FLAGS "-Wall -fomit-frame-pointer -ffreestanding") + set(CMAKE_CXX_FLAGS ${CMAKE_C_FLAGS}) + set(CMAKE_ASM_FLAGS ${CMAKE_C_FLAGS}) + + set(SOFT_FLOAT_FLAG -mfloat-abi=soft) + set(HARD_FLOAT_FLAG -mfloat-abi=hard) + + set(PIC_FLAG_ -fPIC) + set(STATIC_FLAG -static) + + set(DARWIN_macho_embedded_ARCHS armv6m armv7m armv7em armv7 i386 x86_64) + + set(DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR + ${COMPILER_RT_OUTPUT_DIR}/lib/macho_embedded) + set(DARWIN_macho_embedded_LIBRARY_INSTALL_DIR + ${COMPILER_RT_INSTALL_PATH}/lib/macho_embedded) + + set(CFLAGS_armv7 "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_armv7em "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_armv7m "-target thumbv7-apple-darwin-eabi") + set(CFLAGS_i386 "-march=pentium") + + set(DARWIN_SOFT_FLOAT_ARCHS armv6m armv7m armv7em armv7) + set(DARWIN_HARD_FLOAT_ARCHS armv7em armv7 i386 x86_64) + + darwin_read_list_from_file(common_FUNCTIONS ${MACHO_SYM_DIR}/common.txt) + darwin_read_list_from_file(thumb2_FUNCTIONS ${MACHO_SYM_DIR}/thumb2.txt) + darwin_read_list_from_file(thumb2_64_FUNCTIONS ${MACHO_SYM_DIR}/thumb2-64.txt) + darwin_read_list_from_file(arm_FUNCTIONS ${MACHO_SYM_DIR}/arm.txt) + darwin_read_list_from_file(i386_FUNCTIONS ${MACHO_SYM_DIR}/i386.txt) + + + set(armv6m_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS}) + set(armv7m_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS}) + set(armv7em_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS}) + set(armv7_FUNCTIONS ${common_FUNCTIONS} ${arm_FUNCTIONS} ${thumb2_FUNCTIONS} ${thumb2_64_FUNCTIONS}) + set(i386_FUNCTIONS ${common_FUNCTIONS} ${i386_FUNCTIONS}) + set(x86_64_FUNCTIONS ${common_FUNCTIONS}) + + foreach(arch ${DARWIN_macho_embedded_ARCHS}) + darwin_filter_builtin_sources(${arch}_filtered_sources + INCLUDE ${arch}_FUNCTIONS + ${${arch}_SOURCES}) + if(NOT ${arch}_filtered_sources) + message("${arch}_SOURCES: ${${arch}_SOURCES}") + message("${arch}_FUNCTIONS: ${${arch}_FUNCTIONS}") + message(FATAL_ERROR "Empty filtered sources!") + endif() + endforeach() + + foreach(float_type SOFT HARD) + foreach(type PIC STATIC) + string(TOLOWER "${float_type}_${type}" lib_suffix) + foreach(arch ${DARWIN_${float_type}_FLOAT_ARCHS}) + set(DARWIN_macho_embedded_SYSROOT ${DARWIN_osx_SYSROOT}) + set(DARWIN_macho_embedded_BUILTIN_MIN_VER_FLAG ${DARWIN_osx_BUILTIN_MIN_VER_FLAG}) + set(float_flag) + if(${arch} MATCHES "^arm") + set(DARWIN_macho_embedded_SYSROOT ${DARWIN_ios_SYSROOT}) + # x86 targets are hard float by default, but the complain about the + # float ABI flag, so don't pass it unless we're targeting arm. + set(float_flag ${${float_type}_FLOAT_FLAG}) + endif() + darwin_add_builtin_library(clang_rt ${lib_suffix} + OS macho_embedded + ARCH ${arch} + SOURCES ${${arch}_filtered_sources} + CFLAGS -arch ${arch} ${${type}_FLAG} ${float_flag} ${CFLAGS_${arch}} + PARENT_TARGET builtins) + endforeach() + foreach(lib ${macho_embedded_${lib_suffix}_libs}) + set_target_properties(${lib} PROPERTIES LINKER_LANGUAGE C) + endforeach() + darwin_lipo_libs(clang_rt.${lib_suffix} + PARENT_TARGET builtins + LIPO_FLAGS ${macho_embedded_${lib_suffix}_lipo_flags} + DEPENDS ${macho_embedded_${lib_suffix}_libs} + OUTPUT_DIR ${DARWIN_macho_embedded_LIBRARY_OUTPUT_DIR} + INSTALL_DIR ${DARWIN_macho_embedded_LIBRARY_INSTALL_DIR}) + endforeach() + endforeach() +endfunction() diff --git a/src/compiler-rt/cmake/Modules/CompilerRTLink.cmake b/src/compiler-rt/cmake/Modules/CompilerRTLink.cmake index 0f0e53a3b2..bb96869844 100644 --- a/src/compiler-rt/cmake/Modules/CompilerRTLink.cmake +++ b/src/compiler-rt/cmake/Modules/CompilerRTLink.cmake @@ -1,12 +1,10 @@ -include(LLVMParseArguments) - # Link a shared library with COMPILER_RT_TEST_COMPILER. # clang_link_shared( # OBJECTS # LINKFLAGS # DEPS ) macro(clang_link_shared so_file) - parse_arguments(SOURCE "OBJECTS;LINKFLAGS;DEPS" "" ${ARGN}) + cmake_parse_arguments(SOURCE "" "" "OBJECTS;LINKFLAGS;DEPS" ${ARGN}) if(NOT COMPILER_RT_STANDALONE_BUILD) list(APPEND SOURCE_DEPS clang) endif() diff --git a/src/compiler-rt/cmake/Modules/CompilerRTUtils.cmake b/src/compiler-rt/cmake/Modules/CompilerRTUtils.cmake index e22e77535a..cf690f4a33 100644 --- a/src/compiler-rt/cmake/Modules/CompilerRTUtils.cmake +++ b/src/compiler-rt/cmake/Modules/CompilerRTUtils.cmake @@ -2,6 +2,7 @@ # 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) + set(argstring "") foreach(arg ${ARGN}) set(argstring "${argstring} ${arg}") endforeach() @@ -9,24 +10,13 @@ function(set_target_compile_flags target) endfunction() function(set_target_link_flags target) + set(argstring "") foreach(arg ${ARGN}) set(argstring "${argstring} ${arg}") endforeach() set_property(TARGET ${target} PROPERTY LINK_FLAGS "${argstring}") endfunction() -# Check if a given flag is present in a space-separated flag_string. -# Store the result in out_var. -function(find_flag_in_string flag_string flag out_var) - string(REPLACE " " ";" flag_list "${flag_string}") - list(FIND flag_list ${flag} flag_pos) - if(NOT flag_pos EQUAL -1) - set(${out_var} TRUE PARENT_SCOPE) - else() - set(${out_var} FALSE PARENT_SCOPE) - endif() -endfunction() - # Set the variable var_PYBOOL to True if var holds a true-ish string, # otherwise set it to False. macro(pythonize_bool var) @@ -38,7 +28,7 @@ macro(pythonize_bool var) endmacro() # Appends value to all lists in ARGN, if the condition is true. -macro(append_if condition value) +macro(append_list_if condition value) if(${condition}) foreach(list ${ARGN}) list(APPEND ${list} ${value}) @@ -56,6 +46,24 @@ macro(append_string_if condition value) endmacro() macro(append_no_rtti_flag list) - append_if(COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti ${list}) - append_if(COMPILER_RT_HAS_GR_FLAG /GR- ${list}) + append_list_if(COMPILER_RT_HAS_FNO_RTTI_FLAG -fno-rtti ${list}) + append_list_if(COMPILER_RT_HAS_GR_FLAG /GR- ${list}) +endmacro() + +macro(append_have_file_definition filename varname list) + check_include_file("${filename}" "${varname}") + if (NOT ${varname}) + set("${varname}" 0) + endif() + list(APPEND ${list} "${varname}=${${varname}}") +endmacro() + +macro(list_union output input1 input2) + set(${output}) + foreach(it ${${input1}}) + list(FIND ${input2} ${it} index) + if( NOT (index EQUAL -1)) + list(APPEND ${output} ${it}) + endif() + endforeach() endmacro() diff --git a/src/compiler-rt/cmake/Modules/SanitizerUtils.cmake b/src/compiler-rt/cmake/Modules/SanitizerUtils.cmake index 1ebc7030a5..3eb49c83f5 100644 --- a/src/compiler-rt/cmake/Modules/SanitizerUtils.cmake +++ b/src/compiler-rt/cmake/Modules/SanitizerUtils.cmake @@ -1,47 +1,86 @@ -include(LLVMParseArguments) - set(SANITIZER_GEN_DYNAMIC_LIST ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/gen_dynamic_list.py) set(SANITIZER_LINT_SCRIPT ${COMPILER_RT_SOURCE_DIR}/lib/sanitizer_common/scripts/check_lint.sh) -# Create a target "-symbols" that would generate the list of symbols -# that need to be exported from sanitizer runtime "". Function +# Create a target "--symbols" that would generate the list of +# symbols that need to be exported from sanitizer runtime "". Function # interceptors are exported automatically, user can also provide files with # symbol names that should be exported as well. -# add_sanitizer_rt_symbols( ) +# add_sanitizer_rt_symbols( +# ARCHS +# PARENT_TARGET +# EXTRA ) macro(add_sanitizer_rt_symbols name) - set(stamp ${CMAKE_CURRENT_BINARY_DIR}/${name}.syms-stamp) - add_custom_command(OUTPUT ${stamp} + cmake_parse_arguments(ARG + "" + "PARENT_TARGET" + "ARCHS;EXTRA" + ${ARGN}) + foreach(arch ${ARG_ARCHS}) + set(target_name ${name}-${arch}) + set(stamp ${CMAKE_CURRENT_BINARY_DIR}/${target_name}.syms-stamp) + set(extra_args) + foreach(arg ${ARG_EXTRA}) + list(APPEND extra_args "--extra" ${arg}) + endforeach() + add_custom_command(OUTPUT ${stamp} + COMMAND ${PYTHON_EXECUTABLE} + ${SANITIZER_GEN_DYNAMIC_LIST} ${extra_args} $ + > $.syms + COMMAND ${CMAKE_COMMAND} -E touch ${stamp} + DEPENDS ${target_name} ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA} + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + COMMENT "Generating exported symbols for ${target_name}" + VERBATIM) + add_custom_target(${target_name}-symbols ALL + DEPENDS ${stamp} + SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA}) + + if(NOT CMAKE_VERSION VERSION_LESS 3.0) + install(FILES $.syms + DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + else() + # Per-config install location. + if(CMAKE_CONFIGURATION_TYPES) + foreach(c ${CMAKE_CONFIGURATION_TYPES}) + get_target_property(libfile ${target_name} LOCATION_${c}) + install(FILES ${libfile}.syms CONFIGURATIONS ${c} + DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + endforeach() + else() + get_target_property(libfile ${target_name} LOCATION_${CMAKE_BUILD_TYPE}) + install(FILES ${libfile}.syms DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) + endif() + endif() + if(ARG_PARENT_TARGET) + add_dependencies(${ARG_PARENT_TARGET} ${target_name}-symbols) + endif() + endforeach() +endmacro() + +macro(add_sanitizer_rt_version_list name) + set(vers ${CMAKE_CURRENT_BINARY_DIR}/${name}.vers) + cmake_parse_arguments(ARG "" "" "LIBS;EXTRA" ${ARGN}) + set(args) + foreach(arg ${ARG_EXTRA}) + list(APPEND args "--extra" ${arg}) + endforeach() + foreach(arg ${ARG_LIBS}) + list(APPEND args "$") + endforeach() + add_custom_command(OUTPUT ${vers} COMMAND ${PYTHON_EXECUTABLE} - ${SANITIZER_GEN_DYNAMIC_LIST} $ ${ARGN} - > $.syms - COMMAND ${CMAKE_COMMAND} -E touch ${stamp} - DEPENDS ${name} ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN} + ${SANITIZER_GEN_DYNAMIC_LIST} --version-list ${args} + > ${vers} + DEPENDS ${SANITIZER_GEN_DYNAMIC_LIST} ${ARG_EXTRA} ${ARG_LIBS} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMENT "Generating exported symbols for ${name}" + COMMENT "Generating version list for ${name}" VERBATIM) - add_custom_target(${name}-symbols ALL - DEPENDS ${stamp} - SOURCES ${SANITIZER_GEN_DYNAMIC_LIST} ${ARGN}) - if(NOT CMAKE_VERSION VERSION_LESS 3.0) - install(FILES $.syms - DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) - else() - # Per-config install location. - if(CMAKE_CONFIGURATION_TYPES) - foreach(c ${CMAKE_CONFIGURATION_TYPES}) - get_target_property(libfile ${name} LOCATION_${c}) - install(FILES ${libfile}.syms CONFIGURATIONS ${c} - DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) - endforeach() - else() - get_target_property(libfile ${name} LOCATION_${CMAKE_BUILD_TYPE}) - install(FILES ${libfile}.syms DESTINATION ${COMPILER_RT_LIBRARY_INSTALL_DIR}) - endif() - endif() + add_custom_target(${name}-version-list ALL + DEPENDS ${vers}) endmacro() # Add target to check code style for sanitizer runtimes. diff --git a/src/compiler-rt/cmake/config-ix.cmake b/src/compiler-rt/cmake/config-ix.cmake index fe194d50d8..f137d51c7f 100644 --- a/src/compiler-rt/cmake/config-ix.cmake +++ b/src/compiler-rt/cmake/config-ix.cmake @@ -1,6 +1,15 @@ +include(CMakePushCheckState) include(CheckCXXCompilerFlag) include(CheckLibraryExists) include(CheckSymbolExists) +include(TestBigEndian) + +function(check_linker_flag flag out_var) + cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${flag}") + check_cxx_compiler_flag("" ${out_var}) + cmake_pop_check_state() +endfunction() # CodeGen options. check_cxx_compiler_flag(-fPIC COMPILER_RT_HAS_FPIC_FLAG) @@ -10,12 +19,15 @@ check_cxx_compiler_flag(-fno-exceptions COMPILER_RT_HAS_FNO_EXCEPTIONS_FLAG check_cxx_compiler_flag(-fomit-frame-pointer COMPILER_RT_HAS_FOMIT_FRAME_POINTER_FLAG) check_cxx_compiler_flag(-funwind-tables COMPILER_RT_HAS_FUNWIND_TABLES_FLAG) check_cxx_compiler_flag(-fno-stack-protector COMPILER_RT_HAS_FNO_STACK_PROTECTOR_FLAG) +check_cxx_compiler_flag(-fno-sanitize=safe-stack COMPILER_RT_HAS_FNO_SANITIZE_SAFE_STACK_FLAG) check_cxx_compiler_flag(-fvisibility=hidden COMPILER_RT_HAS_FVISIBILITY_HIDDEN_FLAG) check_cxx_compiler_flag(-fno-rtti COMPILER_RT_HAS_FNO_RTTI_FLAG) check_cxx_compiler_flag(-ffreestanding COMPILER_RT_HAS_FFREESTANDING_FLAG) check_cxx_compiler_flag("-Werror -fno-function-sections" COMPILER_RT_HAS_FNO_FUNCTION_SECTIONS_FLAG) check_cxx_compiler_flag(-std=c++11 COMPILER_RT_HAS_STD_CXX11_FLAG) check_cxx_compiler_flag(-ftls-model=initial-exec COMPILER_RT_HAS_FTLS_MODEL_INITIAL_EXEC) +check_cxx_compiler_flag(-fno-lto COMPILER_RT_HAS_FNO_LTO_FLAG) +check_cxx_compiler_flag(-msse3 COMPILER_RT_HAS_MSSE3_FLAG) check_cxx_compiler_flag(/GR COMPILER_RT_HAS_GR_FLAG) check_cxx_compiler_flag(/GS COMPILER_RT_HAS_GS_FLAG) @@ -26,24 +38,541 @@ check_cxx_compiler_flag(/Oy COMPILER_RT_HAS_Oy_FLAG) check_cxx_compiler_flag(-gline-tables-only COMPILER_RT_HAS_GLINE_TABLES_ONLY_FLAG) check_cxx_compiler_flag(-g COMPILER_RT_HAS_G_FLAG) check_cxx_compiler_flag(/Zi COMPILER_RT_HAS_Zi_FLAG) - + # Warnings. check_cxx_compiler_flag(-Wall COMPILER_RT_HAS_WALL_FLAG) check_cxx_compiler_flag(-Werror COMPILER_RT_HAS_WERROR_FLAG) check_cxx_compiler_flag("-Werror -Wframe-larger-than=512" COMPILER_RT_HAS_WFRAME_LARGER_THAN_FLAG) check_cxx_compiler_flag("-Werror -Wglobal-constructors" COMPILER_RT_HAS_WGLOBAL_CONSTRUCTORS_FLAG) -check_cxx_compiler_flag("-Werror -Wno-c99-extensions" COMPILER_RT_HAS_WNO_C99_EXTENSIONS_FLAG) -check_cxx_compiler_flag("-Werror -Wno-gnu" COMPILER_RT_HAS_WNO_GNU_FLAG) -check_cxx_compiler_flag("-Werror -Wno-non-virtual-dtor" COMPILER_RT_HAS_WNO_NON_VIRTUAL_DTOR_FLAG) -check_cxx_compiler_flag("-Werror -Wno-variadic-macros" COMPILER_RT_HAS_WNO_VARIADIC_MACROS_FLAG) +check_cxx_compiler_flag("-Werror -Wc99-extensions" COMPILER_RT_HAS_WC99_EXTENSIONS_FLAG) +check_cxx_compiler_flag("-Werror -Wgnu" COMPILER_RT_HAS_WGNU_FLAG) +check_cxx_compiler_flag("-Werror -Wnon-virtual-dtor" COMPILER_RT_HAS_WNON_VIRTUAL_DTOR_FLAG) +check_cxx_compiler_flag("-Werror -Wvariadic-macros" COMPILER_RT_HAS_WVARIADIC_MACROS_FLAG) check_cxx_compiler_flag(/W3 COMPILER_RT_HAS_W3_FLAG) check_cxx_compiler_flag(/WX COMPILER_RT_HAS_WX_FLAG) +check_cxx_compiler_flag(/wd4146 COMPILER_RT_HAS_WD4146_FLAG) +check_cxx_compiler_flag(/wd4291 COMPILER_RT_HAS_WD4291_FLAG) +check_cxx_compiler_flag(/wd4391 COMPILER_RT_HAS_WD4391_FLAG) check_cxx_compiler_flag(/wd4722 COMPILER_RT_HAS_WD4722_FLAG) +check_cxx_compiler_flag(/wd4800 COMPILER_RT_HAS_WD4800_FLAG) # Symbols. check_symbol_exists(__func__ "" COMPILER_RT_HAS_FUNC_SYMBOL) # Libraries. +check_library_exists(c printf "" COMPILER_RT_HAS_LIBC) check_library_exists(dl dlopen "" COMPILER_RT_HAS_LIBDL) +check_library_exists(rt shm_open "" COMPILER_RT_HAS_LIBRT) +check_library_exists(m pow "" COMPILER_RT_HAS_LIBM) check_library_exists(pthread pthread_create "" COMPILER_RT_HAS_LIBPTHREAD) +check_library_exists(stdc++ __cxa_throw "" COMPILER_RT_HAS_LIBSTDCXX) + +# Linker flags. +if(ANDROID) + check_linker_flag("-Wl,-z,global" COMPILER_RT_HAS_Z_GLOBAL) + check_library_exists(log __android_log_write "" COMPILER_RT_HAS_LIBLOG) +endif() + +# Architectures. + +# List of all architectures we can target. +set(COMPILER_RT_SUPPORTED_ARCH) + +# 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_SOURCE ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/simple.cc) +file(WRITE ${SIMPLE_SOURCE} "#include \n#include \nint main() {}\n") + +function(check_compile_definition def argstring out_var) + if("${def}" STREQUAL "") + set(${out_var} TRUE PARENT_SCOPE) + return() + endif() + cmake_push_check_state() + set(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} ${argstring}") + check_symbol_exists(${def} "" ${out_var}) + cmake_pop_check_state() +endfunction() + +# test_target_arch( ) +# Checks if architecture is supported: runs host compiler with provided +# flags to verify that: +# 1) is defined (if non-empty) +# 2) simple file can be successfully built. +# If successful, saves target flags for this architecture. +macro(test_target_arch arch def) + set(TARGET_${arch}_CFLAGS ${ARGN}) + set(argstring "") + foreach(arg ${ARGN}) + set(argstring "${argstring} ${arg}") + endforeach() + check_compile_definition("${def}" "${argstring}" HAS_${arch}_DEF) + if(NOT HAS_${arch}_DEF) + set(CAN_TARGET_${arch} FALSE) + else() + set(argstring "${CMAKE_EXE_LINKER_FLAGS} ${argstring}") + try_compile(CAN_TARGET_${arch} ${CMAKE_BINARY_DIR} ${SIMPLE_SOURCE} + COMPILE_DEFINITIONS "${TARGET_${arch}_CFLAGS}" + OUTPUT_VARIABLE TARGET_${arch}_OUTPUT + CMAKE_FLAGS "-DCMAKE_EXE_LINKER_FLAGS:STRING=${argstring}") + endif() + if(${CAN_TARGET_${arch}}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "${arch}" AND + COMPILER_RT_HAS_EXPLICIT_DEFAULT_TARGET_TRIPLE) + # Bail out if we cannot target the architecture we plan to test. + message(FATAL_ERROR "Cannot compile for ${arch}:\n${TARGET_${arch}_OUTPUT}") + endif() +endmacro() + +# Add $arch as supported with no additional flags. +macro(add_default_target_arch arch) + set(TARGET_${arch}_CFLAGS "") + set(CAN_TARGET_${arch} 1) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) +endmacro() + +macro(detect_target_arch) + check_symbol_exists(__arm__ "" __ARM) + check_symbol_exists(__aarch64__ "" __AARCH64) + check_symbol_exists(__x86_64__ "" __X86_64) + check_symbol_exists(__i686__ "" __I686) + check_symbol_exists(__i386__ "" __I386) + check_symbol_exists(__mips__ "" __MIPS) + check_symbol_exists(__mips64__ "" __MIPS64) + if(__ARM) + add_default_target_arch(arm) + elseif(__AARCH64) + add_default_target_arch(aarch64) + elseif(__X86_64) + add_default_target_arch(x86_64) + elseif(__I686) + add_default_target_arch(i686) + elseif(__I386) + add_default_target_arch(i386) + elseif(__MIPS64) # must be checked before __MIPS + add_default_target_arch(mips64) + elseif(__MIPS) + add_default_target_arch(mips) + endif() +endmacro() + +# 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 (NOT CMAKE_SIZEOF_VOID_P EQUAL 4 AND + NOT CMAKE_SIZEOF_VOID_P EQUAL 8) + message(FATAL_ERROR "Please use architecture with 4 or 8 byte pointers.") +endif() + +# Generate the COMPILER_RT_SUPPORTED_ARCH list. +if(ANDROID) + # Examine compiler output to determine target architecture. + detect_target_arch() + set(COMPILER_RT_OS_SUFFIX "-android") +elseif(NOT APPLE) # Supported archs for Apple platforms are generated later + if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "i[2-6]86|x86|amd64") + if(NOT MSVC) + test_target_arch(x86_64 "" "-m64") + # FIXME: We build runtimes for both i686 and i386, as "clang -m32" may + # target different variant than "$CMAKE_C_COMPILER -m32". This part should + # be gone after we resolve PR14109. + test_target_arch(i686 __i686__ "-m32") + test_target_arch(i386 __i386__ "-m32") + else() + if (CMAKE_SIZEOF_VOID_P EQUAL 4) + test_target_arch(i386 "" "") + else() + test_target_arch(x86_64 "" "") + endif() + endif() + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "powerpc") + TEST_BIG_ENDIAN(HOST_IS_BIG_ENDIAN) + if(HOST_IS_BIG_ENDIAN) + test_target_arch(powerpc64 "" "-m64") + else() + test_target_arch(powerpc64le "" "-m64") + endif() + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mipsel|mips64el") + # Gcc doesn't accept -m32/-m64 so we do the next best thing and use + # -mips32r2/-mips64r2. We don't use -mips1/-mips3 because we want to match + # clang's default CPU's. In the 64-bit case, we must also specify the ABI + # since the default ABI differs between gcc and clang. + # FIXME: Ideally, we would build the N32 library too. + test_target_arch(mipsel "" "-mips32r2" "--target=mipsel-linux-gnu") + test_target_arch(mips64el "" "-mips64r2" "--target=mips64el-linux-gnu" "-mabi=n64") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips") + test_target_arch(mips "" "-mips32r2" "--target=mips-linux-gnu") + test_target_arch(mips64 "" "-mips64r2" "--target=mips64-linux-gnu" "-mabi=n64") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "arm") + test_target_arch(arm "" "-march=armv7-a" "-mfloat-abi=soft") + test_target_arch(armhf "" "-march=armv7-a" "-mfloat-abi=hard") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "aarch32") + test_target_arch(aarch32 "" "-march=armv8-a") + elseif("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "aarch64") + test_target_arch(aarch64 "" "-march=armv8-a") + endif() + set(COMPILER_RT_OS_SUFFIX "") +endif() + +# Takes ${ARGN} and puts only supported architectures in @out_var list. +function(filter_available_targets out_var) + set(archs ${${out_var}}) + 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(${out_var} ${archs} PARENT_SCOPE) +endfunction() + +# Returns a list of architecture specific target cflags in @out_var list. +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() + if (NOT APPLE) + set(${out_var} ${TARGET_${arch}_CFLAGS} PARENT_SCOPE) + else() + # This is only called in constructing cflags for tests executing on the + # host. This will need to all be cleaned up to support building tests + # for cross-targeted hardware (i.e. iOS). + set(${out_var} -arch ${arch} PARENT_SCOPE) + endif() + endif() +endfunction() + +set(ARM64 aarch64) +set(ARM32 arm armhf) +set(X86 i386 i686) +set(X86_64 x86_64) +set(MIPS32 mips mipsel) +set(MIPS64 mips64 mips64el) +set(PPC64 powerpc64 powerpc64le) + +if(APPLE) + set(ARM64 arm64) + set(ARM32 armv7 armv7s) + set(X86_64 x86_64 x86_64h) +endif() + +set(ALL_BUILTIN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} + ${MIPS32} ${MIPS64}) +set(ALL_SANITIZER_COMMON_SUPPORTED_ARCH ${X86} ${X86_64} ${PPC64} + ${ARM32} ${ARM64} ${MIPS32} ${MIPS64}) +set(ALL_ASAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} + ${MIPS32} ${MIPS64} ${PPC64}) +set(ALL_DFSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) +set(ALL_LSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) +set(ALL_MSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) +set(ALL_PROFILE_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} ${PPC64} + ${MIPS32} ${MIPS64}) +set(ALL_TSAN_SUPPORTED_ARCH ${X86_64} ${MIPS64} ${ARM64}) +set(ALL_UBSAN_SUPPORTED_ARCH ${X86} ${X86_64} ${ARM32} ${ARM64} + ${MIPS32} ${MIPS64} ${PPC64}) +set(ALL_SAFESTACK_SUPPORTED_ARCH ${X86} ${X86_64}) + +if(APPLE) + include(CompilerRTDarwinUtils) + + option(COMPILER_RT_ENABLE_IOS "Enable building for iOS - Experimental" Off) + + find_darwin_sdk_dir(DARWIN_osx_SYSROOT macosx) + find_darwin_sdk_dir(DARWIN_iossim_SYSROOT iphonesimulator) + find_darwin_sdk_dir(DARWIN_ios_SYSROOT iphoneos) + + # Note: In order to target x86_64h on OS X the minimum deployment target must + # be 10.8 or higher. + set(SANITIZER_COMMON_SUPPORTED_OS osx) + set(BUILTIN_SUPPORTED_OS osx) + set(PROFILE_SUPPORTED_OS osx) + set(TSAN_SUPPORTED_OS osx) + if(NOT SANITIZER_MIN_OSX_VERSION) + string(REGEX MATCH "-mmacosx-version-min=([.0-9]+)" + MACOSX_VERSION_MIN_FLAG "${CMAKE_CXX_FLAGS}") + if(MACOSX_VERSION_MIN_FLAG) + set(SANITIZER_MIN_OSX_VERSION "${CMAKE_MATCH_1}") + elseif(CMAKE_OSX_DEPLOYMENT_TARGET) + set(SANITIZER_MIN_OSX_VERSION ${CMAKE_OSX_DEPLOYMENT_TARGET}) + else() + set(SANITIZER_MIN_OSX_VERSION 10.9) + endif() + if(SANITIZER_MIN_OSX_VERSION VERSION_LESS "10.7") + message(FATAL_ERROR "Too old OS X version: ${SANITIZER_MIN_OSX_VERSION}") + endif() + endif() + + # We're setting the flag manually for each target OS + set(CMAKE_OSX_DEPLOYMENT_TARGET "") + + set(DARWIN_COMMON_CFLAGS -stdlib=libc++) + set(DARWIN_COMMON_LINKFLAGS + -stdlib=libc++ + -lc++ + -lc++abi) + + set(DARWIN_osx_CFLAGS + ${DARWIN_COMMON_CFLAGS} + -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) + set(DARWIN_osx_LINKFLAGS + ${DARWIN_COMMON_LINKFLAGS} + -mmacosx-version-min=${SANITIZER_MIN_OSX_VERSION}) + set(DARWIN_osx_BUILTIN_MIN_VER 10.5) + set(DARWIN_osx_BUILTIN_MIN_VER_FLAG + -mmacosx-version-min=${DARWIN_osx_BUILTIN_MIN_VER}) + + if(DARWIN_osx_SYSROOT) + list(APPEND DARWIN_osx_CFLAGS -isysroot ${DARWIN_osx_SYSROOT}) + list(APPEND DARWIN_osx_LINKFLAGS -isysroot ${DARWIN_osx_SYSROOT}) + endif() + + # Figure out which arches to use for each OS + darwin_get_toolchain_supported_archs(toolchain_arches) + message(STATUS "Toolchain supported arches: ${toolchain_arches}") + + if(NOT MACOSX_VERSION_MIN_FLAG) + darwin_test_archs(osx + DARWIN_osx_ARCHS + ${toolchain_arches}) + message(STATUS "OSX supported arches: ${DARWIN_osx_ARCHS}") + foreach(arch ${DARWIN_osx_ARCHS}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + set(CAN_TARGET_${arch} 1) + endforeach() + + # Need to build a 10.4 compatible libclang_rt + set(DARWIN_10.4_SYSROOT ${DARWIN_osx_SYSROOT}) + set(DARWIN_10.4_BUILTIN_MIN_VER 10.4) + set(DARWIN_10.4_BUILTIN_MIN_VER_FLAG + -mmacosx-version-min=${DARWIN_10.4_BUILTIN_MIN_VER}) + set(DARWIN_10.4_SKIP_CC_KEXT On) + darwin_test_archs(10.4 + DARWIN_10.4_ARCHS + ${toolchain_arches}) + message(STATUS "OSX 10.4 supported arches: ${DARWIN_10.4_ARCHS}") + if(DARWIN_10.4_ARCHS) + # don't include the Haswell slice in the 10.4 compatibility library + list(REMOVE_ITEM DARWIN_10.4_ARCHS x86_64h) + list(APPEND BUILTIN_SUPPORTED_OS 10.4) + endif() + + if(DARWIN_iossim_SYSROOT) + set(DARWIN_iossim_CFLAGS + ${DARWIN_COMMON_CFLAGS} + -mios-simulator-version-min=7.0 + -isysroot ${DARWIN_iossim_SYSROOT}) + set(DARWIN_iossim_LINKFLAGS + ${DARWIN_COMMON_LINKFLAGS} + -mios-simulator-version-min=7.0 + -isysroot ${DARWIN_iossim_SYSROOT}) + set(DARWIN_iossim_BUILTIN_MIN_VER 6.0) + set(DARWIN_iossim_BUILTIN_MIN_VER_FLAG + -mios-simulator-version-min=${DARWIN_iossim_BUILTIN_MIN_VER}) + + set(DARWIN_iossim_SKIP_CC_KEXT On) + darwin_test_archs(iossim + DARWIN_iossim_ARCHS + ${toolchain_arches}) + message(STATUS "iOS Simulator supported arches: ${DARWIN_iossim_ARCHS}") + if(DARWIN_iossim_ARCHS) + list(APPEND SANITIZER_COMMON_SUPPORTED_OS iossim) + endif() + foreach(arch ${DARWIN_iossim_ARCHS}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + set(CAN_TARGET_${arch} 1) + endforeach() + endif() + + if(DARWIN_ios_SYSROOT AND COMPILER_RT_ENABLE_IOS) + set(DARWIN_ios_CFLAGS + ${DARWIN_COMMON_CFLAGS} + -miphoneos-version-min=7.0 + -isysroot ${DARWIN_ios_SYSROOT}) + set(DARWIN_ios_LINKFLAGS + ${DARWIN_COMMON_LINKFLAGS} + -miphoneos-version-min=7.0 + -isysroot ${DARWIN_ios_SYSROOT}) + set(DARWIN_ios_BUILTIN_MIN_VER 6.0) + set(DARWIN_ios_BUILTIN_MIN_VER_FLAG + -miphoneos-version-min=${DARWIN_ios_BUILTIN_MIN_VER}) + + darwin_test_archs(ios + DARWIN_ios_ARCHS + ${toolchain_arches}) + message(STATUS "iOS supported arches: ${DARWIN_ios_ARCHS}") + if(DARWIN_ios_ARCHS) + list(APPEND SANITIZER_COMMON_SUPPORTED_OS ios) + list(APPEND BUILTIN_SUPPORTED_OS ios) + list(APPEND PROFILE_SUPPORTED_OS ios) + list(APPEND BUILTIN_SUPPORTED_OS iossim) + endif() + foreach(arch ${DARWIN_ios_ARCHS}) + list(APPEND COMPILER_RT_SUPPORTED_ARCH ${arch}) + set(CAN_TARGET_${arch} 1) + endforeach() + endif() + endif() + + # for list_union + include(CompilerRTUtils) + + list_union(BUILTIN_SUPPORTED_ARCH ALL_BUILTIN_SUPPORTED_ARCH toolchain_arches) + + list_union(SANITIZER_COMMON_SUPPORTED_ARCH + ALL_SANITIZER_COMMON_SUPPORTED_ARCH + COMPILER_RT_SUPPORTED_ARCH + ) + set(LSAN_COMMON_SUPPORTED_ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}) + set(UBSAN_COMMON_SUPPORTED_ARCH ${SANITIZER_COMMON_SUPPORTED_ARCH}) + list_union(ASAN_SUPPORTED_ARCH + ALL_ASAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_union(DFSAN_SUPPORTED_ARCH + ALL_DFSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_union(LSAN_SUPPORTED_ARCH + ALL_LSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_union(MSAN_SUPPORTED_ARCH + ALL_MSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_union(PROFILE_SUPPORTED_ARCH + ALL_PROFILE_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_union(TSAN_SUPPORTED_ARCH + ALL_TSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_union(UBSAN_SUPPORTED_ARCH + ALL_UBSAN_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) + list_union(SAFESTACK_SUPPORTED_ARCH + ALL_SAFESTACK_SUPPORTED_ARCH + SANITIZER_COMMON_SUPPORTED_ARCH) +else() + # Architectures supported by compiler-rt libraries. + filter_available_targets(BUILTIN_SUPPORTED_ARCH + ${ALL_BUILTIN_SUPPORTED_ARCH}) + filter_available_targets(SANITIZER_COMMON_SUPPORTED_ARCH + ${ALL_SANITIZER_COMMON_SUPPORTED_ARCH}) + # LSan and UBSan common files should be available on all architectures + # supported by other sanitizers (even if they build into dummy object files). + filter_available_targets(LSAN_COMMON_SUPPORTED_ARCH + ${SANITIZER_COMMON_SUPPORTED_ARCH}) + filter_available_targets(UBSAN_COMMON_SUPPORTED_ARCH + ${SANITIZER_COMMON_SUPPORTED_ARCH}) + filter_available_targets(ASAN_SUPPORTED_ARCH ${ALL_ASAN_SUPPORTED_ARCH}) + filter_available_targets(DFSAN_SUPPORTED_ARCH ${ALL_DFSAN_SUPPORTED_ARCH}) + filter_available_targets(LSAN_SUPPORTED_ARCH ${ALL_LSAN_SUPPORTED_ARCH}) + filter_available_targets(MSAN_SUPPORTED_ARCH ${ALL_MSAN_SUPPORTED_ARCH}) + filter_available_targets(PROFILE_SUPPORTED_ARCH ${ALL_PROFILE_SUPPORTED_ARCH}) + filter_available_targets(TSAN_SUPPORTED_ARCH ${ALL_TSAN_SUPPORTED_ARCH}) + filter_available_targets(UBSAN_SUPPORTED_ARCH ${ALL_UBSAN_SUPPORTED_ARCH}) + filter_available_targets(SAFESTACK_SUPPORTED_ARCH + ${ALL_SAFESTACK_SUPPORTED_ARCH}) +endif() + +message(STATUS "Compiler-RT supported architectures: ${COMPILER_RT_SUPPORTED_ARCH}") + +if(ANDROID) + set(OS_NAME "Android") +else() + set(OS_NAME "${CMAKE_SYSTEM_NAME}") +endif() + +if (SANITIZER_COMMON_SUPPORTED_ARCH AND NOT LLVM_USE_SANITIZER AND + (OS_NAME MATCHES "Android|Darwin|Linux|FreeBSD" OR + (OS_NAME MATCHES "Windows" AND MSVC))) + set(COMPILER_RT_HAS_SANITIZER_COMMON TRUE) +else() + set(COMPILER_RT_HAS_SANITIZER_COMMON FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND + (NOT OS_NAME MATCHES "Windows" OR CMAKE_SIZEOF_VOID_P EQUAL 4)) + set(COMPILER_RT_HAS_INTERCEPTION TRUE) +else() + set(COMPILER_RT_HAS_INTERCEPTION FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND ASAN_SUPPORTED_ARCH AND + (NOT OS_NAME MATCHES "Windows" OR CMAKE_SIZEOF_VOID_P EQUAL 4)) + set(COMPILER_RT_HAS_ASAN TRUE) +else() + set(COMPILER_RT_HAS_ASAN FALSE) +endif() + +if (OS_NAME MATCHES "Linux|FreeBSD|Windows") + set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME TRUE) +else() + set(COMPILER_RT_ASAN_HAS_STATIC_RUNTIME FALSE) +endif() + +# TODO: Add builtins support. + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND DFSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux") + set(COMPILER_RT_HAS_DFSAN TRUE) +else() + set(COMPILER_RT_HAS_DFSAN FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND LSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux|FreeBSD") + set(COMPILER_RT_HAS_LSAN TRUE) +else() + set(COMPILER_RT_HAS_LSAN FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND MSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux") + set(COMPILER_RT_HAS_MSAN TRUE) +else() + set(COMPILER_RT_HAS_MSAN FALSE) +endif() + +if (PROFILE_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD") + set(COMPILER_RT_HAS_PROFILE TRUE) +else() + set(COMPILER_RT_HAS_PROFILE FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND TSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Linux|FreeBSD") + set(COMPILER_RT_HAS_TSAN TRUE) +else() + set(COMPILER_RT_HAS_TSAN FALSE) +endif() + +if(APPLE) + option(COMPILER_RT_ENABLE_TSAN_OSX "Enable building TSan for OS X - Experimental" Off) + if(COMPILER_RT_ENABLE_TSAN_OSX) + set(COMPILER_RT_HAS_TSAN TRUE) + endif() +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND UBSAN_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD|Windows") + set(COMPILER_RT_HAS_UBSAN TRUE) +else() + set(COMPILER_RT_HAS_UBSAN FALSE) +endif() + +# -msse3 flag is not valid for Mips therefore clang gives a warning +# message with -msse3. But check_c_compiler_flags() checks only for +# compiler error messages. Therefore COMPILER_RT_HAS_MSSE3_FLAG turns out to be +# true on Mips, so we make it false here. +if("${COMPILER_RT_DEFAULT_TARGET_ARCH}" MATCHES "mips") + set(COMPILER_RT_HAS_MSSE3_FLAG FALSE) +endif() + +if (COMPILER_RT_HAS_SANITIZER_COMMON AND SAFESTACK_SUPPORTED_ARCH AND + OS_NAME MATCHES "Darwin|Linux|FreeBSD") + set(COMPILER_RT_HAS_SAFESTACK TRUE) +else() + set(COMPILER_RT_HAS_SAFESTACK FALSE) +endif() diff --git a/src/compiler-rt/include/CMakeLists.txt b/src/compiler-rt/include/CMakeLists.txt index b5d98a8055..ad1437ed15 100644 --- a/src/compiler-rt/include/CMakeLists.txt +++ b/src/compiler-rt/include/CMakeLists.txt @@ -1,6 +1,8 @@ set(SANITIZER_HEADERS + sanitizer/allocator_interface.h sanitizer/asan_interface.h sanitizer/common_interface_defs.h + sanitizer/coverage_interface.h sanitizer/dfsan_interface.h sanitizer/linux_syscall_hooks.h sanitizer/lsan_interface.h diff --git a/src/compiler-rt/include/sanitizer/allocator_interface.h b/src/compiler-rt/include/sanitizer/allocator_interface.h new file mode 100644 index 0000000000..ab251f89c6 --- /dev/null +++ b/src/compiler-rt/include/sanitizer/allocator_interface.h @@ -0,0 +1,66 @@ +//===-- allocator_interface.h ---------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Public interface header for allocator used in sanitizers (ASan/TSan/MSan). +//===----------------------------------------------------------------------===// +#ifndef SANITIZER_ALLOCATOR_INTERFACE_H +#define SANITIZER_ALLOCATOR_INTERFACE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + /* Returns the estimated number of bytes that will be reserved by allocator + for request of "size" bytes. If allocator can't allocate that much + memory, returns the maximal possible allocation size, otherwise returns + "size". */ + size_t __sanitizer_get_estimated_allocated_size(size_t size); + + /* Returns true if p was returned by the allocator and + is not yet freed. */ + int __sanitizer_get_ownership(const volatile void *p); + + /* Returns the number of bytes reserved for the pointer p. + Requires (get_ownership(p) == true) or (p == 0). */ + size_t __sanitizer_get_allocated_size(const volatile void *p); + + /* Number of bytes, allocated and not yet freed by the application. */ + size_t __sanitizer_get_current_allocated_bytes(); + + /* Number of bytes, mmaped by the 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). */ + size_t __sanitizer_get_heap_size(); + + /* Number of bytes, mmaped by the 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 __sanitizer_get_free_bytes() + later. */ + size_t __sanitizer_get_free_bytes(); + + /* Number of bytes in unmapped pages, that are released to OS. Currently, + always returns 0. */ + size_t __sanitizer_get_unmapped_bytes(); + + /* Malloc hooks that may be optionally provided by user. + __sanitizer_malloc_hook(ptr, size) is called immediately after + allocation of "size" bytes, which returned "ptr". + __sanitizer_free_hook(ptr) is called immediately before + deallocation of "ptr". */ + void __sanitizer_malloc_hook(const volatile void *ptr, size_t size); + void __sanitizer_free_hook(const volatile void *ptr); +#ifdef __cplusplus +} // extern "C" +#endif + +#endif diff --git a/src/compiler-rt/include/sanitizer/asan_interface.h b/src/compiler-rt/include/sanitizer/asan_interface.h index d244346e4e..97ba0ceb0b 100644 --- a/src/compiler-rt/include/sanitizer/asan_interface.h +++ b/src/compiler-rt/include/sanitizer/asan_interface.h @@ -55,25 +55,62 @@ extern "C" { // Otherwise returns 0. int __asan_address_is_poisoned(void const volatile *addr); - // If at least on byte in [beg, beg+size) is poisoned, return the address + // If at least one byte in [beg, beg+size) is poisoned, return the address // of the first such byte. Otherwise return 0. void *__asan_region_is_poisoned(void *beg, size_t size); // Print the description of addr (useful when debugging in gdb). void __asan_describe_address(void *addr); + // Useful for calling from a debugger to get information about an ASan error. + // Returns 1 if an error has been (or is being) reported, otherwise returns 0. + int __asan_report_present(); + + // Useful for calling from a debugger to get information about an ASan error. + // If an error has been (or is being) reported, the following functions return + // the pc, bp, sp, address, access type (0 = read, 1 = write), access size and + // bug description (e.g. "heap-use-after-free"). Otherwise they return 0. + void *__asan_get_report_pc(); + void *__asan_get_report_bp(); + void *__asan_get_report_sp(); + void *__asan_get_report_address(); + int __asan_get_report_access_type(); + size_t __asan_get_report_access_size(); + const char *__asan_get_report_description(); + + // Useful for calling from the debugger to get information about a pointer. + // Returns the category of the given pointer as a constant string. + // Possible return values are "global", "stack", "stack-fake", "heap", + // "heap-invalid", "shadow-low", "shadow-gap", "shadow-high", "unknown". + // If global or stack, tries to also return the variable name, address and + // size. If heap, tries to return the chunk address and size. 'name' should + // point to an allocated buffer of size 'name_size'. + const char *__asan_locate_address(void *addr, char *name, size_t name_size, + void **region_address, size_t *region_size); + + // Useful for calling from the debugger to get the allocation stack trace + // and thread ID for a heap address. Stores up to 'size' frames into 'trace', + // returns the number of stored frames or 0 on error. + size_t __asan_get_alloc_stack(void *addr, void **trace, size_t size, + int *thread_id); + + // Useful for calling from the debugger to get the free stack trace + // and thread ID for a heap address. Stores up to 'size' frames into 'trace', + // returns the number of stored frames or 0 on error. + size_t __asan_get_free_stack(void *addr, void **trace, size_t size, + int *thread_id); + + // Useful for calling from the debugger to get the current shadow memory + // mapping. + void __asan_get_shadow_mapping(size_t *shadow_scale, size_t *shadow_offset); + // 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(void *pc, void *bp, void *sp, void *addr, int is_write, size_t access_size); - // Sets the exit code to use when reporting an error. - // Returns the old value. - int __asan_set_error_exit_code(int exit_code); - - // Sets the callback to be called right before death on error. - // Passing 0 will unset the callback. + // Deprecated. Call __sanitizer_set_death_callback instead. void __asan_set_death_callback(void (*callback)(void)); void __asan_set_error_report_callback(void (*callback)(const char*)); @@ -83,32 +120,6 @@ extern "C" { // the program crashes before ASan report is printed. void __asan_on_error(); - // 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". - size_t __asan_get_estimated_allocated_size(size_t size); - // Returns 1 if p was returned by the ASan allocator and is not yet freed. - // Otherwise returns 0. - int __asan_get_ownership(const void *p); - // Returns the number of bytes reserved for the pointer p. - // Requires (get_ownership(p) == true) or (p == 0). - size_t __asan_get_allocated_size(const void *p); - // Number of bytes, allocated and not yet freed by the application. - size_t __asan_get_current_allocated_bytes(); - // Number of bytes, mmaped by asan allocator to fulfill allocation requests. - // Generally, for request of X bytes, allocator can reserve and add to free - // lists a large number of chunks of size X to use them for future requests. - // All these chunks count toward the heap size. Currently, allocator never - // releases memory to OS (instead, it just puts freed chunks to free lists). - size_t __asan_get_heap_size(); - // Number of bytes, mmaped by asan allocator, which can be used to fulfill - // allocation requests. When a user program frees memory chunk, it can first - // fall into quarantine and will count toward __asan_get_free_bytes() later. - size_t __asan_get_free_bytes(); - // Number of bytes in unmapped pages, that are released to OS. Currently, - // always returns 0. - size_t __asan_get_unmapped_bytes(); // Prints accumulated stats to stderr. Used for debugging. void __asan_print_accumulated_stats(); @@ -116,14 +127,6 @@ extern "C" { // a string containing ASan runtime options. See asan_flags.h for details. const char* __asan_default_options(); - // Malloc hooks that may be optionally provided by user. - // __asan_malloc_hook(ptr, size) is called immediately after - // allocation of "size" bytes, which returned "ptr". - // __asan_free_hook(ptr) is called immediately before - // deallocation of "ptr". - void __asan_malloc_hook(void *ptr, size_t size); - void __asan_free_hook(void *ptr); - // The following 2 functions facilitate garbage collection in presence of // asan's fake stack. diff --git a/src/compiler-rt/include/sanitizer/common_interface_defs.h b/src/compiler-rt/include/sanitizer/common_interface_defs.h index 798f0c52f9..b736ed9e52 100644 --- a/src/compiler-rt/include/sanitizer/common_interface_defs.h +++ b/src/compiler-rt/include/sanitizer/common_interface_defs.h @@ -24,13 +24,28 @@ #ifdef __cplusplus extern "C" { #endif + // Arguments for __sanitizer_sandbox_on_notify() below. + typedef struct { + // Enable sandbox support in sanitizer coverage. + int coverage_sandboxed; + // File descriptor to write coverage data to. If -1 is passed, a file will + // be pre-opened by __sanitizer_sandobx_on_notify(). This field has no + // effect if coverage_sandboxed == 0. + intptr_t coverage_fd; + // If non-zero, split the coverage data into well-formed blocks. This is + // useful when coverage_fd is a socket descriptor. Each block will contain + // a header, allowing data from multiple processes to be sent over the same + // socket. + unsigned int coverage_max_block_size; + } __sanitizer_sandbox_arguments; + // Tell the tools to write their reports to "path." instead of stderr. void __sanitizer_set_report_path(const char *path); // 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); + void __sanitizer_sandbox_on_notify(__sanitizer_sandbox_arguments *args); // This function is called by the tool when it has just finished reporting // an error. 'error_summary' is a one-line string that summarizes @@ -47,11 +62,6 @@ extern "C" { void __sanitizer_unaligned_store32(void *p, uint32_t x); void __sanitizer_unaligned_store64(void *p, uint64_t x); - // Initialize coverage. - void __sanitizer_cov_init(); - // Record and dump coverage info. - void __sanitizer_cov_dump(); - // Annotate the current state of a contiguous container, such as // std::vector, std::string or similar. // A contiguous container is a container that keeps all of its elements @@ -86,10 +96,38 @@ extern "C" { const void *end, const void *old_mid, const void *new_mid); + // Returns true if the contiguous container [beg, end) is properly poisoned + // (e.g. with __sanitizer_annotate_contiguous_container), i.e. if + // - [beg, mid) is addressable, + // - [mid, end) is unaddressable. + // Full verification requires O(end-beg) time; this function tries to avoid + // such complexity by touching only parts of the container around beg/mid/end. + int __sanitizer_verify_contiguous_container(const void *beg, const void *mid, + const void *end); + + // Similar to __sanitizer_verify_contiguous_container but returns the address + // of the first improperly poisoned byte otherwise. Returns null if the area + // is poisoned properly. + const void *__sanitizer_contiguous_container_find_bad_address( + const void *beg, const void *mid, const void *end); // Print the stack trace leading to this call. Useful for debugging user code. void __sanitizer_print_stack_trace(); + // Sets the callback to be called right before death on error. + // Passing 0 will unset the callback. + void __sanitizer_set_death_callback(void (*callback)(void)); + + // Interceptor hooks. + // Whenever a libc function interceptor is called it checks if the + // corresponding weak hook is defined, and it so -- calls it. + // The primary use case is data-flow-guided fuzzing, where the fuzzer needs + // to know what is being passed to libc functions, e.g. memcmp. + // FIXME: implement more hooks. + void __sanitizer_weak_hook_memcmp(void *called_pc, const void *s1, + const void *s2, size_t n); + void __sanitizer_weak_hook_strncmp(void *called_pc, const char *s1, + const char *s2, size_t n); #ifdef __cplusplus } // extern "C" #endif diff --git a/src/compiler-rt/include/sanitizer/coverage_interface.h b/src/compiler-rt/include/sanitizer/coverage_interface.h new file mode 100644 index 0000000000..b93111b859 --- /dev/null +++ b/src/compiler-rt/include/sanitizer/coverage_interface.h @@ -0,0 +1,65 @@ +//===-- sanitizer/coverage_interface.h --------------------------*- C++ -*-===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// +// +// Public interface for sanitizer coverage. +//===----------------------------------------------------------------------===// + +#ifndef SANITIZER_COVERAG_INTERFACE_H +#define SANITIZER_COVERAG_INTERFACE_H + +#include + +#ifdef __cplusplus +extern "C" { +#endif + + // Initialize coverage. + void __sanitizer_cov_init(); + // Record and dump coverage info. + void __sanitizer_cov_dump(); + // Open .sancov.packed in the coverage directory and return the file + // descriptor. Returns -1 on failure, or if coverage dumping is disabled. + // This is intended for use by sandboxing code. + intptr_t __sanitizer_maybe_open_cov_file(const char *name); + // Get the number of unique covered blocks (or edges). + // This can be useful for coverage-directed in-process fuzzers. + uintptr_t __sanitizer_get_total_unique_coverage(); + // Get the number of unique indirect caller-callee pairs. + uintptr_t __sanitizer_get_total_unique_caller_callee_pairs(); + + // Reset the basic-block (edge) coverage to the initial state. + // Useful for in-process fuzzing to start collecting coverage from scratch. + // Experimental, will likely not work for multi-threaded process. + void __sanitizer_reset_coverage(); + // Set *data to the array of covered PCs and return the size of that array. + // 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 + +#endif // SANITIZER_COVERAG_INTERFACE_H diff --git a/src/compiler-rt/include/sanitizer/dfsan_interface.h b/src/compiler-rt/include/sanitizer/dfsan_interface.h index bcd4ae0024..05666f7367 100644 --- a/src/compiler-rt/include/sanitizer/dfsan_interface.h +++ b/src/compiler-rt/include/sanitizer/dfsan_interface.h @@ -85,6 +85,24 @@ size_t dfsan_get_label_count(void); /// callback executes. Pass in NULL to remove any callback. void dfsan_set_write_callback(dfsan_write_callback_t labeled_write_callback); +/// Writes the labels currently used by the program to the given file +/// descriptor. The lines of the output have the following format: +/// +///