summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
* Support for 32-bit mingw-w64 in compiler-rt.Martell Malone2015-11-035-4/+88
| | | | | | | | | | | | Add chkstk/alloca for gcc objects. Replace or instructions with test, the latter should be marginally more efficent, as it does not write to memory. Differential Revision: http://reviews.llvm.org/D14044 Patch by vadimcn llvm-svn: 251928
* Fixup for r251923 to fix a warning about an extra semicolon.Kuba Brecka2015-11-031-2/+2
| | | | llvm-svn: 251924
* Reapply r251916 ("[tsan] Port TSan interceptors on OS X").Kuba Brecka2015-11-031-36/+86
| | | | llvm-svn: 251923
* Revert r251916 ("[tsan] Port TSan interceptors on OS X").Kuba Brecka2015-11-031-151/+103
| | | | llvm-svn: 251922
* Reapply r251918 ("[tsan] Fix build errors for TSan on OS X").Kuba Brecka2015-11-036-44/+52
| | | | llvm-svn: 251920
* Revert r251918 ("[tsan] Fix build errors for TSan on OS X").Kuba Brecka2015-11-035-48/+43
| | | | llvm-svn: 251919
* [tsan] Fix build errors for TSan on OS XKuba Brecka2015-11-035-43/+48
| | | | | | | | | | This patch moves a few functions from `sanitizer_linux_libcdep.cc` to `sanitizer_posix_libcdep.cc` in order to use them on OS X as well. Plus a few more small build fixes. This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point. Differential Revision: http://reviews.llvm.org/D14235 llvm-svn: 251918
* [tsan] Port TSan interceptors on OS XKuba Brecka2015-11-031-103/+151
| | | | | | | | | | This patch modifies `tsan_interceptors.cc` to be buildable on OS X. Several of the intercepted methods are not available on OS X, so we need to `#if !SANITIZER_MAC` them. Plus a few other fixes, e.g. `pthread_yield` doesn't exist, let's use `internal_sched_yield` instead. This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point. Differential Revision: http://reviews.llvm.org/D14237 llvm-svn: 251916
* [tsan] CMake support for TSan on OS XKuba Brecka2015-11-031-45/+59
| | | | | | | | Hi, this patch adds a CMake flag called `COMPILER_RT_ENABLE_TSAN_OSX`, which is off by default. If enabled, the build system will be building the OS X version of the TSan runtime library (called `libclang_rt.tsan_osx_dynamic.dylib`). I'll submit patches that fix OS X build errors shortly. This is part of an effort to port TSan to OS X, and it's one the very first steps. Don't expect TSan on OS X to actually work or pass tests at this point. llvm-svn: 251915
* Revert "Apply modernize-use-default to compiler-rt."Alexey Samsonov2015-10-308-11/+15
| | | | | | | | | | | | This reverts commit r250823. Replacing at least some of empty constructors with "= default" variants is a semantical change which we don't want. E.g. __tsan::ClockBlock contains a union of large arrays, and it's critical for correctness and performance that we don't memset() these arrays in the constructor. llvm-svn: 251717
* Sanitizer: define WIN32_LEAN_AND_MEANSaleem Abdulrasool2015-10-294-0/+4
| | | | | | | | Define WIN32_LEAN_AND_MEAN before including Windows.h. This is already being done in some places. This does it more broadly. This permits building ASAN on Linux for Winndows, as well as reduces the amount of included declarations. llvm-svn: 251649
* [compiler-rt] [msan] Unify aarch64 mappingAdhemerval Zanella2015-10-293-38/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch unify the 39-bit and 42-bit mapping for aarch64 to use only one instrumentation algorithm. A runtime check avoid mapping 42-bit only segments for 39-bit kernels. The mapping to use now is for 39 and 42-bits: 0x00000000000ULL-0x01000000000ULL MappingDesc::INVALID 0x01000000000ULL-0x02000000000ULL MappingDesc::SHADOW 0x02000000000ULL-0x03000000000ULL MappingDesc::ORIGIN 0x03000000000ULL-0x04000000000ULL MappingDesc::SHADOW 0x04000000000ULL-0x05000000000ULL MappingDesc::ORIGIN 0x05000000000ULL-0x06000000000ULL MappingDesc::APP 0x06000000000ULL-0x07000000000ULL MappingDesc::INVALID 0x07000000000ULL-0x08000000000ULL MappingDesc::APP And only for 42-bits: 0x08000000000ULL-0x09000000000ULL MappingDesc::INVALID 0x09000000000ULL-0x0A000000000ULL MappingDesc::SHADOW 0x0A000000000ULL-0x0B000000000ULL MappingDesc::ORIGIN 0x0B000000000ULL-0x0F000000000ULL MappingDesc::INVALID 0x0F000000000ULL-0x10000000000ULL MappingDesc::APP 0x10000000000ULL-0x11000000000ULL MappingDesc::INVALID 0x11000000000ULL-0x12000000000ULL MappingDesc::APP 0x12000000000ULL-0x17000000000ULL MappingDesc::INVALID 0x17000000000ULL-0x18000000000ULL MappingDesc::SHADOW 0x18000000000ULL-0x19000000000ULL MappingDesc::ORIGIN 0x19000000000ULL-0x20000000000ULL MappingDesc::INVALID 0x20000000000ULL-0x21000000000ULL MappingDesc::APP 0x21000000000ULL-0x26000000000ULL MappingDesc::INVALID 0x26000000000ULL-0x27000000000ULL MappingDesc::SHADOW 0x27000000000ULL-0x28000000000ULL MappingDesc::ORIGIN 0x28000000000ULL-0x29000000000ULL MappingDesc::SHADOW 0x29000000000ULL-0x2A000000000ULL MappingDesc::ORIGIN 0x2A000000000ULL-0x2B000000000ULL MappingDesc::APP 0x2B000000000ULL-0x2C000000000ULL MappingDesc::INVALID 0x2C000000000ULL-0x2D000000000ULL MappingDesc::SHADOW 0x2D000000000ULL-0x2E000000000ULL MappingDesc::ORIGIN 0x2E000000000ULL-0x2F000000000ULL MappingDesc::APP 0x2F000000000ULL-0x39000000000ULL MappingDesc::INVALID 0x39000000000ULL-0x3A000000000ULL MappingDesc::SHADOW 0x3A000000000ULL-0x3B000000000ULL MappingDesc::ORIGIN 0x3B000000000ULL-0x3C000000000ULL MappingDesc::APP 0x3C000000000ULL-0x3D000000000ULL MappingDesc::INVALID 0x3D000000000ULL-0x3E000000000ULL MappingDesc::SHADOW 0x3E000000000ULL-0x3F000000000ULL MappingDesc::ORIGIN 0x3F000000000ULL-0x40000000000ULL MappingDesc::APP And although complex it provides a better memory utilization that previous one. [1] http://reviews.llvm.org/D13817 llvm-svn: 251625
* Reapply: [asan] On OS X, log reports to syslog and os_traceAnna Zaks2015-10-2812-46/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 (In addition, add sanitizer_common_libcdep.cc to buildgo.sh to avoid build failures on Linux.) llvm-svn: 251577
* [asan] Fix asan_device_setup script on KitKat.Evgeniy Stepanov2015-10-281-0/+2
| | | | | | | | | app_process32, when started via a shell script wrapper, needs a different security context to satisty SELinux. Patch by Abhishek Arya. llvm-svn: 251572
* sanitizer_common: be more verbose, when symbolizer is not found.Ivan Krasin2015-10-281-2/+4
| | | | | | | | | | | | | | | | | Summary: I have othen been stuck when I got an ASAN report, but no symbols are resolved. The reasons might be different, and it always requires a bit of detective work to track down. These more verbose error messages will help the users like me. Reviewers: samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14135 llvm-svn: 251553
* Revert "[asan] On OS X, log reports to syslog and os_trace"Anna Zaks2015-10-2710-168/+43
| | | | | | | | This reverts commit 251447. (Which caused failures on a Linux bot.) llvm-svn: 251467
* [asan] On OS X, log reports to syslog and os_traceAnna Zaks2015-10-2710-43/+168
| | | | | | | | | | | | | | | | | | | | | | | | | When ASan currently detects a bug, by default it will only print out the text of the report to stderr. This patch changes this behavior and writes the full text of the report to syslog before we terminate the process. It also calls os_trace (Activity Tracing available on OS X and iOS) with a message saying that the report is available in syslog. This is useful, because this message will be shown in the crash log. For this to work, the patch makes sure we store the full report into error_message_buffer unconditionally, and it also strips out ANSI escape sequences from the report (they are used when producing colored reports). I've initially tried to log to syslog during printing, which is done on Android right now. The advantage is that if we crash during error reporting or the produced error does not go through ScopedInErrorReport, we would still get a (partial) message in the syslog. However, that solution is very problematic on OS X. One issue is that the logging routine uses GCD, which may spawn a new thread on its behalf. In many cases, the reporting logic locks threadRegistry, which leads to deadlocks. Reviewed at http://reviews.llvm.org/D13452 llvm-svn: 251447
* [asan] Sort headers.Anna Zaks2015-10-271-4/+4
| | | | llvm-svn: 251446
* [asan] On OS X, tag mapped regions with VM_MEMORY_ANALYSIS_TOOL tagAnna Zaks2015-10-271-0/+2
| | | | | | | | | | This will tag all mmapped memory sanitizers use with "Performance tool data" when viewed in vmmap. (Even though sanitizers are not performance tools, it's the best available match and better than having the unidentified objects.) http://reviews.llvm.org/D13609 llvm-svn: 251445
* asan_symbolize.py: Call llvm-symbolizer with --functions=linkage instead of ↵Alexey Samsonov2015-10-261-1/+1
| | | | | | --functions=short. llvm-svn: 251356
* [compiler-rt] Fix ptrace interceptor for aarch64Adhemerval Zanella2015-10-261-5/+14
| | | | | | | | | | | | | | This patch fixes the ptrace interceptor for aarch64. The PTRACE_GETREGSET ptrace syscall with with invalid memory might zero the iovec::iov_base field and then masking the subsequent check after the syscall (since it will be 0 and it will not trigger an invalid access). The fix is to copy the value on a local variable and use its value on the checks. The patch also adds more coverage on the Linux/ptrace.cc testcase by addding check for PTRACE_GETREGSET for both general and floating registers (aarch64 definitions added only). llvm-svn: 251331
* [compiler-rt] Enable ptrace sanitizer for armAdhemerval Zanella2015-10-264-7/+29
| | | | | | | | | | This patch enables the ptrace syscall interceptors for arm and adds support for both PTRACE_GETVFPREGS and PTRACE_SETVFPREGS used to get the VFP register from ARM. The ptrace tests is also updated with arm and PTRACE_GETVFPREGS tests. llvm-svn: 251321
* [sanitizer-coverage] introduce __sanitizer_get_total_unique_caller_callee_pairsKostya Serebryany2015-10-221-1/+7
| | | | llvm-svn: 251071
* [msan] Intercept process_vm_readv/writev.Evgeniy Stepanov2015-10-222-0/+35
| | | | llvm-svn: 251059
* [msan] Build unit test shared library code with -fPIC.Evgeniy Stepanov2015-10-211-5/+1
| | | | llvm-svn: 250957
* [lsan] [aarch64] Add support for AArch64Adhemerval Zanella2015-10-214-4/+9
| | | | | | | | | | This patch add support for leak sanitizer for aarch64. Similar to MIPS it uses a SizeClassAllocator32 due VMA constraints (aarch64 currently supports 39 and 42-bit VMA). It also fixes the android build issue. llvm-svn: 250898
* Apply modernize-use-default to compiler-rt.Angel Garcia Gomez2015-10-208-15/+11
| | | | | | | | | | | | Summary: Replace empty bodies of default constructors and destructors with '= default'. Reviewers: klimek, bkramer Subscribers: alexfh, cfe-commits Differential Revision: http://reviews.llvm.org/D13892 llvm-svn: 250823
* [ubsan] Fix looksLikeFloatCastOverflowDataV1 heuristic to work if one of the ↵Yury Gribov2015-10-201-4/+6
| | | | | | | | types is unknown. Differential revision: http://reviews.llvm.org/D13775 llvm-svn: 250806
* [msan] Intercept mincore.Evgeniy Stepanov2015-10-192-0/+19
| | | | llvm-svn: 250761
* [msan] Intercept pthread_getcancel*.Evgeniy Stepanov2015-10-192-0/+27
| | | | llvm-svn: 250752
* [PGO] Eliminate prof data register calls on FreeBSD platformXinliang David Li2015-10-192-2/+2
| | | | | | | This is a follow up patch of r250199 after verifying the start/stop section symbols work as spected on FreeBSD. llvm-svn: 250680
* Use struct type instead of raw array for raw profile header (NFC)Xinliang David Li2015-10-163-20/+30
| | | | | | | | | | This patch introduces a well defined header struct to represent raw profile header instead of using raw array. Previously the raw array is used in two different files and is very error prone when header structure is re-organized. This is a small cleanup with NFC. llvm-svn: 250561
* builtins: Expand out floating point exponents for MSVCSaleem Abdulrasool2015-10-152-5/+5
| | | | | | | | | MSVC 2013 doesnt support C99 fully, including the hexidecimal floating point representation. Use the expanded value to permit building with it. Patch by Tee Hao Wei! llvm-svn: 250365
* builtins: use C implementation on MSVCSaleem Abdulrasool2015-10-151-36/+49
| | | | | | | | | The assembly implementations use GNU syntax which MSVC doesn't handle. Rather than duplicate the code in a second syntax, use the C implementations. Patch by Tee Hao Wei! llvm-svn: 250360
* builtins: __builtin_clzll for x86 on MSVCSaleem Abdulrasool2015-10-151-2/+12
| | | | | | | | | Add an implementation for __builtin_clzll on MSVC even when _BitScanForward4 is unavailable. Patch by Tee Hao Wei! llvm-svn: 250359
* [PGO]: Eliminate calls to __llvm_profile_register_function for Linux.Xinliang David Li2015-10-133-1/+50
| | | | | | | | | On Linux, the profile runtime can use __start_SECTNAME and __stop_SECTNAME symbols defined by the linker to locate the start and end location of a named section (with C name). This eliminates the need for instrumented binary to call __llvm_profile_register_function during start-up time. llvm-svn: 250200
* [msan] Add __msan_copy_shadow interface function.Evgeniy Stepanov2015-10-122-0/+8
| | | | | | This can be used to annotate copies of memory that are not observed by MSan. llvm-svn: 250124
* [asan] Zero initialize sem_t in sem_init.Evgeniy Stepanov2015-10-123-7/+29
| | | | | | | | | | Old version of sem_init (GLIBC_2.0) fails to initialize parts of sem_t that are used in sem_timedwait. This is fixed in GLIBC_2.1, but since ASan interceptors downgrade sem_* to the oldest available version, this can introduce bugs that are only present in sanitized build. Workaround by zero-initializing sem_t in sem_init. llvm-svn: 250113
* Revert "builtins: enable builtins build for MSVC"Saleem Abdulrasool2015-10-111-1/+1
| | | | | | | | Revert once more. This seems to fail to build on the buildbots which build with ninja rather than MSBuild/Visual Studio. This requires further build infrastructure changes to deal with the assembly routines. llvm-svn: 250001
* Revert "Revert "builtins: enable builtins build for MSVC""Saleem Abdulrasool2015-10-111-1/+1
| | | | | | | Previous changes should now permit building on MSVC 2013 in addition to MSVC 2015. llvm-svn: 250000
* builtins: define and use ALWAYS_INLINESaleem Abdulrasool2015-10-112-4/+5
| | | | | | Abstract out the always inline spelling similar to ASAN. NFC. llvm-svn: 249986
* builtins: use NORETURN macroSaleem Abdulrasool2015-10-111-3/+3
| | | | | | | Now that we have the NORETURN macro, use that to mark the function as noreturn, rather than the GNU __attribute__. llvm-svn: 249985
* builtins: spell inline as __inlineSaleem Abdulrasool2015-10-1013-57/+53
| | | | | | | | | __inline is a vendor specific spelling for inline. clang and gcc treat it the same as inline, and is available in MSVC 2013 which does not implement C99 (VS2015 supports the inline keyword though). This will allow us to build the builtins using MSVC. llvm-svn: 249953
* Revert "builtins: enable builtins build for MSVC"Saleem Abdulrasool2015-10-101-1/+1
| | | | | | | Seems to break on the sanitizer buildbot. Revert until it can be fixed properly. llvm-svn: 249950
* builtins: silence a MSVC warningSaleem Abdulrasool2015-10-101-0/+2
| | | | | | _BitReverse64 is only available on ARM and x64. Guard it accordingly. llvm-svn: 249949
* builtins: enable builtins build for MSVCSaleem Abdulrasool2015-10-101-1/+1
| | | | | | Patch by Tee Hao Wei! llvm-svn: 249948
* [CMake] [macho_embedded] [builtins] Need to also drop the bswap builtins.Chris Bieneman2015-10-091-2/+0
| | | | llvm-svn: 249914
* [CMake] hand tuning the macho_embedded export lists to match the current ↵Chris Bieneman2015-10-092-2/+1
| | | | | | Xcode distribution. llvm-svn: 249912
* [CMake] Hand tuning the exclude lists for libclang_rt.10.4.aChris Bieneman2015-10-092-0/+131
| | | | llvm-svn: 249888
* Fix msan tests build.Evgeniy Stepanov2015-10-081-2/+4
| | | | | | | | | | CMake build rules listed -I flags for two different libc++ header locations which broke when libc++ headers started using include_next. Also change -I to -isystem to avoid compiler warning about include_next. llvm-svn: 249759
OpenPOWER on IntegriCloud