summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
* [CMake] Actually adding the TODO comment I mentioned in r252927.Chris Bieneman2015-11-121-0/+3
| | | | | | Turns out you need to save before committing. llvm-svn: 252928
* [CMake] [builtins] Adding missing architecture-specific builtins.Chris Bieneman2015-11-121-0/+8
| | | | | | Also added a TODO comment to make the build system throw an error if the CMakeLists gets out of sync again. llvm-svn: 252927
* tsan: fix windows Go buildDmitry Vyukov2015-11-122-1/+3
| | | | | | | | | | | Go build does not link in whatever library provides these symbols: # runtime/race race_windows_amd64.syso:gotsan.cc:(.text+0x578f): undefined reference to `__sanitizer::DumpProcessMap()' race_windows_amd64.syso:gotsan.cc:(.text+0xee33): undefined reference to `EnumProcessModules' race_windows_amd64.syso:gotsan.cc:(.text+0xeeb9): undefined reference to `GetModuleInformation' llvm-svn: 252922
* tsan: fix windows Go buildDmitry Vyukov2015-11-121-0/+2
| | | | | | CompareModulesBase is an unused function. llvm-svn: 252907
* [tsan] Add global symbolication support into DlAddrSymbolizerKuba Brecka2015-11-121-2/+8
| | | | | | | | `DlAddrSymbolizer` is used on OS X when we're running inside a sandbox that prevents us from spawning an external symbolizer. This patch adds support for symbolication of globals (implements `SymbolizeData`) for `DlAddrSymbolizer`. Differential Revision: http://reviews.llvm.org/D14613 llvm-svn: 252899
* [tsan] Allow symbolizers that don't obtain global symbol sizesKuba Brecka2015-11-121-3/+8
| | | | | | | | The default symbolizer, `llvm-symbolizer` provides sizes for global symbols. On OS X, we want to also allow using `atos` (because it's available everywhere and users don't need to copy/install it) and `dladdr` (it's the only available option when running in a sandbox). However, these symbolizers do not supply the symbol sizes, only names and starting addresses. This patch changes the reporting functions to hide the size of the symbol when this value is unavailable, and modifies tests to make this part of the report "optional". Differential Revision: http://reviews.llvm.org/D14608 llvm-svn: 252896
* tsan: disable abort_on_error for GoDmitry Vyukov2015-11-121-1/+5
| | | | | | | It does not work as expected. Go runtime handles SIGABRT and crashes with a loud message. llvm-svn: 252892
* tsan: fix Go build on linuxDmitry Vyukov2015-11-122-2/+2
| | | | | | librt is not linked in in Go build. llvm-svn: 252877
* [asan] Remove system_malloc_zoneKuba Brecka2015-11-121-14/+3
| | | | | | | | This seems to be dead code – `system_malloc_zone` is initialized as null and we never assign to it. This code is apparently currently never executed (in ASan), but is causes trouble for the TSan OS X port. Let's replace the checks with `COMMON_MALLOC_ENTER` (`ENSURE_ASAN_INITED()`). Differential Revision: http://reviews.llvm.org/D14334 llvm-svn: 252876
* tsan: fix unused function warning in Go buildDmitry Vyukov2015-11-121-1/+1
| | | | llvm-svn: 252875
* tsan: fix mac Go buildDmitry Vyukov2015-11-121-2/+2
| | | | | | cur_thread does not exist in Go. llvm-svn: 252874
* [tsan] Filter OS X architectures for unit testingKuba Brecka2015-11-121-1/+5
| | | | | | | | The TSan unit test build currently fails if we're also building the iOS parts of compiler-rt, because `TSAN_SUPPORTED_ARCH` contains ARM64. For unit tests, we need to filter this only to host architecture(s). Differential Revision: http://reviews.llvm.org/D14604 llvm-svn: 252873
* [sanitizer coverage] reset global counters in __sanitizer_reset_coverageKostya Serebryany2015-11-111-0/+6
| | | | llvm-svn: 252815
* [Windows] Add exports for dll_host test broken by r252071 and r251071Reid Kleckner2015-11-111-0/+2
| | | | llvm-svn: 252784
* tsan: fix unused variable in Go buildDmitry Vyukov2015-11-111-6/+6
| | | | llvm-svn: 252746
* Revert r252683 - "Sancov in C++."Diego Novillo2015-11-112-288/+0
| | | | | | | | This reverts commits r252683 and r252689. This tool should not live here. See http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20151109/311862.html for discussion. llvm-svn: 252744
* [tsan] Rename tsan_test_util_linux.cc to tsan_test_util_posix.ccKuba Brecka2015-11-112-2/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D14575 llvm-svn: 252741
* Implement some TLS support for PowerPC64.Jay Foad2015-11-112-7/+33
| | | | | | | | | | | | Summary: This is enough to get the asan static_tls.cc test case working. Reviewers: eugenis, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D14574 llvm-svn: 252738
* 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-117-27/+92
| | | | | | | | 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] Added missing hunk to previous commit.Yury Gribov2015-11-111-7/+2
| | | | llvm-svn: 252724
* [ASan] Enable optional ASan recovery.Yury Gribov2015-11-116-88/+188
| | | | | | 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
* Rollback 252570 for further investigationXinliang David Li2015-11-101-2/+0
| | | | llvm-svn: 252575
* [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
* [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
* [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
* [ASan] Add two new functions to DLL thunk.Alexey Samsonov2015-11-061-0/+3
| | | | llvm-svn: 252359
* [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
* 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-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0412-175/+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-042-10/+20
| | | | | | | | 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-042-336/+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
OpenPOWER on IntegriCloud