summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
* [tsan] Add support for dispatch event sourcesKuba Brecka2016-04-077-0/+286
| | | | | | | | GCD has APIs for event sources, we need some more release-acquire pairs to avoid false positives in TSan. Differential Revision: http://reviews.llvm.org/D18515 llvm-svn: 265660
* [tsan] Fix synchronization in dispatch_syncKuba Brecka2016-04-072-24/+96
| | | | | | | | In the interceptor for dispatch_sync, we're currently missing synchronization between the callback and the code *after* the call to dispatch_sync. This patch fixes this by adding an extra release+acquire pair to dispatch_sync() and similar APIs. Added a testcase. Differential Revision: http://reviews.llvm.org/D18502 llvm-svn: 265659
* [tsan] Fix Darwin tests (missing FileCheck's)Kuba Brecka2016-04-0711-16/+16
| | | | | | | | A little embarrassing, but we're missing the call to FileCheck in several Darwin tests. Let's fix this. Differential Revision: http://reviews.llvm.org/D18503 llvm-svn: 265658
* [sancov] removing flaky test case (win)Mike Aizatsky2016-04-071-8/+1
| | | | llvm-svn: 265627
* [sancov] enabling coverage edge pruning by default.Mike Aizatsky2016-04-065-12/+12
| | | | | | Differential Revision: http://reviews.llvm.org/D18845 llvm-svn: 265614
* Another place for CMAKE_HOST_UNIXSean Silva2016-04-061-1/+1
| | | | | | | | | | | | | If we don't create the target, don't try to add it as a dependency. After r265595, we were only creating the SanitizerLintCheck when `CMAKE_HOST_UNIX` was true. CMake was emitting a warning: The dependency target "SanitizerLintCheck" of target "check-ubsan" does not exist. llvm-svn: 265613
* sync up with master copyXinliang David Li2016-04-061-1/+1
| | | | llvm-svn: 265609
* Use `CMAKE_HOST_UNIX` to check the host.Sean Silva2016-04-061-1/+1
| | | | | | `UNIX` is for the target. llvm-svn: 265595
* [tsan] Fix freebsd build.Yabin Cui2016-04-051-1/+3
| | | | | | | | | | | | | | Summary: Freebsd doesn't have <sys/personality.h>, so call personality() only in SANITIZER_LINUX. Reviewers: llvm-commits, dvyukov, zatrazz, rengolin, beanz Subscribers: beanz, emaste Differential Revision: http://reviews.llvm.org/D18785 llvm-svn: 265378
* [tsan] Disable randomized address space on aarch64 linux.Yabin Cui2016-04-041-0/+15
| | | | | | | | | | | | | | | | | Summary: After patch https://lkml.org/lkml/2015/12/21/340 is introduced in linux kernel, the random gap between stack and heap is increased from 128M to 36G on 39-bit aarch64. And it is almost impossible to cover this big range. So we need to disable randomized virtual space on aarch64 linux. Reviewers: llvm-commits, zatrazz, dvyukov, rengolin Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines Differential Revision: http://reviews.llvm.org/D18526 llvm-svn: 265366
* Apply suggestion from HJ Lu to avoid misaligned stack in testReid Kleckner2016-04-041-1/+1
| | | | | | Fixes PR27191 llvm-svn: 265322
* [asan,tsan] Make Darwin-specific tests more stable (use ↵Kuba Brecka2016-04-0413-18/+18
| | | | | | ignore_interceptors_accesses=1 for GCD tests and printf instead of NSLog). llvm-svn: 265300
* tsan: fix ignore handling in signal handlersDmitry Vyukov2016-04-041-0/+3
| | | | | | | | | | | We've reset thr->ignore_reads_and_writes, but forget to do thr->fast_state.ClearIgnoreBit(). So ignores were not effective reset and fast_state.ignore_bit was corrupted if signal handler itself uses ignores. Properly reset/restore fast_state.ignore_bit around signal handlers. llvm-svn: 265288
* [sanitizer] Make AtosSymbolizer more resilient when symbolicating a zero addressKuba Brecka2016-04-031-0/+1
| | | | llvm-svn: 265269
* Fix warnings uncovered by building with clang-clReid Kleckner2016-04-012-3/+3
| | | | | | | Move ifdefs to avoid unused static helpers. Move alignment attribute so that it is respected in GCC and MSVC. llvm-svn: 265153
* Fix a load of -Wunknown-pragma warnings from clang-clReid Kleckner2016-04-011-2/+2
| | | | llvm-svn: 265152
* [CMake] Provide the ability to skip stripping when generating dSYMsChris Bieneman2016-03-311-1/+5
| | | | | | For debugging it is useful to be able to generate dSYM files but not strip the executables. This change adds the ability to skip stripping by setting COMPILER_RT_EXTERNALIZE_DEBUGINFO_SKIP_STRIP=On. llvm-svn: 265057
* Update copyright year to 2016.Paul Robinson2016-03-301-1/+1
| | | | llvm-svn: 264948
* [asan] Mark the initialization-bug.cc unsupported on OS X Yosemite and olderRyan Govostes2016-03-302-0/+9
| | | | | | | This test should fail on OS X Yosemite and older, and pass on OS X El Capitan and newer as well as on other platforms. llvm-svn: 264938
* [cmake] Get the MSVC version by running cl rather than relying on MSVC_VERSIONReid Kleckner2016-03-301-7/+23
| | | | | | | MSVC_VERSION comes from the _MSC_VER macro, which won't correspond to the STL version if the host compiler is clang-cl. llvm-svn: 264901
* [profile] Remove quotes around env variable, NFCVedant Kumar2016-03-301-1/+1
| | | | llvm-svn: 264824
* [profile] Test error reporting by writing to a temp directoryVedant Kumar2016-03-301-1/+1
| | | | | | | | | | This test case is meant to check whether verbose error logging works. It does this by _failing_ to write a profile to a path corresponding to a directory. Make this clearer by writing to a temporary directory. Patch suggested by Sean Silva! llvm-svn: 264817
* [libprofile] Make this test express intent a bit better.Sean Silva2016-03-301-8/+8
| | | | | | | | | This also makes it work on PS4 a bit better. For running the libprofile tests on PS4, we are sneaking environment variables through on the command line, so the extra argument for LLVM_PROFILE_FILE was messing up the simple `argc < 2` check. llvm-svn: 264812
* Fix comment in testXinliang David Li2016-03-291-3/+6
| | | | llvm-svn: 264792
* [profile] Make a test work if run by the super-userVedant Kumar2016-03-291-4/+1
| | | | llvm-svn: 264773
* [asan] Make the Darwin/dead-strip.c test require El Capitan or newerRyan Govostes2016-03-292-6/+9
| | | | llvm-svn: 264766
* [Darwin] [Builtins] Cleaning up OS X exclude lists. NFC.Chris Bieneman2016-03-293-58/+6
| | | | | | This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives. llvm-svn: 264751
* [Darwin] [Builtins] Remove multi3 from the exclude list.Chris Bieneman2016-03-291-1/+0
| | | | | | This addresses PR27077. For some historical reason Darwin wasn't shipping multi3 in the compiler builtin library or in the OS builtin library. This caused building ffmpeg to fail because Polly was generating calls to multi3. It is easy enough to just add the builtin. llvm-svn: 264750
* [Darwin] [Builtins] Cleaning up 10.4 exclude lists NFCChris Bieneman2016-03-292-44/+50
| | | | | | This just gets rid of a bunch of empty object file warnings. It doesn't impact the generated archives. llvm-svn: 264749
* [libprofile] Use one fewer -mllvm option in this test.Sean Silva2016-03-281-2/+2
| | | | | | | AFAIK there is still no way to avoid `-mllvm -disable-vp=false` currently. llvm-svn: 264682
* [PGO] More comments how function pointers for indirect calls are mappedAdam Nemet2016-03-281-0/+9
| | | | | | | | | | | | | | | | to function names Summary: Hopefully this will make it easier for the next person to figure all this out... Reviewers: bogner, davidxl Subscribers: davidxl, cfe-commits Differential Revision: http://reviews.llvm.org/D18489 llvm-svn: 264680
* [libprofile] Handle '\\' in __llvm_profile_recursive_mkdirSean Silva2016-03-282-3/+5
| | | | | | | | | | | | | | This is implicitly needed at least by gcc-flag-compatibility.test The thing that needs it is the `\` preceding the "default.profraw" appended internally by clang when doing `-fprofile-use=`. Clang uses `\` because is uses sys::path::append which will use `\` on a Windows host. This is wrong, but I don't think there's an easy way to solve it (maybe just always using `/` since places that accept `\` also tend to accept `/`, but not the other way around). llvm-svn: 264665
* [asan] Add runtime support for __asan_(un)register_image_globalsRyan Govostes2016-03-289-7/+99
| | | | | | | | | | | This change introduces routines that register and unregister all instrumented globals in a loaded executable image. These routines are only implemented on Darwin, where globals metadata is expected to be placed in the __DATA,__asan_globals section. Review: http://reviews.llvm.org/D16841 llvm-svn: 264644
* [tsan] Fix a crash when exiting the main thread (e.g. dispatch_main)Kuba Brecka2016-03-282-1/+43
| | | | | | | | This patch fixes the custom ThreadState destruction on OS X to avoid crashing when dispatch_main calls pthread_exit which quits the main thread. Differential Revision: http://reviews.llvm.org/D18496 llvm-svn: 264627
* [libprofile] Make this test not depend on previous runs.Sean Silva2016-03-281-0/+1
| | | | llvm-svn: 264626
* [libprofile] Make this test a bit more specificSean Silva2016-03-281-16/+16
| | | | llvm-svn: 264625
* [PGO] Update r264612 to use C-style commentAdam Nemet2016-03-281-2/+4
| | | | llvm-svn: 264615
* [PGO] Comment how function pointers for indirect calls are mapped to ↵Adam Nemet2016-03-281-0/+2
| | | | | | | | | | | | | | | | function names Summary: Hopefully this will make it easier for the next person to figure all this out... Reviewers: bogner, davidxl Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D18490 llvm-svn: 264612
* Fix-up for OS X test failure after r264451 ("Add memset, memmove, and memcpy ↵Kuba Brecka2016-03-281-1/+1
| | | | | | to the common interceptors") llvm-svn: 264571
* Make vp merge test more robustXinliang David Li2016-03-261-14/+17
| | | | llvm-svn: 264521
* [libprofile] Adjust dummy condition to be more forgiving.Sean Silva2016-03-261-1/+1
| | | | | | | | | | | On PS4, we have to fake environment variables by passing extra command line arguments, so the dummy test `argc > 1` was failing. The condition is just a dummy condition that the compiler can't fold away, so the number is arbitrary as long as the condition is false. Increase the number it compares against. llvm-svn: 264491
* [libprofile] Add some missing `env` prefixes on commands.Sean Silva2016-03-263-3/+3
| | | | llvm-svn: 264490
* Stop depending on the keys in a hash table being in a particular order.Richard Smith2016-03-261-77/+83
| | | | llvm-svn: 264488
* [asan] bump the scariness score of read-after-frees (based on feedback from ↵Kostya Serebryany2016-03-262-4/+8
| | | | | | the Chrome security team) llvm-svn: 264481
* [profile] Add integration test to validate PGO function namesVedant Kumar2016-03-254-1/+129
| | | | | | Differential Revision: http://reviews.llvm.org/D18485 llvm-svn: 264480
* [sanitizer] Add memset, memmove, and memcpy to the common interceptorsDerek Bruening2016-03-257-36/+78
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Currently, sanitizer_common_interceptors.inc has an implicit, undocumented assumption that the sanitizer including it has previously declared interceptors for memset and memmove. Since the memset, memmove, and memcpy routines require interception by many sanitizers, we add them to the set of common interceptions, both to address the undocumented assumption and to speed future tool development. They are intercepted under a new flag intercept_intrin. The tsan interceptors are removed in favor of the new common versions. The asan and msan interceptors for these are more complex (they incur extra interception steps and their function bodies are exposed to the compiler) so they opt out of the common versions and keep their own. Reviewers: vitalybuka Subscribers: zhaoqin, llvm-commits, kcc Differential Revision: http://reviews.llvm.org/D18465 llvm-svn: 264451
* [asan] Intercept all Heap* related imports from ucrtbase.dllReid Kleckner2016-03-245-23/+171
| | | | | | | | | | | | | | | | | | | | | | ucrtbase.dll appears to be built with some kind of cross-module inlining, because there are calls to imported Heap* routines sprinkled throughout the code. This inlining defeats our attempts to hotpatch malloc, _malloc_base, and related functions. Failing to intercept an allocation or deallocation results in a crash when the program attempts to deallocate or reallocate memory with the wrong allocator. This change patches the IAT of ucrtbase.dll to replace the addresses of the imported Heap* functions with implementations provided by ASan. We don't globally intercept the win32 Heap* functions because they are typically used by system DLLs that run before ASan initializes. Eventually, we may want to intercept them, but for now I think this is the minimal change that will keep ASan stable. Reviewers: samsonov Differential Revision: http://reviews.llvm.org/D18413 llvm-svn: 264327
* Follow-up for r264261, adding a comment explaining what the testcase does.Kuba Brecka2016-03-241-0/+5
| | | | llvm-svn: 264271
* [tsan] Fix fork() and fork-based tests for OS XKuba Brecka2016-03-246-6/+7
| | | | | | | | On OS X, fork() under TSan asserts (in debug builds only) because REAL(fork) calls some intercepted functions, which check that no internal locks are held via CheckNoLocks(). But the wrapper of fork intentionally holds some locks. This patch fixes that by using ScopedIgnoreInterceptors during the call to REAL(fork). After that, all the fork-based tests seem to pass on OS X, so let's just remove all the UNSUPPORTED: darwin annotations we have. Differential Revision: http://reviews.llvm.org/D18409 llvm-svn: 264261
* [tsan] Use direct syscalls for internal_mmap and internal_munmap on OS XKuba Brecka2016-03-242-2/+26
| | | | | | | | On OS X, internal_mmap just uses mmap, which can invoke callbacks into libmalloc (e.g. when MallocStackLogging is enabled). This can subsequently call other intercepted functions, and this breaks our Darwin-specific ThreadState initialization. Let's use direct syscalls in internal_mmap and internal_munmap. Added a testcase. Differential Revision: http://reviews.llvm.org/D18431 llvm-svn: 264259
OpenPOWER on IntegriCloud