summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [compiler-rt][builtins][PowerPC] Implemented __floattitf builtin on PowerPCAmy Kwan2019-01-104-0/+305
| | | | | | | | | | | | | This patch implements the long double __floattitf (int128_t) method for PowerPC -- specifically to convert a 128 bit integer into a long double (IBM double-double). To invoke this method, one can do so by linking against compiler-rt, via the --rtlib=compiler-rt command line option supplied to clang. Differential Revision: https://reviews.llvm.org/D54313/ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350818 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt][builtins][PowerPC] Implemented __fixunstfti builtin on PowerPCAmy Kwan2019-01-104-0/+865
| | | | | | | | | | | | | | | | | | This patch implements the __uint128_t __fixunstfti (long double) method for PowerPC -- specifically to convert a long double (IBM double-double) to an unsigned 128 bit integer. The general approach of this algorithm is to convert the high and low doubles of the long double and add them together if the doubles fit within 64 bits. However, additional adjustments and scaling is performed when the high or low double does not fit within a 64 bit integer. To invoke this method, one can do so by linking against compiler-rt, via the --rtlib=compiler-rt command line option supplied to clang. Differential Revision: https://reviews.llvm.org/D54911 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350815 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Mark tests as UNSUPPORTED on armDiana Picus2019-01-102-2/+2
| | | | | | | | | | Temporarily mark a couple of tests as UNSUPPORTED until we figure out why they fail on the thumb bots. The failure was introduced in r350139 - Add support for background thread on NetBSD in ASan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350806 91177308-0d34-0410-b5e6-96231b3b80d8
* i[Sanitizer] Enable pututxline interceptionDavid Carlier2019-01-101-1/+13
| | | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56495 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350796 91177308-0d34-0410-b5e6-96231b3b80d8
* [libfuzzer][MSVC] Make calls to builtin functions work with MSVCJonathan Metzman2019-01-096-25/+127
| | | | | | | | | | | | | | | | | | Summary: Replace calls to builtin functions with macros or functions that call the Windows-equivalents when targeting windows and call the original builtin functions everywhere else. This change makes more parts of libFuzzer buildable with MSVC. Reviewers: vitalybuka Reviewed By: vitalybuka Subscribers: mgorny, rnk, thakis Differential Revision: https://reviews.llvm.org/D56439 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350766 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Disable TSD dtor leak unit tests on FreeBSD x86 64David Carlier2019-01-091-0/+2
| | | | | | | | | | | | | - Assertion fails in the third iteration. Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56497 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350744 91177308-0d34-0410-b5e6-96231b3b80d8
* [test] Detect glibc-2.27+ and XFAIL appropriate testsMichal Gorny2019-01-093-0/+25
| | | | | | | | | | | | XFAIL the tests known to fail with glibc-2.27+. This takes away the burden of handling known failures from users, and ensures that we will be verbosely informed when they actually start working again. Bug report: https://bugs.llvm.org/show_bug.cgi?id=37804 Differential Revision: https://reviews.llvm.org/D56062 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350717 91177308-0d34-0410-b5e6-96231b3b80d8
* hwasan: Ignore loads and stores of size 0.Peter Collingbourne2019-01-092-1/+12
| | | | | | | | | | | | | | | | | | Now that memory intrinsics are instrumented, it's more likely that CheckAddressSized will be called with size 0. (It was possible before with IR like: %val = load [0 x i8], [0 x i8]* %ptr but I don't think clang will generate IR like that and the optimizer would normally remove it by the time it got anywhere near our pass anyway). The right thing to do in both cases is to disable the addressing checks (since the underlying memory intrinsic is a no-op), so that's what we do. Differential Revision: https://reviews.llvm.org/D56465 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350683 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Intercept fdevname on FreeBSDDavid Carlier2019-01-083-0/+80
| | | | | | | | | | | | | | - Is a file descriptor flavor FreeBSD's specific. - reentrant version included. Reviewers: vitalybuka, krytarowski, emaste Reviewed By: emaste Differential Revision: https://reviews.llvm.org/D56268 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350658 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix Mac compilation.Evgeniy Stepanov2019-01-081-0/+4
| | | | | | Provide an implementation of MemoryMappingLayout::Error() for Mac. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350601 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Support running without /procEvgeniy Stepanov2019-01-0814-27/+65
| | | | | | | | | | | | | | | | | | Summary: This patch lets ASan run when /proc is not accessible (ex. not mounted yet). It includes a special test-only flag that emulates this condition in an unpriviledged process. This only matters on Linux, where /proc is necessary to enumerate virtual memory mappings. Reviewers: vitalybuka, pcc, krytarowski Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D56141 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350590 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Support Objective-C @synchronized with tagged pointersJulian Lettner2019-01-072-19/+32
| | | | | | | | | | | | | | | | | | | Summary: Objective-C employs tagged pointers, that is, small objects/values may be encoded directly in the pointer bits. The resulting pointer is not backed by an allocation/does not point to a valid memory. TSan infrastructure requires a valid address for `Acquire/Release` and `Mutex{Lock/Unlock}`. This patch establishes such a mapping via a "dummy allocation" for each encountered tagged pointer value. Reviewers: dcoughlin, kubamracek, dvyukov, delcypher Reviewed By: dvyukov Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D56238 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350556 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt][Fuchsia] Replace _zx_vmar_allocate_old callPetr Hosek2019-01-061-4/+4
| | | | | | | | | This is the deprecated legacy interface, replace it with the current _zx_vmar_allocate one. Differential Revision: https://reviews.llvm.org/D56360 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350488 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "Switch Android from TLS_SLOT_TSAN(8) to TLS_SLOT_SANITIZER(6)""Evgeniy Stepanov2019-01-051-5/+5
| | | | | | This reapplies commit r348984. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350449 91177308-0d34-0410-b5e6-96231b3b80d8
* Bring back the pthread_create interceptor, but only on non-aarch64.Peter Collingbourne2019-01-041-0/+14
| | | | | | | | We still need the interceptor on non-aarch64 to untag the pthread_t and pthread_attr_t pointers and disable tagging on allocations done internally by glibc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350445 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable system-allocator-fallback.cc test on Android O and earlier.Peter Collingbourne2019-01-042-0/+6
| | | | | | | The dynamic loader on Android O appears to have a bug where it crashes when dlopening DF_1_GLOBAL libraries. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350444 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Reduce stack depot size on Android.Evgeniy Stepanov2019-01-042-2/+2
| | | | | | | | | | | | | | | | Summary: The default setting kTabSizeLog=20 results in an 8Mb global hash table, almost all of it in private pages. That is not a sane setting in a mobile, system-wide use case: with ~150 concurrent processes stack depot will account for more than 1Gb of RAM. Reviewers: kcc, pcc Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D56333 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350443 91177308-0d34-0410-b5e6-96231b3b80d8
* hwasan: Implement lazy thread initialization for the interceptor ABI.Peter Collingbourne2019-01-042-31/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem is similar to D55986 but for threads: a process with the interceptor hwasan library loaded might have some threads started by instrumented libraries and some by uninstrumented libraries, and we need to be able to run instrumented code on the latter. The solution is to perform per-thread initialization lazily. If a function needs to access shadow memory or add itself to the per-thread ring buffer its prologue checks to see whether the value in the sanitizer TLS slot is null, and if so it calls __hwasan_thread_enter and reloads from the TLS slot. The runtime does the same thing if it needs to access this data structure. This change means that the code generator needs to know whether we are targeting the interceptor runtime, since we don't want to pay the cost of lazy initialization when targeting a platform with native hwasan support. A flag -fsanitize-hwaddress-abi={interceptor,platform} has been introduced for selecting the runtime ABI to target. The default ABI is set to interceptor since it's assumed that it will be more common that users will be compiling application code than platform code. Because we can no longer assume that the TLS slot is initialized, the pthread_create interceptor is no longer necessary, so it has been removed. Ideally, lazy initialization should only cost one instruction in the hot path, but at present the call may cause us to spill arguments to the stack, which means more instructions in the hot path (or theoretically in the cold path if the spills are moved with shrink wrapping). With an appropriately chosen calling convention for the per-thread initialization function (TODO) the hot path should always need just one instruction and the cold path should need two instructions with no spilling required. Differential Revision: https://reviews.llvm.org/D56038 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350429 91177308-0d34-0410-b5e6-96231b3b80d8
* hwasan: Use system allocator to realloc and free untagged pointers in ↵Peter Collingbourne2019-01-048-14/+106
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | interceptor mode. The Android dynamic loader has a non-standard feature that allows libraries such as the hwasan runtime to interpose symbols even after the symbol already has a value. The new value of the symbol is used to relocate libraries loaded after the interposing library, but existing libraries keep the old value. This behaviour is activated by the DF_1_GLOBAL flag in DT_FLAGS_1, which is set by passing -z global to the linker, which is what we already do to link the hwasan runtime. What this means in practice is that if we have .so files that depend on interceptor-mode hwasan without the main executable depending on it, some of the libraries in the process will be using the hwasan allocator and some will be using the system allocator, and these allocators need to interact somehow. For example, if an instrumented library calls a function such as strdup that allocates memory on behalf of the caller, the instrumented library can reasonably expect to be able to call free to deallocate the memory. We can handle that relatively easily with hwasan by using tag 0 to represent allocations from the system allocator. If hwasan's realloc or free functions are passed a pointer with tag 0, the system allocator is called. One limitation is that this scheme doesn't work in reverse: if an instrumented library allocates memory, it must free the memory itself and cannot pass ownership to a system library. In a future change, we may want to expose an API for calling the system allocator so that instrumented libraries can safely transfer ownership of memory to system libraries. Differential Revision: https://reviews.llvm.org/D55986 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350427 91177308-0d34-0410-b5e6-96231b3b80d8
* [hwasan] Switch to 64 allocator with a dense size class map.Evgeniy Stepanov2019-01-035-15/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Replace the 32-bit allocator with a 64-bit one with a non-constant base address, and reduce both the number of size classes and the maximum size of per-thread caches. As measured on [1], this reduces average weighted memory overhead (MaxRSS) from 26% to 12% over stock android allocator. These numbers include overhead from code instrumentation and hwasan shadow (i.e. not a pure allocator benchmark). This switch also enables release-to-OS functionality, which is not implemented in the 32-bit allocator. I have not seen any effect from that on the benchmark. [1] https://android.googlesource.com/platform/system/extras/+/master/memory_replay/ Reviewers: vitalybuka, kcc Subscribers: kubamracek, cryptoad, llvm-commits Differential Revision: https://reviews.llvm.org/D56239 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350370 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-disable the sanitizer_common/TestCases/Posix/getfsent.cc test. Recent ↵Kuba Mracek2019-01-031-1/+1
| | | | | | macOS versions don't have the /etc/fstab file any more so we cannot test getfsent/setfsent APIs on Darwin. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350331 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Fix typo in funopen unit test.David Carlier2019-01-021-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350259 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Enable detection of lock-order-inversions for Objective-C @synchronizedJulian Lettner2019-01-024-5/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: @synchronized semantics can be synthesized by using existing mutex_[un]lock operations. ``` @synchronized(obj) { // ... } => { mutex_lock(obj); // ... mutex_unlock(obj); } ``` Let me know whether you think this a good idea. Reviewers: dcoughlin, dvyukov, kubamracek, delcypher Reviewed By: dvyukov Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55959 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350258 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Disable arc4random seeding apis on for Non NetBSD platforms.David Carlier2019-01-021-0/+6
| | | | | | | | | | | | | - arc4random_stir / arc4random_addrandom had been made obsolete (and removed) from FreeBSD 12. Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56210 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350249 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Enable funopen on FreeBSDDavid Carlier2019-01-022-1/+3
| | | | | | | | | | | Reviewers: krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56209 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350248 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Android does not provide <fstab.h>Evgeniy Stepanov2019-01-022-4/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350246 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Implement funopen*() interceptors for NetBSDMichal Gorny2019-01-022-0/+164
| | | | | | Differential Revision: https://reviews.llvm.org/D56158 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350233 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Implement popen, popenve, pclose interceptorsMichal Gorny2019-01-023-1/+80
| | | | | | | | | | | | | | | Implement the interceptors for popen(), pclose() and popenve() functions. The first two are POSIX, the third one is specific to NetBSD. popen() spawns a process and creates a FILE object piping data from/to that process. pclose() closes the pipe and waits for the process to terminate appropriately. For the purpose of popen(), the COMMON_INTERCEPTOR_FILE_OPEN macro is modified to allow null path parameter. Differential Revision: https://reviews.llvm.org/D56157 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350232 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Add tests for NetBSD funopen*() functionsMichal Gorny2019-01-022-0/+199
| | | | | | Differential Revision: https://reviews.llvm.org/D56154 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350231 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Add test for popen()Michal Gorny2019-01-021-0/+23
| | | | | | Differential Revision: https://reviews.llvm.org/D56153 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350230 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Add tests for more *putc and *getc variantsMichal Gorny2019-01-023-0/+45
| | | | | | | | | | | Add tests for the more character-oriented functions, that is: - fputc(), putc() and putchar() - getc_unlocked() - putc_unlocked() and putchar_unlocked() Differential Revision: https://reviews.llvm.org/D56152 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350229 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Fix devname_r() return type on !NetBSDMichal Gorny2019-01-021-4/+11
| | | | | | | | | | Update the interceptor for devname_r() to account for correct return types on different platforms. This function returns int on NetBSD but char* on FreeBSD/OSX. Noticed by @krytarowski. Differential Revision: https://reviews.llvm.org/D56150 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350228 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Rewrite more Posix tests to use assertsMichal Gorny2019-01-026-46/+26
| | | | | | | | | | Rewrite the tests for Posix functions that silently 'return 1' or 'exit(1)' on error, to instead verbosely report the error using assert. This is based on requests made in review of D56136. Differential Revision: https://reviews.llvm.org/D56149 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350227 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Add tests for more stdio.h functionsMichal Gorny2019-01-022-0/+60
| | | | | | | | | | | | | | | Add two new test cases that test the following stdio.h functions: - clearerr() - feof() - ferror() - fileno() - fgetc() - getc() - ungetc() Differential Revision: https://reviews.llvm.org/D56136 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350225 91177308-0d34-0410-b5e6-96231b3b80d8
* Reenable hard_rss_limit_mb_test.cc for android-26Kamil Rytarowski2018-12-291-3/+0
| | | | | | | Noted by eugenis@ in D55887. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350140 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for background thread on NetBSD in ASanKamil Rytarowski2018-12-293-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Change the point of calling MaybeStartBackgroudThread() from AsanInitInternal() that is too early on NetBSD to a constructor (with aid of C++11 lambda construct). Enable the code for background thread as is for NetBSD. Rename test/sanitizer_common/TestCases/Linux/hard_rss_limit_mb_test.cc to test/sanitizer_common/TestCases/hard_rss_limit_mb_test.cc and allow runs on NetBSD. This tests passes correctly. Reviewers: vitalybuka, joerg, eugenis Reviewed By: eugenis Subscribers: eugenis, kubamracek, fedor.sergeev, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55887 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350139 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Enable getfsent api for DarwinDavid Carlier2018-12-294-2/+5
| | | | | | | | | | | Reviewers: vitalybuka, kubamracek Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D56138 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350138 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce `LocalAddressSpaceView::LoadWritable(...)` and make the ↵Dan Liew2018-12-282-13/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Load(...)` method return a const pointer. Summary: This is a follow-up to r346956 (https://reviews.llvm.org/D53975). The purpose of this change to allow implementers of the `AddressSpaceView` to be able to distinguish between when a caller wants read-only memory and when a caller wants writable memory. Being able distinguish these cases allows implementations to optimize for the different cases and also provides a way to workaround possible platform restrictions (e.g. the low level platform interface for reading out-of-process memory may place memory in read-only pages). For allocator enumeration in almost all cases read-only is sufficient so we make `Load(...)` take on this new requirement and introduce the `LoadWritable(...)` variants for cases where memory needs to be writable. The behaviour of `LoadWritable(...)` documented in comments are deliberately very restrictive so that it will be possible in the future to implement a simple write-cache (i.e. just a map from target address to a writable region of memory). These restrictions can be loosened in the future if necessary by implementing a more sophisticated write-cache. rdar://problem/45284065 Reviewers: kcc, cryptoad, eugenis, kubamracek, george.karpenkov Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D54879 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350136 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculative fix for xray assembler error on MachO since r349976Reid Kleckner2018-12-281-1/+1
| | | | | | | This .file directive wasn't doing anything on MachO, and now that's diagnosed as an error. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350132 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] arc4random unit test missing case.David Carlier2018-12-281-0/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350124 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Intercept arc4random_buf / arc4random_addrandom on FreeBSD/NetBSDDavid Carlier2018-12-283-0/+89
| | | | | | | | | | | | | | | | - Disabled on purpose on Android and Darwin platform (for now). - Darwin supports it, would need interception in its specific code before enabling it. - Linux does not support it but only via third party library. - Android supports it via bionic however it is known to have issue with older versions of the implementations. Can be enabled by an Android committer later on if necessary once there is more 'certainity'/been more tested. Reviewers: krytarowski, vitalybuka Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D56125 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350123 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "[asan] Support running without /proc.", +1Evgeniy Stepanov2018-12-2815-84/+15
| | | | | | | | | Revert r350104 "[asan] Fix build on windows." Revert r350101 "[asan] Support running without /proc." These changes break Mac build, too. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350112 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a mistake in previousKamil Rytarowski2018-12-281-2/+2
| | | | | | | Assign correct ioctl(2) operation number. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350110 91177308-0d34-0410-b5e6-96231b3b80d8
* Update NetBSD ioctl(2) entries with 8.99.28Kamil Rytarowski2018-12-273-1/+54
| | | | | | | | | | Add SIOCSETHERCAP. Add commented out NVMM (NetBSD Virtual Machine Monitor) operations as this interface is still WIP and a subject to change. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350107 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable asan_and_llvm_coverage_test.cc for NetBSDKamil Rytarowski2018-12-271-2/+0
| | | | | | | LLVM profile is now enabled for this target. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350106 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Fix build on windows.Evgeniy Stepanov2018-12-271-1/+9
| | | | | | | | | | Reviewers: vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D56111 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350104 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable posix regex interceptors on linux.Evgeniy Stepanov2018-12-274-2/+7
| | | | | | | | | | | | Summary: They happen to work out of the box. Reviewers: rtrieu, vitalybuka Subscribers: kubamracek, fedor.sergeev, krytarowski, llvm-commits Differential Revision: https://reviews.llvm.org/D56088 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350103 91177308-0d34-0410-b5e6-96231b3b80d8
* Reimplement Thread Static Data MSan routines with TLSKamil Rytarowski2018-12-271-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Thread Static Data cannot be used in early init on NetBSD and FreeBSD. Reuse the MSan TSD API for compatibility with existing code with an alternative implementation using Thread Local Storage. New version uses Thread Local Storage to store a pointer with thread specific data. The destructor from TSD has been replaced with a TLS destrucutor that is called upon thread exit. Reviewers: joerg, vitalybuka, jfb Reviewed By: vitalybuka Subscribers: emaste, jfb, llvm-commits, #sanitizers, mgorny Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D55703 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350102 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Support running without /proc.Evgeniy Stepanov2018-12-2715-15/+76
| | | | | | | | | | | | | | | | | | Summary: This patch lets ASan run when /proc is not accessible (ex. not mounted yet). It includes a special test-only flag that emulates this condition in an unpriviledged process. This only matters on Linux, where /proc is necessary to enumerate virtual memory mappings. Reviewers: pcc, vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D55874 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350101 91177308-0d34-0410-b5e6-96231b3b80d8
* getfsent, unit test.David Carlier2018-12-271-0/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@350100 91177308-0d34-0410-b5e6-96231b3b80d8