summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Add NetBSD support in asan_interceptors.hKamil Rytarowski2017-08-071-1/+1
| | | | | | | | | | | | | | | | | | | Summary: Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, filcab, kcc, fjricci, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36375 llvm-svn: 310246
* [asan] Return sizeof missed by r309914Vitaly Buka2017-08-071-1/+1
| | | | llvm-svn: 310244
* Add NetBSD support in sanitizer_errno.hKamil Rytarowski2017-08-051-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: NetBSD ships with __errno (value for __errno_location) like Android. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, fjricci, kcc, filcab Reviewed By: vitalybuka Subscribers: llvm-commits, srhines, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36360 llvm-svn: 310182
* Add NetBSD support in sanitizer_unwind_linux_libcdep.ccKamil Rytarowski2017-08-051-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD is a POSIX-like and BSD-family system. Reuse FreeBSD and Linux code. NetBSD uses DWARF ExceptionHandler. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, filcab, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, emaste, llvm-commits, kubamracek, aprantl, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36314 llvm-svn: 310179
* Add NetBSD support in sanitizer_linux_libcdep.ccKamil Rytarowski2017-08-041-6/+10
| | | | | | | | | | | | | | | | | | | | | Summary: When possible reuse FreeBSD and Linux code. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka, filcab Reviewed By: vitalybuka Subscribers: srhines, emaste, kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36320 llvm-svn: 310143
* Add NetBSD support in interception.hKamil Rytarowski2017-08-041-3/+3
| | | | | | | | | | | | | | | | | | | Summary: Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, filcab, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36323 llvm-svn: 310140
* Add NetBSD support in sanitizer_syscall_generic.incKamil Rytarowski2017-08-041-3/+27
| | | | | | | | | | | | | | | | | | | | | | | Summary: This adds: - NetBSD specific aliases for renamed syscalls, - differentiate internal_syscall, internal_syscall64, internal_syscall_ptr as there are various types of syscalls on NetBSD. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: joerg, kcc, vitalybuka, filcab Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36316 llvm-svn: 310139
* [asan] Check for pvalloc overlowKostya Kortchinsky2017-08-041-0/+4
| | | | | | | | | | | | | | | | | | | | Summary: Last one of the `pvalloc` overflow checks! `CheckForPvallocOverflow` was introduced with D35818 to detect when `pvalloc` would wrap when rounding up to the next multiple of the page size. Add this check to ASan's `pvalloc` implementation. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D36257 llvm-svn: 310119
* Add NetBSD support in sanitizer_procmaps_freebsd.ccKamil Rytarowski2017-08-041-6/+28
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This adds NetBSD specific: - ReadProcMaps() - MemoryMappingLayout::Next() This code is largely shared with FreeBSD. Part of the code inspired by the original work on libsanitizer in GCC 5.4 by Christos Zoulas. Sponsored by <The NetBSD Foundation> Reviewers: kcc, joerg, filcab, vitalybuka, fjricci Reviewed By: fjricci Subscribers: emaste, kubamracek, mgorny, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D35551 llvm-svn: 310116
* CFI: Move STL allocator blacklist to clangVlad Tsyrklevich2017-08-041-6/+0
| | | | | | | | | | | | | | | | | Summary: The regular expression to match STL allocators can't easily account for C++ mangling compression and fails to match some valid instances of STL allocators. Perform this logic in clang instead. Motivated by crbug.com/751385. Reviewers: pcc, kcc, llvm-commits Reviewed By: pcc Differential Revision: https://reviews.llvm.org/D36291 llvm-svn: 310109
* [compiler-rt] Check for empty buffer in Addr2LineProcess::ReadFromSymbolizerAlex Shlyapnikov2017-08-042-1/+5
| | | | | | | | | | | | | | | | | | | This fixes a bug in the ReadFromSymbolizer method of the Addr2LineProcess class; if the input is too large, the returned buffer will be null and will consequently fail the CHECK. The proposed fix is to simply check if the buffer consists of only a null-terminator and return if so (in effect skipping that frame). I tested by running one of the unit tests both before and after my change. Submitted on behalf of david-y-lam. Reviewers: eugenis, alekseyshl, kcc Reviewed By: alekseyshl Differential Revision: https://reviews.llvm.org/D36207 llvm-svn: 310089
* [msan] Switch the pvalloc overflow test to a lit testBenjamin Kramer2017-08-041-6/+0
| | | | | | | | | | | | The test was not passing on targets where allocator_may_return_null defaults to true. Change the test to a lit test so that we can test both situations. Patch by Kostya Kortchinsky! Differential Revision: https://reviews.llvm.org/D36302 llvm-svn: 310033
* [builtins] Use Interlocked* intrinsics for atomics on MSVCMartin Storsjo2017-08-031-8/+6
| | | | | | | | | | | | Tested on MSVC 2013, 2015 and 2017 targeting X86, X64 and ARM. This fixes building emutls.c for Windows for ARM (both with clang which don't need these atomics fallbacks at all, but just failed due to the immintrin.h include before, and with MSVC). Differential Revision: https://reviews.llvm.org/D36071 llvm-svn: 309974
* [asan] Allocator support for FuchsiaVitaly Buka2017-08-033-23/+35
| | | | | | | | | | | | | | | | Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: alekseyshl Subscribers: srhines, cryptoad, kubamracek, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36190 llvm-svn: 309914
* [XRay][compiler-rt] Allow for building the XRay runtime without PREINIT ↵Dean Michael Berris2017-08-032-1/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | initialization. Summary: Define a build-time configuration option for the XRay runtime to determine whether the archive will add an entry to the `.preinit_array` section of the binary. We also allow for initializing the XRay data structures with an explicit call to __xray_init(). This allows us to give users the capability to initialize the XRay data structures on demand. This can allow us to start porting XRay to platforms where `.preinit_array` isn't a supported section. It also allows us to limit the effects of XRay in the initialization sequence for applications that are sensitive to this kind of interference (i.e. large binaries) or those that want to package XRay control in libraries. Future changes should allow us to build two different library archives for the XRay runtime, and allow clang users to determine which version to link. Reviewers: dblaikie, kpw, pelikan Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D36080 llvm-svn: 309909
* [tsan] Check for pvalloc overlowKostya Kortchinsky2017-08-022-1/+11
| | | | | | | | | | | | | | | | | | Summary: `CheckForPvallocOverflow` was introduced with D35818 to detect when pvalloc would wrap when rounding up to the next multiple of the page size. Add this check to TSan's pvalloc implementation. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D36245 llvm-svn: 309897
* [msan] Check for pvalloc overflowKostya Kortchinsky2017-08-022-0/+10
| | | | | | | | | | | | | | | | | | | | | Summary: CheckForPvallocOverflow was introduced with D35818 to detect when pvalloc would wrap when rounding up to the next multiple of the page size. Add this check to MSan's pvalloc implementation. This time I made sure I was actually running (and writing) the correct tests, and that they are passing... Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36164 llvm-svn: 309883
* Add new ASAN_OPTION: sleep_after_init.Kostya Serebryany2017-08-022-0/+9
| | | | | | | | | | | | | | Summary: As mentioned in https://github.com/google/sanitizers/issues/834, suggested option can be handy for debugging. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D35409 llvm-svn: 309854
* This ppc64 implementation of clear_cache works for both big and little endian.Sterling Augustine2017-08-021-1/+1
| | | | llvm-svn: 309848
* [asan] Interceptors for FuchsiaVitaly Buka2017-08-023-13/+40
| | | | | | | | | | | | | | | | | | | | Summary: Fuchsia uses the "memintrinsics" interceptors, though not via any generalized interception mechanism. It doesn't use any other interceptors. Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: vitalybuka Subscribers: kubamracek, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36189 llvm-svn: 309798
* [sanitizer_common] Fuchsia-specific implementation of SanitizerCoverageVitaly Buka2017-08-023-0/+239
| | | | | | | | | | | | | | | | Submitted on behalf of Roland McGrath. Reviewers: kcc, eugenis, alekseyshl, vitalybuka Reviewed By: kcc Subscribers: filcab, vitalybuka, phosek, llvm-commits, kubamracek, mgorny Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D35866 llvm-svn: 309797
* [XRay][compiler-rt] Remove use of std::mutex and std::shared_ptr from global ↵Dean Michael Berris2017-08-023-29/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | scope. Summary: This change attempts to remove all the dependencies we have on std::mutex and any std::shared_ptr construction in global variables. We instead use raw pointers to these objects, and construct them on the heap. In cases where it's possible, we lazily initialize these pointers. While we do not have a replacement for std::shared_ptr yet in compiler-rt, we use this work-around to avoid having to statically initialize the objects as globals. Subsequent changes should allow us to completely remove our dependency on std::shared_ptr and instead have our own implementation of the std::shared_ptr and std::weak_ptr semantics (or completely rewrite the implementaton to not need these standard-library provided abstractions). Reviewers: dblaikie, kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36078 llvm-svn: 309792
* [sanitizer_common] Fuchsia-specific symbolizerVitaly Buka2017-08-014-9/+130
| | | | | | | | | | | | | | | | | | | | Summary: Fuchsia doesn't support built-in symbolization per se at all. Instead, it always emits a Fuchsia-standard "symbolizer markup" format that makes it possible for a post-processing filter to massage the logs into symbolized format. Hence, it does not support user-specified formatting options for backtraces or other symbolization. Reviewers: vitalybuka, alekseyshl, kcc Subscribers: kubamracek, mgorny, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36032 llvm-svn: 309760
* [sanitizer_common] Fuchsia OS support codeVitaly Buka2017-08-014-1/+540
| | | | | | | | | | | | | | | | Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: vitalybuka Subscribers: cryptoad, srhines, kubamracek, mgorny, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36031 llvm-svn: 309756
* [sanitizer_common] Disable filesystem-related code for FuchsiaVitaly Buka2017-08-013-1/+22
| | | | | | | | | | | | | | | | | | | | Summary: Fuchsia doesn't support filesystem access per se at low level. So it won't use any of the filesystem-oriented code in sanitizer_common. Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: vitalybuka Subscribers: kubamracek, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36029 llvm-svn: 309749
* [sanitizer_common] Fuchsia support for interceptorsVitaly Buka2017-08-012-24/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Actually Fuchsia non-support for interceptors. Fuchsia doesn't use interceptors in the common sense at all. Almost all system library functions don't need interception at all, because the system libraries are just themselves compiled with sanitizers enabled and have specific hook interfaces where needed to inform the sanitizer runtime about thread lifetimes and the like. For the few functions that do get intercepted, they don't use a generic mechanism like dlsym with RTLD_NEXT to find the underlying system library function. Instead, they use specific extra symbol names published by the system library (e.g. __unsanitized_memcpy). Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc, filcab Reviewed By: filcab Subscribers: kubamracek, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36028 llvm-svn: 309745
* [ubsan] Enable UBSan build for FuchsiaVitaly Buka2017-08-011-1/+1
| | | | | | | | | | | | | | | | Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: vitalybuka Subscribers: srhines, kubamracek, mgorny, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36033 llvm-svn: 309742
* Revert rL309634 until upstream buildbots have upgraded libc.Sterling Augustine2017-08-012-15/+1
| | | | llvm-svn: 309704
* [sanitizer-coverage] Fix Windows build broken by r309655Vitaly Buka2017-08-011-0/+4
| | | | llvm-svn: 309665
* [sanitizer-coverage] dummy definitions for ↵Kostya Serebryany2017-08-012-0/+4
| | | | | | __sanitizer_cov_8bit_counters_init and __sanitizer_cov_pcs_init llvm-svn: 309655
* [msan] Reverting D36093Kostya Kortchinsky2017-07-312-15/+0
| | | | | | | | | | | | | | | | Summary: Reverting D36093 until I can figure out how to launch the correct tests :/ My apologies. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36120 llvm-svn: 309637
* Add powerpc64 to compiler-rt build infrastructure.Sterling Augustine2017-07-312-1/+15
| | | | | | | | | | | | | | Summary: Add powerpc64 to compiler-rt build infrastructure. Reviewers: timshen Reviewed By: timshen Subscribers: nemanjai, dberris, mgorny, aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D36108 llvm-svn: 309634
* Remove STL/microsoft-specific CFI blacklist entriesPeter Collingbourne2017-07-311-9/+0
| | | | | | | | Patch by Vlad Tsyrklevich! Differential Revision: https://reviews.llvm.org/D35855 llvm-svn: 309617
* [msan] Check for pvalloc overflowKostya Kortchinsky2017-07-312-1/+16
| | | | | | | | | | | | | | | | | | Summary: `CheckForPvallocOverflow` was introduced with D35818 to detect when pvalloc would wrap when rounding up to the next multiple of the page size. Add this check to MSan's pvalloc implementation. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D36093 llvm-svn: 309601
* [asan] Move shadow memory setup into its own fileVitaly Buka2017-07-314-125/+150
| | | | | | | | | | | | | | Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Subscribers: kubamracek, mgorny, phosek, filcab, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36037 llvm-svn: 309542
* [sanitizer_common] Add SANITIZER_FUCHSIAVitaly Buka2017-07-311-1/+7
| | | | | | | | | | | | | | | | | | Summary: More changes to follow will add the Fuchsia port. Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, phosek, filcab Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36027 llvm-svn: 309539
* [builtins] Fix mingw-w64 cross compilationMartin Storsjo2017-07-311-1/+1
| | | | | | | | | Lowercase the Windows.h include in enable_execute_stack.c, just as in emutls.c in SVN r302340. Differential Revision: https://reviews.llvm.org/D36066 llvm-svn: 309537
* [sanitizer_common] Rename SI_NOT_WINDOWS to SI_POSIXVitaly Buka2017-07-312-88/+91
| | | | | | | | | | | | | | | | | | | | | Summary: New systems might be neither Windows nor POSIX. The SI_NOT_WINDOWS macro in sanitizer_platform_interceptors.h was already effectively the same as SI_POSIX, so just use SI_POSIX instead. Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: vitalybuka Subscribers: phosek, filcab, llvm-commits, kubamracek Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36038 llvm-svn: 309536
* [XRay][compiler-rt] Do not print the warning when the binary is not XRay ↵Dean Michael Berris2017-07-311-1/+2
| | | | | | | | | | | | | | | | | instrumented. Summary: Currently when the XRay runtime is linked into a binary that doesn't have the instrumentation map, we print a warning unconditionally. This change attempts to make this behaviour more quiet. Reviewers: kpw, pelikan Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D35789 llvm-svn: 309534
* [ubsan] Diagnose invalid uses of builtins (compiler-rt)Vedant Kumar2017-07-294-0/+42
| | | | | | Differential Revision: https://reviews.llvm.org/D34591 llvm-svn: 309461
* [compiler-rt] Add missing quotation marks to msan_compile invocationKrzysztof Parzyszek2017-07-281-1/+1
| | | | llvm-svn: 309430
* Add clear_cache implementation for ppc64. Fix buffer to meet ppc64 alignment.Sterling Augustine2017-07-281-1/+15
| | | | llvm-svn: 309423
* [sanitizers test CMake] further refactor testing CMake for tsanGeorge Karpenkov2017-07-281-20/+19
| | | | | | | | | | | | TSan tests on Darwin first link all libraries into a static archive file. With this change, the linking is done once per all architecture, and previously the linking step was repeated per each architecture per each add_tsan_test call. Furthermore, the code is cleared up. Differential Revision: https://reviews.llvm.org/D35913 llvm-svn: 309406
* [sanitizer tests CMake] Factor out CMake logic for compiling sanitizer testsGeorge Karpenkov2017-07-284-73/+39
| | | | | | | | | | | Currently there's a large amount of CMake logic duplication for compiling sanitizer tests. If we add more sanitizers, the duplication will get even worse. This change factors out common compilation commands into a macro available to all sanitizers. llvm-svn: 309405
* Change INSTR_PROF_DEFAULT_NUM_VAL_PER_SITE from 8 to 16.Dehao Chen2017-07-281-1/+1
| | | | | | | | | | | | | | Summary: In the current implementation, the defaul number of values per site tracked by value profiler is 8, which is too small and could introduce inaccuracies to profile. Changing it to 16 will be able to gain more accurate value profiler. Reviewers: davidxl, tejohnson Reviewed By: tejohnson Subscribers: sanjoy, llvm-commits Differential Revision: https://reviews.llvm.org/D35964 llvm-svn: 309388
* Support libc++abi in addition to libstdc++Petr Hosek2017-07-283-3/+6
| | | | | | | | | | | This change adds sanitizer support for LLVM's libunwind and libc++abi as an alternative to libstdc++. This allows using the in tree version of libunwind and libc++abi which is useful when building a toolchain for different target. Differential Revision: https://reviews.llvm.org/D34501 llvm-svn: 309362
* Support compiler-rt builtinsPetr Hosek2017-07-286-6/+24
| | | | | | | | | This change adds support for compiler-rt builtins as an alternative compiler runtime to libgcc. Differential Revision: https://reviews.llvm.org/D35165 llvm-svn: 309361
* [sanitizers] Sanitizer tests CMake clean up: try #2George Karpenkov2017-07-283-60/+8
| | | | | | | | | | | | | | | | | This patch addresses two issues: Most of the time, hacks with `if/else` in order to get support for multi-configuration builds are superfluous. The variable `CMAKE_CFG_INTDIR` was created precisely for this purpose: it expands to `.` on all single-configuration builds, and to a configuration name otherwise. The `if/else` hacks for the library name generation should also not be done, as CMake has `TARGET_FILE` generator expression precisely for this purpose, as it expands to the exact filename of the resulting target. Differential Revision: https://reviews.llvm.org/D35952 llvm-svn: 309341
* [sancov] Implement __sanitizer_cov_reset.Evgeniy Stepanov2017-07-272-3/+13
| | | | | | | | | | | | Summary: Clears all collected coverage. Reviewers: kcc Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D35958 llvm-svn: 309333
* Revert "[sanitizers] Sanitizer tests CMake clean up"George Karpenkov2017-07-273-8/+60
| | | | | | | | This reverts commit 0ab44db2aa1cd3710355ad79b04f954ce68c0b3a. Fails on some bots, reverting until I can fix it. llvm-svn: 309318
OpenPOWER on IntegriCloud