summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [NFC][compiler-rt][builtins] Tidy and match comments for floating point ↵Leonard Chan2019-05-099-102/+94
| | | | | | | | operations Differential Revision: https://reviews.llvm.org/D61762 llvm-svn: 360389
* [libFuzzer] perform more agressive value profiling in memcmpKostya Serebryany2019-05-091-2/+7
| | | | llvm-svn: 360385
* [MSan] Introduce __msan_unpoison_param().Matt Morehouse2019-05-092-0/+4
| | | | | | | | | | | | | | | | | | | Summary: This allows libFuzzer to unpoison parameter shadow before calling LLVMFuzzerTestOneInput to eliminate the false positives described in https://github.com/google/oss-fuzz/issues/2369. Reviewers: eugenis Reviewed By: eugenis Subscribers: llvm-commits, metzman, kcc Tags: #llvm Differential Revision: https://reviews.llvm.org/D61751 llvm-svn: 360379
* [libFuzzer] implement -focus_function=auto, to be used with Data Flow TracesKostya Serebryany2019-05-095-8/+276
| | | | llvm-svn: 360378
* [scudo][standalone] Introduce the chunk headerKostya Kortchinsky2019-05-086-3/+249
| | | | | | | | | | | | | | | | | | | | | | Summary: ... and its related functions. The structure and its functionalities are identical to existing ones. The header stores information on a `scudo::Chunk` to be able to detect inconsitencies or potential corruption attempts. It is checksummed for that purpose. Reviewers: morehouse, eugenis, vitalybuka, hctim Reviewed By: vitalybuka Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D61654 llvm-svn: 360290
* [libFuzzer] DFT: when dumping coverage, also dump the total number of ↵Kostya Serebryany2019-05-083-22/+44
| | | | | | instrumented blocks in a function; update merge_data_flow.py to merge coverage llvm-svn: 360272
* [libFuzzer] extend the data flow tracer to also produce basic block coverage ↵Kostya Serebryany2019-05-082-16/+72
| | | | | | for every input. An extended test coming in a separte change. llvm-svn: 360213
* Fix build on NetBSD 8.99.38Kamil Rytarowski2019-05-081-0/+2
| | | | | | | | With recent changes the dev/nvmm/nvmm_ioctl.h header is no longer a standalone NVMM header. Disable it until the NVMM operations will stabilize and be included in the ioctl(2) interceptors. llvm-svn: 360212
* [scudo][standalone] Introduce the QuarantineKostya Kortchinsky2019-05-075-0/+534
| | | | | | | | | | | | | | | | | | | | | Summary: The Quarantine is used to hold chunks for a little while prior to actually releasing them for potential reuse. The code is pretty much the same as the sanitizer_common one, with additional shuffling of the quarantine batches to decrease predictability of allocation patterns when it is enabled. Reviewers: vitalybuka, eugenis, hctim, morehouse Reviewed By: morehouse Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D61385 llvm-svn: 360163
* [hwasan] Fix HWASAN_WITH_INTERCEPTORS=OFF build on not-android.Evgeniy Stepanov2019-05-031-1/+11
| | | | | | | | | | | | | | | | | Summary: I'm not aware of any platforms where this will work, but the code should at least compile. HWASAN_WITH_INTERCEPTORS=OFF means there is magic in libc that would call __hwasan_thread_enter / __hwasan_thread_exit as appropriate. Reviewers: pcc, winksaville Subscribers: srhines, kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61337 llvm-svn: 359914
* Avoid duplicate function aliases on MinGW after SVN r359835Martin Storsjo2019-05-032-4/+6
| | | | | | | On MinGW, the same alias mechanism as for ELF, using __attribute__((__alias__())), is used. llvm-svn: 359865
* [crtbegin] Fix an off-by-1 bug in __do_finiFangrui Song2019-05-031-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D61367 llvm-svn: 359850
* Fix check-builtins on Windows after alias changesReid Kleckner2019-05-022-0/+16
| | | | llvm-svn: 359835
* [compiler-rt] Set the ZX_VMO_RESIZABLE option for zx_vmo_createPetr Hosek2019-05-024-4/+4
| | | | | | | | | | | | | Currently VMO in Zircon create using the zx_vmo_create is resizable by default, but we'll be changing this in the future, requiring an explicit flag to make the VMO resizable. Prepare for this change by passing ZX_VMO_RESIZABLE option to all zx_vmo_create calls that need resizable VMO. Differential Revision: https://reviews.llvm.org/D61450 llvm-svn: 359803
* Fix for WindowsStephan Bergmann2019-05-021-2/+1
| | | | | | | ...after 5745eccef54ddd3caca278d1d292a88b2281528b "Adapt -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFO" llvm-svn: 359760
* Adapt -fsanitize=function to SANITIZER_NON_UNIQUE_TYPEINFOStephan Bergmann2019-05-027-48/+79
| | | | | | | | | | | | | | | | | | | | | | | | This follows up after b7692bc3e9ad2691fc07261904b88fb15f30696b "[UBSan] Fix isDerivedFromAtOffset on iOS ARM64" fixed the RTTI comparison in isDerivedFromAtOffset on just one platform and then a25a2c7c9a7e1e328a5bd8274d2d86b1fadc4692 "Always compare C++ typeinfo (based on libstdc++ implementation)" extended that fix to more platforms. But there is another RTTI comparison for -fsanitize=function generated in clang's CodeGenFunction::EmitCall as just a pointer comparison. For SANITIZER_NON_UNIQUE_TYPEINFO platforms this needs to be extended to also do string comparison. For that, __ubsan_handle_function_type_mismatch[_abort] takes the two std::type_info pointers as additional parameters now, checks them internally for potential equivalence, and returns without reporting failure if they turn out to be equivalent after all. (NORETURN needed to be dropped from the _abort variant for that.) Also these functions depend on ABI-specific RTTI now, so needed to be moved from plain UBSAN_SOURCES (ubsan_handlers.h/cc) to UBSAN_CXXABI_SOURCES (ubsan_handlers_cxx.h/cc), but as -fsanitize=function is only supported in C++ mode that's not a problem. Differential Revision: https://reviews.llvm.org/D60760 llvm-svn: 359759
* [compiler-rt][tests] Propagate COMPILER_RT_UNITTEST_LINK_FLAGSHubert Tong2019-05-016-4/+13
| | | | | | | | | | | | | | | | | | | | `COMPILER_RT_UNITTEST_LINK_FLAGS` is dropped in many places, unlike `COMPILER_RT_UNITTEST_CFLAGS`. This patch attempts to remove that inconsistency. Previously reviewed as part of D58951. Reviewers: sfertile, peter.smith, pzheng, phosek, Hahnfeld, nemanjai, jasonliu Reviewed By: sfertile Subscribers: jsji, kubamracek, dberris, mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60143 llvm-svn: 359733
* [sanitizer][NFC] Remove unneeded SizeClassAllocatorLocalCacheVitaly Buka2019-05-013-29/+17
| | | | llvm-svn: 359729
* [sanitizer][NFC] Add const/static into a couple of methodsVitaly Buka2019-05-012-4/+4
| | | | llvm-svn: 359728
* [Sanitizer] Reland "Cleanup INTERCEPT_FUNCTION macro"Julian Lettner2019-05-016-40/+45
| | | | | | | | | | | | | | | | | | | | | | On Linux both version of the INTERCEPT_FUNCTION macro now return true when interception was successful. Adapt and cleanup some usages. Also note that `&(func) == &WRAP(func)` is a link-time property, but we do a runtime check. Tested on Linux and macOS. Previous attempt reverted by: 5642c3feb03d020dc06a62e3dc54f3206a97a391 This attempt to bring order to the interceptor macro goes the other direction and aligns the Linux implementation with the way things are done on Windows. Reviewed By: vitalybuka, rnk Differential Revision: https://reviews.llvm.org/D61358 llvm-svn: 359725
* [sanitizer][NFC] Set LargeMmapAllocator type from PrimaryAllocatorVitaly Buka2019-05-019-45/+21
| | | | | | | | | | | | | | They need to have same AddressSpaceView and MapUnmapCallback. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61168 llvm-svn: 359719
* [scudo][NFC] Remove unneeded template from scudo::CombinedAllocatorVitaly Buka2019-05-012-4/+7
| | | | | | | | | | | | | | Reviewers: cryptoad, eugenis Reviewed By: cryptoad Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61162 llvm-svn: 359718
* [sanitizer][NFC] Get type of AllocatorCache from CombinedAllocatorVitaly Buka2019-05-0111-56/+28
| | | | | | | | | | | | | | Reviewers: eugenis, cryptoad, kcc Reviewed By: kcc Subscribers: kcc, kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61155 llvm-svn: 359715
* [sanitizer] Implement reallocarray.Evgeniy Stepanov2019-05-0125-1/+170
| | | | | | | | | | | | | | | | Summary: It's a cross of calloc and realloc. Sanitizers implement calloc-like check for size overflow. Reviewers: vitalybuka, kcc Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61108 llvm-svn: 359708
* [compiler-rt] Use correct spelling of the -Wno-pedantic variablePetr Hosek2019-05-011-1/+1
| | | | | | | This addresses the issue introduced in r359646 which is causing sanitizer bots to fail. llvm-svn: 359659
* Use __extension__ to suppress __EH_FRAME_LIST__ warningsFangrui Song2019-05-011-1/+1
| | | | | | | gcc -pedantic => warning: ISO C forbids empty initializer braces clang -pedantic => -Wzero-length-array + -Wgnu-empty-initializer llvm-svn: 359655
* [compiler-rt] Pass sysroot and disable pedantic for crtbegin.o/crtend.oPetr Hosek2019-05-011-0/+1
| | | | | | | | These are needed to make bots happy. Differential Revision: https://reviews.llvm.org/D61363 llvm-svn: 359646
* Added test.Mitch Phillips2019-04-301-0/+16
| | | | llvm-svn: 359632
* [sanitizer_common] Added 64-bit signed flag parser.Mitch Phillips2019-04-301-0/+9
| | | | | | | | | | | | | | Summary: Adds a 64-bit signed flag parser for GWP-ASan's use. Reviewers: vlad.tsyrklevich, eugenis Subscribers: kubamracek, #sanitizers, llvm-commits, vitalybuka, morehouse, pcc, kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61342 llvm-svn: 359631
* Revert r359325 "[NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION ↵Reid Kleckner2019-04-306-20/+48
| | | | | | | | | | | | | | | to void" Changing INTERCEPT_FUNCTION to return void is not functionally correct. IMO the best way to communicate failure or success of interception is with a return value, not some external address comparison. This change was also creating link errors for _except_handler4_common, which is exported from ucrtbase.dll in 32-bit Windows. Also revert dependent changes r359362 and r359466. llvm-svn: 359611
* [libFuzzer] Replace -seed_corpus to better support fork mode on WinJonathan Metzman2019-04-305-10/+32
| | | | | | | | | | | | | | | | | | Summary: Pass seed corpus list in a file to get around argument length limits on Windows. This limit was preventing many uses of fork mode on Windows. Reviewers: kcc, morehouse Reviewed By: kcc Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60980 llvm-svn: 359610
* Reland "[compiler-rt] Simple crtbegin.o and crtend.o implementation"Petr Hosek2019-04-304-0/+213
| | | | | | | | | | | | | | | Clang relies on existence of certain symbols that are normally provided by crtbegin.o/crtend.o. However, LLVM does not currently provide implementation of these files, instead relying on either libgcc or implementations provided as part of the system. This change provides an initial implementation of crtbegin.o/crtend.o that can be used on system that don't provide crtbegin.o/crtend.o as part of their C library. Differential Revision: https://reviews.llvm.org/D28791 llvm-svn: 359591
* change orderJonathan Metzman2019-04-301-1/+1
| | | | llvm-svn: 359587
* [libFuzzer] Enable for i386Jonathan Metzman2019-04-301-2/+2
| | | | | | | | | | | | Summary: Get libFuzzer to build on i386 and fix tests. Subscribers: mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61070 llvm-svn: 359585
* Enable x86 buildsJonathan Metzman2019-04-301-2/+7
| | | | llvm-svn: 359583
* Revert "[compiler-rt] Simple crtbegin.o and crtend.o implementation"Petr Hosek2019-04-304-213/+0
| | | | | | This reverts commit r359576 since it's failing on Windows bots. llvm-svn: 359579
* [compiler-rt] Simple crtbegin.o and crtend.o implementationPetr Hosek2019-04-304-0/+213
| | | | | | | | | | | | | | | Clang relies on existence of certain symbols that are normally provided by crtbegin.o/crtend.o. However, LLVM does not currently provide implementation of these files, instead relying on either libgcc or implementations provided as part of the system. This change provides an initial implementation of crtbegin.o/crtend.o that can be used on system that don't provide crtbegin.o/crtend.o as part of their C library. Differential Revision: https://reviews.llvm.org/D28791 llvm-svn: 359576
* [scudo][standalone] Add the memory reclaiming mechanismKostya Kortchinsky2019-04-306-3/+527
| | | | | | | | | | | | | | | | | | | | | | Summary: This CL implements the memory reclaiming function `releaseFreeMemoryToOS` and its associated classes. Most of this code was originally written by Aleksey for the Primary64 in sanitizer_common, and I made some changes to be able to implement 32-bit reclaiming as well. The code has be restructured a bit to accomodate for freelist of batches instead of the freearray used in the current sanitizer_common code. Reviewers: eugenis, vitalybuka, morehouse, hctim Reviewed By: vitalybuka Subscribers: srhines, mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D61214 llvm-svn: 359567
* Fix FIXME added in r359339Reid Kleckner2019-04-292-15/+12
| | | | | | | | | We have windows.h in asan_win.cc, so we can just use the correct prototypes for these EH-related interceptors without worrying. Also fix an unused variable warning while I'm here. llvm-svn: 359500
* Pacify sanitizer lint script after r359498Reid Kleckner2019-04-291-1/+0
| | | | llvm-svn: 359499
* [AddressSanitizer] [Windows] Fix HeapReAlloc and _recalloc bugs in ↵Matthew G McGovern2019-04-291-14/+43
| | | | | | | | | | | asan_malloc_win.cc HeapReAlloc should allow for 0 sized reallocations without freeing the memory block provided by the user. _recalloc previously did not zero new memory after reallocation. https://reviews.llvm.org/D61268 llvm-svn: 359498
* [Sanitizer] Cleanup {ASAN, MSAN}_INTERCEPT_FUNC[_VER] macroJulian Lettner2019-04-292-7/+4
| | | | | | | | | | | | Note that this change is not strictly NFC since we add the `(&(name) != &WRAP(name)` part to the conditional for the `_VER` variant of the macro. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D61204 llvm-svn: 359466
* [builtins] Use __APPLE__ instead of __MACH__ in checkPetr Hosek2019-04-291-1/+1
| | | | | | | The latter doesn't seem to be working for all targets. This addresses the issue introduced in r359413. llvm-svn: 359423
* [builtins] Fix the missing assembly on DarwinPetr Hosek2019-04-291-1/+1
| | | | | | This was introduced in r359413. llvm-svn: 359421
* [builtins] Fix the typo in the preprocessor checkPetr Hosek2019-04-291-1/+1
| | | | | | This was introduced in r359413. llvm-svn: 359419
* [builtins] Use aliases for function redirectsPetr Hosek2019-04-2941-95/+85
| | | | | | | | | | | | | Symbol aliases are supported by all platforms that compiler-rt builtins target, and we can use these instead of function redirects to avoid the extra indirection. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60931 llvm-svn: 359413
* [builtins] Use single line C++/C99 comment stylePetr Hosek2019-04-28240-3869/+3489
| | | | | | | | | | | Use the uniform single line C++/99 style for code comments. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60352 llvm-svn: 359411
* [builtins] Reformat builtins with clang-formatPetr Hosek2019-04-28193-5873/+5341
| | | | | | | | | | | Update formatting to use the LLVM style. This is part of the cleanup proposed in "[RFC] compiler-rt builtins cleanup and refactoring". Differential Revision: https://reviews.llvm.org/D60351 llvm-svn: 359410
* [sanitizer] Calculate SizeClassAllocator32::ByteMap type from ↵Vitaly Buka2019-04-278-102/+17
| | | | | | | | | | | | | | Params::kSpaceSize and Params::kRegionSizeLog Reviewers: eugenis Subscribers: kubamracek, cryptoad, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61206 llvm-svn: 359374
* [sanitizer] NFC: add static_assert to confirm that we use reasonable ByteMap ↵Vitaly Buka2019-04-271-3/+21
| | | | | | | | | | | | | | | | | | | type Summary: If bots work we can replace #ifs with template specialization by TwoLevelByteMapSize1. There is known users of TwoLevelByteMap with TwoLevelByteMapSize1 equal 8, and users of FlatByteMap with TwoLevelByteMapSize1 equal 2. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61200 llvm-svn: 359364
OpenPOWER on IntegriCloud