summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* [XRay] Fix error message. NFCFangrui Song2018-06-191-2/+2
| | | | | | | | | | Reviewers: dberris Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48313 llvm-svn: 335055
* [scudo] Move noinline functions definitions out of lineKostya Kortchinsky2018-06-191-63/+67
| | | | | | | | | | | | | | | | Summary: Mark `isRssLimitExceeded` as `NOINLINE`, and move it's definition as well as the one of `performSanityChecks` out of the class definition, as requested. Reviewers: filcab, alekseyshl Reviewed By: alekseyshl Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48228 llvm-svn: 335054
* [XRay] rm GLOB || true -> rm -fFangrui Song2018-06-1912-21/+21
| | | | | | | | | | | | Summary: `rm -f` does not write diagnostic message when there is no file argument. Reviewers: dberris Subscribers: delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48311 llvm-svn: 335025
* Fix bots after r334981Francis Visoiu Mistrih2018-06-191-19/+19
| | | | llvm-svn: 335013
* [asan] Avoid deadlock when initializing the symbolizer CHECK failsReid Kleckner2018-06-191-2/+8
| | | | llvm-svn: 335007
* Fixing os_version_check.c to be actual C sourceChris Bieneman2018-06-181-27/+50
| | | | | | | | | The initial implementaiton was using the C++ typeof keyword. This causes the compiler to spew warnings unnecissarilly. This patch removes the uses of typeof and replaces them with explicit typedefs of the function types. llvm-svn: 334981
* [TSan] Report proper error on allocator failures instead of CHECK(0)-ingAlex Shlyapnikov2018-06-1811-212/+126
| | | | | | | | | | | | | | | | | | | | | | Summary: Following up on and complementing D44404 and other sanitizer allocators. Currently many allocator specific errors (OOM, for example) are reported as a text message and CHECK(0) termination, no stack, no details, not too helpful nor informative. To improve the situation, detailed and structured common errors were defined and reported under the appropriate conditions. Common tests were generalized a bit to cover a slightly different TSan stack reporting format, extended to verify errno value and returned pointer value check is now explicit to facilitate debugging. Reviewers: dvyukov Subscribers: srhines, kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48087 llvm-svn: 334975
* [sanitizer] Guard call to internal_lseek when SANITIZER_MAC is trueFrancis Visoiu Mistrih2018-06-181-1/+1
| | | | | | | | | | r334881 breaks macOS bots because internal_lseek is not defined (neither used on macOS): http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/46240/consoleFull. See discussion from r334881: https://reviews.llvm.org/rL334881 llvm-svn: 334944
* Update copyright year to 2018.Paul Robinson2018-06-181-1/+1
| | | | llvm-svn: 334936
* [Fuzzer] Set an explicit libc++ dependency when neededPetr Hosek2018-06-181-2/+6
| | | | | | | | | | | | | On targets that don't link internal libc++ (Fuchsia and Linux) but use libc++ as their C++ library and libFuzzer is being built using the just built compiler together with libc++ as part of runtimes, we need an explicit dependency from libFuzzer object library to libc++ to make sure the headers are available by the time we start building libFuzzer. Differential Revision: https://reviews.llvm.org/D48261 llvm-svn: 334928
* [sanitizer] Suppress unused function warningVitaly Buka2018-06-181-1/+2
| | | | llvm-svn: 334923
* [sanitizer] Fix tsan GO buildVitaly Buka2018-06-171-20/+20
| | | | llvm-svn: 334914
* [sanitizer] Fix s390 build after r334900Vitaly Buka2018-06-171-1/+1
| | | | llvm-svn: 334913
* [sanitizer] Use confstr to check libc version in InitTlsSizeVitaly Buka2018-06-172-39/+66
| | | | | | | | | | Reviewers: Lekensteyn, jakubjelinek Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D48265 llvm-svn: 334912
* Revert "[CMake] Use a different source depending on C++ support"Jonas Hahnfeld2018-06-172-16/+8
| | | | | | | | | This reverts commit r332924 and followup r332936 silencing a warning. The change breaks the build on x86 if there is no 32-bit version of the C++ libraries, see discussion in https://reviews.llvm.org/D47169. llvm-svn: 334903
* [fuzzer] Python 3 print fixesVitaly Buka2018-06-172-4/+4
| | | | llvm-svn: 334902
* [fuzzer] Fix collect_data_flow.py for python 3Vitaly Buka2018-06-171-1/+1
| | | | llvm-svn: 334901
* [sanitizer] Use const char* in internal_simple_strtollVitaly Buka2018-06-177-8/+8
| | | | llvm-svn: 334900
* [sanitizer_common] Fix windows build caused by r334881Fangrui Song2018-06-161-1/+3
| | | | llvm-svn: 334884
* [asan] Enable fgets_fputs test on AndroidVitaly Buka2018-06-161-5/+2
| | | | | | | | | "echo data" didn't work because %run on android executes test on the device when lit shell command on the host system. https://github.com/google/sanitizers/issues/952 llvm-svn: 334883
* [sanitizer_common] Use O_TRUNC for WrOnly access mode.Fangrui Song2018-06-163-2/+8
| | | | | | | | | | | | Summary: Otherwise if the file existed and was larger than the write size before the OpenFile call, the file will not be truncated and contain garbage in trailing bytes. Reviewers: glider, kcc, vitalybuka Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48250 llvm-svn: 334881
* [asan] Move long-object-path.cc test to LinuxVitaly Buka2018-06-151-1/+0
| | | | | | | | | | | | Reviewers: Lekensteyn Reviewed By: Lekensteyn Subscribers: srhines, kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D48186 llvm-svn: 334866
* [libFuzzer] Avoid -fuse-ld=lld on gc-sections.Matt Morehouse2018-06-151-2/+2
| | | | | | | The bot doesn't recognize lld as a linker even though it has the property lld-available. llvm-svn: 334864
* [SanitizerCoverage] Add associated metadata to pc-tables.Matt Morehouse2018-06-151-3/+3
| | | | | | | | | | | | | | | | | | | | Summary: Using associated metadata rather than llvm.used allows linkers to perform dead stripping with -fsanitize-coverage=pc-table. Unfortunately in my local tests, LLD was the only linker that made use of this metadata. Partially addresses https://bugs.llvm.org/show_bug.cgi?id=34636 and fixes https://github.com/google/sanitizers/issues/971. Reviewers: eugenis Reviewed By: eugenis Subscribers: Dor1s, hiraditya, llvm-commits, kcc Differential Revision: https://reviews.llvm.org/D48203 llvm-svn: 334858
* [Fuzzer] Don't hardcode target architecture for Fuzzer testsPetr Hosek2018-06-151-32/+34
| | | | | | | | | Don't hardcode the architecture for Fuzzer tests which breaks when compiler-rt is being compiled for architectures other than x86_64. Differential Revision: https://reviews.llvm.org/D48207 llvm-svn: 334852
* [scudo] Add verbose failures in place of CHECK(0)Kostya Kortchinsky2018-06-1510-35/+174
| | | | | | | | | | | | | | | | | | | | | | | | Summary: The current `FailureHandler` mechanism was fairly opaque with regard to the failure reason due to using `CHECK(0)`. Scudo is a bit different from the other Sanitizers as it prefers to avoid spurious processing in its failure path. So we just `dieWithMessage` using a somewhat explicit string. Adapted the tests for the new strings. While this takes care of the `OnBadRequest` & `OnOOM` failures, the next step is probably to migrate the other Scudo failures in the same failes (header corruption, invalid state and so on). Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: filcab, mgorny, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48199 llvm-svn: 334843
* [compiler-rt] [builtins] Don't build __atomic_* by default.Eli Friedman2018-06-141-2/+2
| | | | | | | | | | | The locks need to be implemented in a shared library to work correctly, so they shouldn't be part of libclang_rt.builtins.a, except in specialized scenarios where the user can prove it will only be linked once. Differential Revision: https://reviews.llvm.org/D47606 llvm-svn: 334779
* [libFuzzer] [NFC] XFAIL one of the tests on iOS.George Karpenkov2018-06-141-0/+1
| | | | llvm-svn: 334775
* [libFuzzer] [NFC] Remaining minor fixes to support testing on devices.George Karpenkov2018-06-147-13/+15
| | | | | | XFAIL's and adding %run commands. llvm-svn: 334774
* [libFuzzer] [NFC] Support multi-arch and multi-OS building and testingGeorge Karpenkov2018-06-146-11/+44
| | | | | | Differential Revision: https://reviews.llvm.org/D47296 llvm-svn: 334768
* [libFuzzer] [NFC] Generalize DSO tests to work even when files are moved.George Karpenkov2018-06-142-8/+8
| | | | | | Differential Revision: https://reviews.llvm.org/D47292 llvm-svn: 334766
* [NFC] Generalize flags for linking in shared objects in compiler-rt tests to ↵George Karpenkov2018-06-141-18/+22
| | | | | | | | support using multiple shared objects at once Differential Revision: https://reviews.llvm.org/D48156 llvm-svn: 334765
* [MSan] Linker-initialize static fallback_mutex in msan_allocator.ccAlex Shlyapnikov2018-06-141-1/+1
| | | | | | | | | | | | | | | | Summary: static fallback_mutex in msan_allocator.cc does not need the ctor call and can be linker initialized. Issue: https://github.com/google/sanitizers/issues/194 Reviewers: morehouse, eugenis Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48145 llvm-svn: 334749
* [ASan] Linker-initialize static ScopedInErrorReport::current_error_.Alex Shlyapnikov2018-06-142-1/+2
| | | | | | | | | | | | | | | | | | | Summary: Static ScopedInErrorReport::current_error_ can be linker initialized to shave one global ctor call on application startup and be __asan_init-safe. Global constructors in ASan runtime are bad because __asan_init runs from preinit_array, before any such constructors. Issue: https://github.com/google/sanitizers/issues/194 Reviewers: eugenis, morehouse Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48141 llvm-svn: 334748
* [ASAN] fix typos and disable long-object-path test for win32Peter Wu2018-06-142-2/+3
| | | | | | | | Glob patterns seem unsupported for commands executed by the emulated shell (LIT_USE_INTERNAL_SHELL=1). Disable the test while that is being addressed (a workaround such as "cd a-*" also does not work). llvm-svn: 334719
* [scudo] Make Secondary linker-initialized compliantKostya Kortchinsky2018-06-141-6/+2
| | | | | | | | | | | | | | | | Summary: As a follow up to D48142 for Scudo, switch the `SpinMutex` to its static counterpart, and ensure zero-initialization by memset'ing the whole class. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48148 llvm-svn: 334716
* [ASAN] fix startup crash in dlsym for long paths since glibc 2.27Peter Wu2018-06-142-1/+25
| | | | | | | | | | | | | | | | | | | | Summary: Error messages for dlsym used to be stored on the stack, but since commit 2449ae7b ("ld.so: Introduce struct dl_exception") in glibc 2.27 these are now stored on the heap (and thus use the dlsym alloc pool). Messages look like "undefined symbol: __isoc99_printf\0/path/to/a.out". With many missing library functions and long object paths, the pool is quickly exhausted. Implement a simple mechanism to return freed memory to the pool (clear it in case it is used for calloc). Fixes https://github.com/google/sanitizers/issues/957 Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D47995 llvm-svn: 334703
* [Sanitizer] fix compilation warningDavid Carlier2018-06-141-1/+1
| | | | | | | | | | | | In most of systems, this field is a signed type but in some it is an unsigned. Reviewers: vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D48118 llvm-svn: 334686
* [ASAN] Fix fputs interception for 32-bit macOSPeter Wu2018-06-131-1/+1
| | | | | | | | | On 32-bit macOS, "_fputs$UNIX2003" is called instead of "fputs" and the "fgets_fputs" test fails. Apparently previous versions still passed the test due to the internal implementation calling "strlen", but that does not seem to be the case with macOS 10.13.3. Fixes r334450. llvm-svn: 334670
* [Sanitizers] Make sanitizer allocator linker-initialize compliant.Alex Shlyapnikov2018-06-133-4/+7
| | | | | | | | | | | | | | | | | | | | | Summary: These four SpinMutex ctors was the only code executed in the ctor for the static __asan::Allocator instance (same for the other sanitizers allocators), which is supposed to be fully linker-initialized. Also, when the global ctor for this allocator instance is executed, this instance might already be initialized by __asan_init called from .preinit_array. Issue: https://github.com/google/sanitizers/issues/194 Reviewers: morehouse, eugenis, cryptoad Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48142 llvm-svn: 334660
* Disable MSan tests of prlimit on FreeBSDDimitry Andric2018-06-131-1/+1
| | | | | | | Like NetBSD, FreeBSD does not have prlimit(2), so do not attempt to use it during the MSan tests. llvm-svn: 334659
* [compiler-rt] Use CMAKE_LINKER instead of hardcoding ldShoaib Meenai2018-06-131-1/+1
| | | | | | | Respect a custom linker path provided by the user if one is present (otherwise CMAKE_LINKER will have been set to the right value by CMake). llvm-svn: 334654
* [ASAN] Re-enable fgets_fputs test for darwin.Ahmed Bougacha2018-06-131-1/+1
| | | | | | It seems to be passing, at least on the bots I've seen. llvm-svn: 334626
* [TSan] Fix madvise(MADV_NOHUGEPAGE) for meta shadow memoryAlex Shlyapnikov2018-06-134-18/+40
| | | | | | | | | | | | | | | | Summary: Move madvise(MADV_NOHUGEPAGE) for the meta shadow memory after the meta shadow memory is mapped (currently it silently fails with ENOMEM). Add a diagnostic message to detect similar problems in the future. Reviewers: dvyukov Subscribers: kubamracek, delcypher, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D48097 llvm-svn: 334624
* [XRay] Set an explicit dependency on libc++ when neededPetr Hosek2018-06-132-10/+26
| | | | | | | | | | | When XRay is being built as part of the just built compiler together with libc++ as part of the runtimes build, we need an explicit dependency from XRay to libc++ to make sure that the library is available by the time we start building XRay. Differential Revision: https://reviews.llvm.org/D48113 llvm-svn: 334575
* Reland "Passthrough additional flags to custom libcxx CMake build"Petr Hosek2018-06-132-11/+25
| | | | | | | | This is needed when we're cross-compiling compiler-rt. Differential Revision: https://reviews.llvm.org/D47834 llvm-svn: 334570
* [ASAN] disable fgets_fputs test for android and darwinPeter Wu2018-06-121-0/+1
| | | | | | | | aarch64/aosp_marlin-userdebug/OPR4.170623.016] builder unexpectedly failed the fgets test (`assertion "fp" failed`). macOS unexpectedly passes the fputs test without triggering ASAN. llvm-svn: 334558
* [libFuzzer] [NFC] Do not use hardcoded relative paths in tests.George Karpenkov2018-06-121-11/+12
| | | | | | | | | For paths without "%t" inside uniqueness is not guaranteed, and potential collisions might be present. Differential Revision: https://reviews.llvm.org/D47288 llvm-svn: 334546
* [libFuzzer] [NFC] Make compiler command generation more readable.George Karpenkov2018-06-121-7/+20
| | | | | | | | Use config.clang as a more general option than config.c_compiler. Differential Revision: https://reviews.llvm.org/D47295 llvm-svn: 334545
* Revert r334458, r334220, r334212, r334139.Matt Morehouse2018-06-122-42/+10
| | | | | | | Reverts changes to AddCompilerRT.cmake due to breakage of http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/. llvm-svn: 334528
OpenPOWER on IntegriCloud