summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixing #include order in tsan_new_delete.cc. Follow-up commit for r252284.Kuba Brecka2015-11-111-1/+1
| | | | llvm-svn: 252735
* [tsan] Add TSan unit test support for OS XKuba Brecka2015-11-119-40/+103
| | | | | | | | This patch enables building and running TSan unit tests on OS X. Differential Revision: http://reviews.llvm.org/D14546 llvm-svn: 252731
* Fix #if tests for PTRACE_GETREGS and others.Jay Foad2015-11-111-3/+6
| | | | | | | | | | | | | | | | | | Summary: On PowerPC64 Linux PTRACE_GETREGS is a #define and PT_GETREGS is not. On other systems it's the other way round. Extend the #ifs to check for both PTRACE_* and PT_*. This fixes test/sanitizer_common/TestCases/Linux/ptrace.cc when msan is enabled for PowerPC64. Reviewers: zatrazz, kcc, eugenis, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14564 llvm-svn: 252730
* [ASan] Add stress test for asynch signals in nonhalting mode.Yury Gribov2015-11-111-0/+106
| | | | | | Differential Revision: http://reviews.llvm.org/D14241 llvm-svn: 252729
* [Asan] Added missing hunk to previous commit.Yury Gribov2015-11-111-7/+2
| | | | llvm-svn: 252724
* [ASan] Enable optional ASan recovery.Yury Gribov2015-11-1110-88/+320
| | | | | | Differential Revision: http://reviews.llvm.org/D12318 llvm-svn: 252723
* sanitizer: speedup coverage by 33%Dmitry Vyukov2015-11-111-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Atomic RMW is not necessary in InitializeGuardArray. It is supposed to run when no user code runs. And if user code runs concurrently, then the atomic RMW won't help anyway. So replace it with non-atomic RMW. InitializeGuardArray takes more than 50% of time during re2 fuzzing: real 0m47.215s 51.56% a.out a.out [.] __sanitizer_reset_coverage 6.68% a.out a.out [.] __sanitizer_cov 3.41% a.out a.out [.] __sanitizer::internal_bzero_aligned16(void*, unsigned long) 1.79% a.out a.out [.] __asan::Allocator::Allocate(unsigned long, unsigned long, With this change: real 0m31.661s 26.21% a.out a.out [.] sanitizer_reset_coverage 10.12% a.out a.out [.] sanitizer_cov 5.38% a.out a.out [.] __sanitizer::internal_bzero_aligned16(void*, unsigned long) 2.53% a.out a.out [.] __asan::Allocator::Allocate(unsigned long, unsigned long, That's 33% speedup. Reviewed in http://reviews.llvm.org/D14537 llvm-svn: 252715
* Implement `internal_start/join_thread` on Mac OS XIsmail Pazarbasi2015-11-111-2/+12
| | | | | | | | | | | | | | Summary: Depends on D9637 Test Plan: Reviewers: kcc, glider, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9638 llvm-svn: 252696
* [tsan] Pass correct interposed function prefix to report functionIsmail Pazarbasi2015-11-111-1/+7
| | | | | | | | | | | | | | Summary: On Darwin, interposed functions are prefixed with "wrap_". On Linux, they are prefixed with "__interceptor_". Reviewers: dvyukov, samsonov, glider, kcc, kubabrecka Subscribers: zaks.anna, llvm-commits Differential Revision: http://reviews.llvm.org/D14512 llvm-svn: 252695
* Disabling sancov.cc on windows.Mike Aizatsky2015-11-111-2/+4
| | | | | | | | | It can't be built due to cxxabi missing. Will fix later. Differential Revision: http://reviews.llvm.org/D14559 llvm-svn: 252689
* Sancov in C++.Mike Aizatsky2015-11-112-0/+286
| | | | | | | | | | Summary: First batch of sancov.py rewrite in C++. Supports "-print" and "-covered_functions" commands. Differential Revision: http://reviews.llvm.org/D14356 llvm-svn: 252683
* [CMake] [macho_embedded] Only set sys root if the variable is set, this ↵Chris Bieneman2015-11-101-1/+5
| | | | | | | | prevents passing empty -isysroot arguments This is a minor cleanup to the macho_embedded builtins. llvm-svn: 252619
* [CMake] Cleaning up flags for Darwin builtinsChris Bieneman2015-11-101-23/+4
| | | | | | | * Setting CMAKE_*_FLAGS_${BUILD_TYPE} isn't really needed since we're setting the same value everywhere * functions sanitize variables differently from macros, darwin_add_embedded_builtin_libraries should be a macro otherwise it won't alter the variables. llvm-svn: 252618
* Rollback 252570 for further investigationXinliang David Li2015-11-101-2/+0
| | | | llvm-svn: 252575
* [CMake] Temporary workaround to support building builtins on darwin with a ↵Chris Bieneman2015-11-101-3/+18
| | | | | | | | toolchain that may not support all x86 and arm architectures. This is at least a little better than my first attempt. We still really need a way to do compile checks without linking. llvm-svn: 252572
* [PGO] Add LLVM main include dir to profile runtime buildXinliang David Li2015-11-101-0/+2
| | | | | | | | | | | | Runtime code implicitly depends on the defintions and const values defined in LLVM proper, but currently such dependency is made implicitly by duplicating code across two dirs. As part of the PGO cleanup effort, there will be changes to share common sources. This is a preparation patch to enable it (NFC). Differential Revision: http://reviews.llvm.org/D14487 llvm-svn: 252570
* Revert "[CMake] [macho_embedded] Check to make sure the compiler supports ↵Chris Bieneman2015-11-101-13/+1
| | | | | | | | the architectures before generating build targets" This commit reverts r252525. I was not really thinking about this fix properly. This doesn't work because it relys on try_compile checks which do a full compile & link. I'm going to put in a temporary solution as an interm step until we have a way to perform compiler checks without linking. llvm-svn: 252569
* [CMake] Don't pass -fPIC when compiling the darwin builtinsChris Bieneman2015-11-091-1/+1
| | | | | | This change makes CMake match autoconf. llvm-svn: 252547
* [CMake] Fixing a typo in variable name ARG_*->LIB_*Chris Bieneman2015-11-091-1/+1
| | | | llvm-svn: 252543
* [CMake] Removing extra underscore.Chris Bieneman2015-11-091-1/+1
| | | | | | Fixing a typo. llvm-svn: 252534
* [CMake] [Darwin] Don't generate lipo commands if we don't have libraries to ↵Chris Bieneman2015-11-091-12/+16
| | | | | | | | put into the fat archive. Not making sure there are thin libraries results in some difficult to diagnose build failures. This check should make those build failures go away. llvm-svn: 252527
* [CMake] [macho_embedded] Check to make sure the compiler supports the ↵Chris Bieneman2015-11-091-1/+13
| | | | | | | | architectures before generating build targets If we don't check the compiler's capabilities we end up generating build targets that the compiler might not be able to build. llvm-svn: 252525
* [compiler-rt] [asan] Use same shadow offset for aarch64Adhemerval Zanella2015-11-094-18/+7
| | | | | | | | This patch makes ASAN for aarch64 use the same shadow offset for all currently supported VMAs (39 and 42 bits). The shadow offset is the same for 39-bit (36). llvm-svn: 252497
* CFI: try to make test/cfi/base-derived-destructor.cpp pass on WindowsHans Wennborg2015-11-091-1/+1
| | | | llvm-svn: 252468
* [tsan] Skip building libcxx_tsan on OS XKuba Brecka2015-11-091-1/+2
| | | | | | | | The TSan-instrumented version of libcxx doesn't even build on OS X at this point. Let's skip it from the OS X build for now, since most of TSan functionality doesn't depend on it. This will enable `check-tsan` to be run. Differential Revision: http://reviews.llvm.org/D14486 llvm-svn: 252455
* [PGO] Cleanup: fix function-data field namesXinliang David Li2015-11-082-10/+10
| | | | | | | | To make them the same as the common def in InstrProfData.inc. This is a preparation to make the runtime code to use the template as well. NFC llvm-svn: 252421
* [tsan] Turn lit test deadlocks into failures (OS X)Kuba Brecka2015-11-078-0/+8
| | | | | | | | Several tests currently deadlock when the lit test suite is run on OS X. Let's mark them as unsupported. Differential Revision: http://reviews.llvm.org/D14443 llvm-svn: 252402
* [CMake] Need to filter ${arch}/*.c builtins as well as ${arch}/*.S builtins.Chris Bieneman2015-11-061-1/+1
| | | | | | This was broken in r248542 when I refactored this to support builtins where ${arch} didn't match the directory prefix (i.e. armv7s). llvm-svn: 252365
* [ASan] Add two new functions to DLL thunk.Alexey Samsonov2015-11-061-0/+3
| | | | llvm-svn: 252359
* [tsan] Add Darwin support for lit testsKuba Brecka2015-11-061-3/+9
| | | | | | | | | | | This patch enables running lit tests on OS X: 1) Simply enable tests for Darwin (they were restricted to Linux and FreeBSD). 2) Disable using instrumented libcxx (libcxx_tsan) on Darwin. 3) On Darwin, override abort_on_error=0, otherwise all tests would generate crash logs and take much longer to process. Differential Revision: http://reviews.llvm.org/D14439 llvm-svn: 252309
* tsan: make invisible test barrier portableDmitry Vyukov2015-11-062-21/+18
| | | | | | | | | | | The current implementation does not work on darwin and can have issues with other OSes in future. See http://reviews.llvm.org/D14427 Make it portable once and for all (minus usleep call). Reviewed in: http://reviews.llvm.org/D14434 llvm-svn: 252292
* [tsan] Enable new/delete C++ interceptors for OS XKuba Brecka2015-11-062-1/+9
| | | | | | | | This patch adds `tsan_new_delete.cc` into the OS X build. Differential Revision: http://reviews.llvm.org/D14424 llvm-svn: 252284
* [tsan] Replace pthread_yield with sched_yield in lit testsKuba Brecka2015-11-063-3/+3
| | | | | | | | OS X doesn't have `pthread_yield`. Let's use `sched_yield` instead. Differential Revision: http://reviews.llvm.org/D14428 llvm-svn: 252283
* Trying to fix the FreeBSD build breakage due to r251916.Kuba Brecka2015-11-061-1/+1
| | | | | | http://lab.llvm.org:8011/builders/sanitizer_x86_64-freebsd/builds/6395 llvm-svn: 252277
* [compiler-rt][aarch64] New tests for 128-bit floating-point builtins, fixes ↵Sergey Dmitrouk2015-11-0513-6/+280
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | of tests and __fixuint Summary: The following tests for 128-bit floating-point type behaved in a strange way, thought it were bugs, but seem to be mistakes in tests: * `fixtfsi` test checked for `0x80000001` as a value returned for number less than can be represented, while `LONG_MIN` should be returned on saturation; * `fixunstfdi` wasn't enabled for AArch64, only for PPC, but there is nothing PPC specific in that test; * `multf3` tried to underflow multiplication by producing result with 16383 exponent, while there are still 112 bits of fraction plus implicit bit, so resultant exponent should be 16497. Tests for some other builtins didn't exist: * `fixtfdi` * `fixtfti` * `fixunstfti` They were made by copying similar files and adjusting for wider types and adding/removing some reasonable/extra checks. Also `__fixuint` seems to have off by one error, updated tests to catch this case. Reviewers: rengolin, zatrazz, howard.hinnant, t.p.northover, jmolloy, enefaim Subscribers: aemerson, llvm-commits, rengolin Differential Revision: http://reviews.llvm.org/D14187 llvm-svn: 252180
* [tsan] Fix build warnings on OS XKuba Brecka2015-11-052-2/+12
| | | | | | | | Fixing `tsan_interceptors.cc`, which on OS X produces a bunch of warnings about unused constants and functions. Differential Revision: http://reviews.llvm.org/D14381 llvm-svn: 252165
* Lint warning fixup for r252160 ("[tsan] Fix pthread_once interceptor for OS X").Kuba Brecka2015-11-051-1/+1
| | | | llvm-svn: 252163
* [tsan] Fix the memcpy interceptor to be memmove compatible on OS XKuba Brecka2015-11-051-1/+4
| | | | | | | | On OS X, memcpy and memmove are actually aliases of the same implementation, which means the interceptor of memcpy is also invoked when memmove is called. The current implementation of the interceptor uses `internal_memcpy` to perform the actual memory operation, which can produce an incorrect result when memmove semantics are expected. Let's call `internal_memmove` instead. Differential Revision: http://reviews.llvm.org/D14336 llvm-svn: 252162
* [tsan] Allow memmove interceptor to be used when TSan is not initializedKuba Brecka2015-11-051-3/+5
| | | | | | | | A call to memmove is used early during new thread initialization on OS X. This patch uses the `COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED` check, similarly to how we deal with other early-used interceptors. Differential Revision: http://reviews.llvm.org/D14377 llvm-svn: 252161
* [tsan] Fix pthread_once interceptor for OS XKuba Brecka2015-11-051-1/+5
| | | | | | | | TSan has a re-implementation of `pthread_once` in its interceptor, which assumes that the `pthread_once_t *once_control` pointer is actually pointing to a "storage" which is zero-initialized and used for the atomic operations. However, that's not true on OS X, where pthread_once_t is a structure, that contains a header (with a magic value) and the actual storage follows after that. This patch skips the header to make the interceptor work on OS X. Differential Revision: http://reviews.llvm.org/D14379 llvm-svn: 252160
* [tsan] Alternative ThreadState storage for OS XKuba Brecka2015-11-054-2/+70
| | | | | | | | This implements a "poor man's TLV" to be used for TSan's ThreadState on OS X. Based on the fact that `pthread_self()` is always available and reliable and returns a valid pointer to memory, we'll use the shadow memory of this pointer as a thread-local storage. No user code should ever read/write to this internal libpthread structure, so it's safe to use it for this purpose. We lazily allocate the ThreadState object and store the pointer here. Differential Revision: http://reviews.llvm.org/D14288 llvm-svn: 252159
* [tsan] Use malloc zone interceptors on OS X, part 2Kuba Brecka2015-11-056-8/+72
| | | | | | | | TSan needs to use a custom malloc zone on OS X, which is already implemented in ASan. This patch uses the sanitizer_common implementation in `sanitizer_malloc_mac.inc` for TSan as well. Reviewed at http://reviews.llvm.org/D14330 llvm-svn: 252155
* [Sanitizer] Use ReportMmapFailureAndDie() in all applicable mmap variants on ↵Alexey Samsonov2015-11-054-16/+12
| | | | | | Posix. llvm-svn: 252121
* [TSan] Fix mmap/mmap64 interceptor signature.Alexey Samsonov2015-11-051-4/+4
| | | | | | | mmap() offset argument has type off_t, not unsigned. off_t is usually 64-bit on 64-bit Linux. llvm-svn: 252103
* Revert "Reapply: [asan] On OS X, log reports to syslog and os_trace"Juergen Ributzka2015-11-0414-178/+46
| | | | | | | Looks like this commit is deadlocking the ASAN tests on the green dragon bot (http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA/). llvm-svn: 252076
* Asan: utility function to determine first wrongly poisoned byte inMike Aizatsky2015-11-044-12/+36
| | | | | | | | container. Differential Revision: http://reviews.llvm.org/D14341 llvm-svn: 252071
* Whitespace fixup for r252052. NFC.Kuba Brecka2015-11-041-1/+2
| | | | llvm-svn: 252053
* [tsan] Use malloc zone interceptors on OS X, part 1 (refactoring)Kuba Brecka2015-11-043-344/+388
| | | | | | | | TSan needs to use a custom malloc zone on OS X, which is already implemented in ASan. This patch is a refactoring patch (NFC) that extracts this from ASan into sanitizer_common, where we can reuse it in TSan. Reviewed at http://reviews.llvm.org/D14330 llvm-svn: 252052
* [tsan] Handle libdispatch worker threads on OS XKuba Brecka2015-11-046-13/+63
| | | | | | | | On OS X, GCD worker threads are created without a call to pthread_create. We need to properly register these threads with ThreadCreate and ThreadStart. This patch uses a libpthread API (`pthread_introspection_hook_install`) to get notifications about new threads and about threads that are about to be destroyed. Differential Revision: http://reviews.llvm.org/D14328 llvm-svn: 252049
* [tsan] Shadow memory setup for OS XKuba Brecka2015-11-045-108/+136
| | | | | | | | Updating the shadow memory initialization in `tsan_platform_mac.cc` to also initialize the meta shadow and to mprotect the memory ranges that need to be avoided. Differential Revision: http://reviews.llvm.org/D14324 llvm-svn: 252044
OpenPOWER on IntegriCloud