summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert r362676 "[Profile]: Add runtime interface to specify file handle for ↵Hans Wennborg2019-06-124-94/+13
| | | | | | | | | | | | | | | profile data." This caused instrumented Clang to become crashy. See llvm-commits thread for repro steps. This also reverts follow-up r362716 which added test cases. > Author: Sajjad Mirza > > Differential Revision: http://reviews.llvm.org/D62541 llvm-svn: 363134
* [Sanitizers] Add case MACOS_VERSION_CATALINAJulian Lettner2019-06-112-2/+3
| | | | | | | | Reviewed By: delcypher Differential Revision: https://reviews.llvm.org/D63096 llvm-svn: 363104
* [scudo][standalone] Unmap memory in testsKostya Kortchinsky2019-06-118-16/+74
| | | | | | | | | | | | | | | | | | | | | Summary: The more tests are added, the more we are limited by the size of the address space on 32-bit. Implement `unmapTestOnly` all around (like it is in sanitzer_common) to be able to free up some memory. This is not intended to be a proper "destructor" for an allocator, but allows us to not fail due to having no memory left. Reviewers: morehouse, vitalybuka, eugenis, hctim Reviewed By: morehouse Subscribers: delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D63146 llvm-svn: 363095
* Add FuzzedDataProvider helper class / single header library.Max Moroz2019-06-113-2/+543
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This class is useful for writing fuzz target that have multiple inputs. Current CL imports the existing `FuzzedDataProvider` from Chromium without any modifications. Feel free to review it thoroughly, if you're interested, but I'd prefer changing the class in a follow up CL. The CL also introduces an exhaustive test for the library, as the behavior of `FuzzedDataProvider` must not change over time. In follow up CLs I'm planning on changing some implementation details (I can share a doc with some comments to be addressed). After that, we will document how `FuzzedDataProvider` should be used. I have tested this on Linux, Windows and Mac platforms. Reviewers: morehouse, metzman, kcc Reviewed By: morehouse Subscribers: metzman, thakis, rnk, mgorny, ormris, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62733 llvm-svn: 363071
* Add unused symbol to thunk files to force wholearchive inclusionReid Kleckner2019-06-102-0/+12
| | | | | | | | | | | | | | These "dynamic_runtime_thunk" object files exist to create a weak alias from 'foo' to 'foo_dll' for all weak sanitizer runtime symbols. The weak aliases are implemented as /alternatename linker options in the .drective section, so they are not actually in the symbol table. In order to force the Visual C++ linker to load the object, even with -wholearchive:, we have to provide at least one external symbol. Once we do that, it will read the .drective sections and see the weak aliases. Fixes PR42074 llvm-svn: 362970
* [scudo][standalone] Introduce the thread specific data structuresKostya Kortchinsky2019-06-1010-11/+512
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This CL adds the structures dealing with thread specific data for the allocator. This includes the thread specific data structure itself and two registries for said structures: an exclusive one, where each thread will have its own TSD struct, and a shared one, where a pool of TSD structs will be shared by all threads, with dynamic reassignment at runtime based on contention. This departs from the current Scudo implementation: we intend to make the Registry a template parameter of the allocator (as opposed to a single global entity), allowing various allocators to coexist with different TSD registry models. As a result, TSD registry and Allocator are tightly coupled. This also corrects a couple of things in other files that I noticed while adding this. Reviewers: eugenis, vitalybuka, morehouse, hctim Reviewed By: morehouse Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62258 llvm-svn: 362962
* Experimantal dfsan mode "fast16labels=1"Kostya Serebryany2019-06-082-0/+6
| | | | | | | | | | | | | | | | | | Summary: dfsan mode "fast16labels=1". In this mode the labels are treated as 16-bit bit masks. Reviewers: pcc Reviewed By: pcc Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62870 llvm-svn: 362859
* Change GWP-ASan build to use '-pthread' instead of '-lpthread' in orderMitch Phillips2019-06-061-1/+1
| | | | | | | | to try and fix android buildbot. Also make sure that the empty dummy test contains an output file name so the android_build.py wrapper script doesn't check fail. llvm-svn: 362758
* Fixup files added in r362636 to build with gcc 5.4. NFCIDouglas Yung2019-06-062-13/+13
| | | | llvm-svn: 362682
* [Profile]: Add runtime interface to specify file handle for profile data.Xinliang David Li2019-06-064-13/+94
| | | | | | | | Author: Sajjad Mirza Differential Revision: http://reviews.llvm.org/D62541 llvm-svn: 362676
* [GWP-ASan] Core Guarded Pool Allocator [4].Mitch Phillips2019-06-0511-3/+1111
| | | | | | | | | | | | | | | | | | | | | Summary: See D60593 for further information. This patch introduces the core of GWP-ASan, being the guarded pool allocator. This class contains the logic for creating and maintaining allocations in the guarded pool. Its public interface is to be utilised by supporting allocators in order to provide sampled guarded allocation behaviour. This patch also contains basic functionality tests of the allocator as unittests. The error-catching behaviour will be tested in upcoming patches that use Scudo as an implementing allocator. Reviewers: vlad.tsyrklevich, eugenis, jfb Reviewed By: vlad.tsyrklevich Subscribers: dexonsmith, kubamracek, mgorny, cryptoad, jfb, #sanitizers, llvm-commits, morehouse Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D62872 llvm-svn: 362636
* Changed force build of GWP-ASan options parser to be staticallyMitch Phillips2019-06-051-1/+1
| | | | | | | linked instead of dynamic. This should help resolve a downstream build order issue against libc++. llvm-svn: 362566
* [GWP-ASan] Configuration options [3].Mitch Phillips2019-06-045-0/+253
| | | | | | | | | | | | | | | | | | | | | Summary: See D60593 for further information. This patch introduces the configuration options for GWP-ASan. In general, we expect the supporting allocator to populate the options struct, and give that to GWP-ASan during initialisation. For allocators that are okay with pulling in sanitizer_common, we also provide an optional parser that populates the gwp_asan::Options struct with values provided in the GWP_ASAN_OPTIONS environment variable. This patch contains very little logic, and all of the testable components (i.e. the optional parser's internal logic) is tested as part of the sanitizer_common testbed. Reviewers: vlad.tsyrklevich, morehouse, jfb Reviewed By: morehouse Subscribers: dexonsmith, kubamracek, mgorny, #sanitizers, llvm-commits, vitalybuka Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D62698 llvm-svn: 362527
* [HWASAN] Make new/delete weakEugene Leviant2019-06-041-8/+8
| | | | | | | | | This allows instrumenting programs which have their own versions of new and delete operators. Differential revision: https://reviews.llvm.org/D62794 llvm-svn: 362478
* [builtins] Use libtool for builtins when building for Apple platformPetr Hosek2019-06-041-0/+3
| | | | | | | | | | | | compiler-rt already uses libtool instead of ar when building for Apple platform, but that's not being used when builtins are being built separately e.g. as part of the runtimes build. This change extracts the logic setting up libtool into a separate file and uses it from both the compiler-rt and standalone builtins build. Differential Revision: https://reviews.llvm.org/D62820 llvm-svn: 362466
* builtins: correct function name for AEABISaleem Abdulrasool2019-06-031-2/+2
| | | | | | | | | | If `COMPILER_RT_ARMHF_TARGET` is set , the definition of the AEABI runtime function `__aeabi_fcmpun` is misspelt: `__aeabi_fcmpum` instead of `__aeabi_fcmpun`. Patch by Konstantin Schwarz! llvm-svn: 362424
* Attempt to fix test failure for armv8.Mitch Phillips2019-05-301-2/+2
| | | | | | | | Looks like armv8 can't handle a thousand threads, which GWP-ASan requests when running a synchronised mutex test. Limiting this to 100 to attempt to fix the build issue. llvm-svn: 362163
* Attempt to fix 'mutex.h' not found when building mutex_posix.Mitch Phillips2019-05-301-1/+1
| | | | llvm-svn: 362149
* [GWP-ASan] Mutex implementation [2].Mitch Phillips2019-05-306-1/+239
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: See D60593 for further information. This patch pulls out the mutex implementation and the required definitions file. We implement our own mutex for GWP-ASan currently, because: 1. We must be compatible with the sum of the most restrictive elements of the supporting allocator's build system. Current targets for GWP-ASan include Scudo (on Linux and Fuchsia), and bionic (on Android). 2. Scudo specifies `-nostdlib++ -nonodefaultlibs`, meaning we can't use `std::mutex` or `mtx_t`. 3. We can't use `sanitizer_common`'s mutex, as the supporting allocators cannot afford the extra maintenance (Android, Fuchsia) and code size (Fuchsia) overheads that this would incur. In future, we would like to implement a shared base mutex for GWP-ASan, Scudo and sanitizer_common. This will likely happen when both GWP-ASan and Scudo standalone are not in the development phase, at which point they will have stable requirements. Reviewers: vlad.tsyrklevich, morehouse, jfb Reviewed By: morehouse Subscribers: dexonsmith, srhines, cfe-commits, kubamracek, mgorny, cryptoad, jfb, #sanitizers, llvm-commits, vitalybuka, eugenis Tags: #sanitizers, #llvm, #clang Differential Revision: https://reviews.llvm.org/D61923 llvm-svn: 362138
* [HWASAN] Remove unused codeEugene Leviant2019-05-292-28/+0
| | | | | | Differential revision: https://reviews.llvm.org/D62489 llvm-svn: 361942
* [builtins] Move the compare2f definition outside of the macroPetr Hosek2019-05-291-11/+19
| | | | | | | | | This should hopefully address the error we're seeing in older versions of Clang. Differential Revision: https://reviews.llvm.org/D62554 llvm-svn: 361909
* [libFuzzer] when using data-flow-trace (DFT) only load the DFT for the files ↵Kostya Serebryany2019-05-243-10/+17
| | | | | | present in the corpus llvm-svn: 361579
* [libFuzzer] remove the data-flow-trace (DFT) python scripts; their ↵Kostya Serebryany2019-05-233-143/+8
| | | | | | functionality is now part of libFuzzer proper; also write functions.txt to the disk only if this file doesn't exist yet llvm-svn: 361452
* [libFuzzer] automatically collect the data flow trace (DFT) in the fork mode ↵Kostya Serebryany2019-05-235-3/+41
| | | | | | if -collect_data_flow= is given llvm-svn: 361448
* [asan] Fix debug asan build link errorReid Kleckner2019-05-222-26/+29
| | | | | | | | | | | | Reviewers: dmajor, vitalybuka, waltl Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61871 llvm-svn: 361427
* [X86] Add more icelake model numbers to compiler-rt implementation of ↵Craig Topper2019-05-221-0/+8
| | | | | | | | | __builtin_cpu_is. Using model numbers found in Table 2-1 of the May 2019 version of the Intel Software Developer's Manual Volume 4. llvm-svn: 361423
* [libFuzzer] Ignore synthetic exceptions on FuchsiaPetr Hosek2019-05-221-42/+58
| | | | | | | | | | | | | Fuchsia has several exceptions which are merely informational and should not be treated as crashes. This patch puts logic that read from the exception port and handled the exception in a loop, and ignores non-exceptions and informational exceptions. Patch By: aarongreen Differential Revision: https://reviews.llvm.org/D62226 llvm-svn: 361407
* [Sanitizer] Add interceptor for wcsdupPavel Labath2019-05-222-0/+19
| | | | | | | | | | | | | | Summary: The wide-string equivalent of strdup. Implementation trivial. Reviewers: vitalybuka, eugenis Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D62189 llvm-svn: 361357
* [asan] clang-format parent patchVitaly Buka2019-05-211-3/+3
| | | | llvm-svn: 361305
* [asan] Replace assignments with internal_memcpy ErrorDescriptionVitaly Buka2019-05-212-3/+5
| | | | | | For consistency with nearby code and to avoid interceptors during reports. llvm-svn: 361304
* [builtins] Deduplicate __eqsf2 and __gtsf2 via macroPetr Hosek2019-05-201-77/+30
| | | | | | | | | | | The only difference between __eqsf2 and __gtsf2 is whether they return 1 or -1 on NaN. Rather than duplicating all the code, use a macro to define the function twice and use an argument to decide whether to negate the return value. Differential Revision: https://reviews.llvm.org/D61919 llvm-svn: 361207
* This change adds an API to allow setting the flag to indicate that the ↵Max Moroz2019-05-202-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | profile data has been dumped to the file. Summary: The main use is for users to disable dumping profile data to the file for certain processes in case the processes don't have permission to write to the disks, and trying to do so would result in side effects such as crashes. Patch by Yuke Liao (@liaoyuke). Additional context (Chromium use case): - https://bugs.chromium.org/p/chromium/issues/detail?id=842424 - https://bugs.chromium.org/p/chromium/issues/detail?id=957655 - https://chromium-review.googlesource.com/c/chromium/src/+/1610093 Reviewers: Dor1s, vsk, davidxl Reviewed By: Dor1s, davidxl Subscribers: delcypher, davidxl, sajjadm, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D62078 llvm-svn: 361194
* [X86] Add icelake-client and tremont model numbers to compiler-rt's ↵Craig Topper2019-05-201-0/+9
| | | | | | implementation of __builtin_cpu_is. llvm-svn: 361175
* [scudo][standalone] Introduce the Primary(s) and LocalCacheKostya Kortchinsky2019-05-207-9/+1128
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This CL introduces the 32 & 64-bit primary allocators, and associated Local Cache. While the general idea is mostly similar to what exists in sanitizer_common, it departs from the original code somewhat significantly: - the 64-bit primary no longer uses a free array at the end of a region but uses batches of free blocks in region 0, allowing for a convergence with the 32-bit primary behavior; - as a result, there is only one (templated) local cache type for both primary allocators, and memory reclaiming can be implemented similarly for the 32-bit & 64-bit platforms; - 64-bit primary regions are handled a bit differently: we do not reserve 4TB of memory that we split, but reserve `NumClasses * 2^RegionSizeLog`, each region being offseted by a random number of pages from its computed base. A side effect of this is that the 64-bit primary works on 32-bit platform (I don't think we want to encourage it but it's an interesting side effect); Reviewers: vitalybuka, eugenis, morehouse, hctim Reviewed By: morehouse Subscribers: srhines, mgorny, delcypher, jfb, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D61745 llvm-svn: 361159
* Use CMAKE_C_COMPILER_ARG1 in compiler invocationPetr Hosek2019-05-191-2/+2
| | | | | | | | | This is needed when using compiler wrappers such as ccache or distcc and should address the failure on clang-x86_64-debian-fast bot. Differential Revision: https://reviews.llvm.org/D62104 llvm-svn: 361111
* [sanitizer] Update symbolizer/scripts/global_symbols.txtVitaly Buka2019-05-171-0/+1
| | | | llvm-svn: 361077
* Explicitly remove -stdlib=libc++, as we pass -nostdinc++ anyway. This should ↵Mitch Phillips2019-05-171-0/+3
| | | | | | fix the android builtbots, and is a direct copy from what Scudo does. llvm-svn: 361073
* [GWP-ASan] Fixed issue with c++ standard library dependency.Mitch Phillips2019-05-173-6/+6
| | | | | | | | | | | | | | | | | | | Summary: Removed dependency on c++ standard library. Some supporting allocators (namely Scudo on Fuchsia, and shortly, scudo standalone) has a hard requirement of no c++stdlib. This patch updates the build system so that we don't have any c++ stdlib dependencies. It also will conveniently fix a racy build-order bug discrepency between GWP-ASan and libc++. Reviewers: phosek, morehouse Reviewed By: phosek, morehouse Subscribers: kubamracek, mgorny, cryptoad, #sanitizers, llvm-commits, beanz, smeenai, vitalybuka Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D62048 llvm-svn: 360982
* [sanitizer] Don't generate "failed to intercept" constants for each functionVitaly Buka2019-05-162-18/+18
| | | | llvm-svn: 360958
* [libFuzzer] replace string_view with string to fix the bots. This is NFC, ↵Kostya Serebryany2019-05-141-6/+7
| | | | | | just slower. llvm-svn: 360717
* [libFuzzer] #include <string_view>, hopefully should fix the windows build Kostya Serebryany2019-05-141-0/+1
| | | | llvm-svn: 360715
* [libFuzzer] reimplement DFT's collect_data_flow inside libFuzzer so that we ↵Kostya Serebryany2019-05-142-35/+146
| | | | | | don't need external python scripts llvm-svn: 360712
* [GWP-ASan] Initial build files, implementation of PRNG [1].Mitch Phillips2019-05-143-0/+77
| | | | | | | | | | | | | | | | | | Summary: See D60593 for further information. This patch slices off the PRNG implementation and the initial build files for GWP-ASan. Reviewers: vlad.tsyrklevich, morehouse, vitalybuka Reviewed By: morehouse Subscribers: srhines, kubamracek, mgorny, #sanitizers, llvm-commits, cryptoad, eugenis Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61867 llvm-svn: 360710
* [compiler-rt] Fix crtbegin.c compilationShoaib Meenai2019-05-111-4/+4
| | | | | | | We're building with -std=c11 now (as opposed to -std=gnu11), so we can't use GNU extensions and need to spell inline assembly as __asm__. llvm-svn: 360503
* [crt] Use -std=c11 for crtbegin.o/crtend.oPetr Hosek2019-05-101-0/+1
| | | | | | | | | The source uses C11 syntax such as comments and some compilers print warnings without specifying this flag. Differential Revision: https://reviews.llvm.org/D61797 llvm-svn: 360459
* Fix some gcc warnings in compiler-rtNico Weber2019-05-103-5/+5
| | | | | | | | - Several "warning: extra ';' [-Wpedantic]" - One "C++ style comments are not allowed in ISO C90 [enabled by default]" in a file that uses C style comments everywhere but in one place llvm-svn: 360430
* [libFuzzer] code refactoring; NFCKostya Serebryany2019-05-105-45/+45
| | | | llvm-svn: 360400
* [libFuzzer] small refactoring in the driver; dummy implementation of ↵Kostya Serebryany2019-05-104-21/+44
| | | | | | collect_data_flow; attempt to fix the windows bot llvm-svn: 360399
* [compiler-rt] Migrate to _zx_clock_get_new/_zx_clock_get_monotonicPetr Hosek2019-05-091-2/+7
| | | | | | | | This is part of the soft-transition to the new _zx_clock_get signature. Differential Revision: https://reviews.llvm.org/D61768 llvm-svn: 360394
* [libFuzzer] Unpoison parameters before calling user callback.Matt Morehouse2019-05-092-1/+4
| | | | | | | | | | | | | | | | | | | | Summary: Fixes an MSan false positive when compiling with -fsanitize=memory,fuzzer. See https://github.com/google/oss-fuzz/issues/2369 for more details. Reviewers: kcc Reviewed By: kcc Subscribers: llvm-commits, metzman, eugenis Tags: #llvm Differential Revision: https://reviews.llvm.org/D61753 llvm-svn: 360390
OpenPOWER on IntegriCloud