summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
* Revert "tsan: add fiber support"Diana Picus2019-02-1313-464/+2
| | | | | | | This reverts commit r353817 because we think it broke AARch64 and PowerPC buildbots. llvm-svn: 353939
* [profile] Provide lprofGetHostName for all windows environmentsMartin Storsjo2019-02-131-1/+1
| | | | | | | | | This function doesn't use anything MSVC specific but works fine for any _WIN32 target. Differential Revision: https://reviews.llvm.org/D58106 llvm-svn: 353918
* [CMake] Avoid clang dependencies in the runtimes buildPetr Hosek2019-02-131-1/+1
| | | | | | | Dependencies like clang aren't available in the runtimes build, this was accidentally omitted in D57992. llvm-svn: 353914
* [libFuzzer] a bit of refactoring of the fork modeKostya Serebryany2019-02-137-76/+156
| | | | llvm-svn: 353910
* [Sanitizer][NFC] Darwin: limit parallism for sanitizer_common testsJulian Lettner2019-02-131-0/+6
| | | | | | | Many sanitizer_common tests (ASan, TSan) run with a "sanitized process space" so we need to limit their parallism. llvm-svn: 353909
* [xray][tests][RHDTS] Add -lstdc++ after LLVM libs, resolving link error with ↵Hubert Tong2019-02-131-2/+3
| | | | | | | | | | | | | | | | | | | | | RHDTS Summary: A link error was encountered when using the Red Hat Developer Toolset. In the RHDTS, `libstdc++.so` is a linker script that may resolve symbols to a static library. This patch places `-lstdc++` later in the ordering. Reviewers: sfertile, nemanjai, tstellar, dberris Reviewed By: dberris Subscribers: dberris, mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58144 llvm-svn: 353905
* [tsan] #undef one-letter macrosEvgeniy Stepanov2019-02-121-0/+8
| | | | | | | | buildgo.sh puts most of sanitizer_common together in a single source file. These single-letter macros end up affecting a lot of unrelated code; #undef them as early as possible. llvm-svn: 353902
* [libFuzzer] move the implementation of the fork mode into a separate fileKostya Serebryany2019-02-126-93/+165
| | | | llvm-svn: 353891
* tsan: update check_analyze.shDmitry Vyukov2019-02-121-7/+1
| | | | | | | Update numbers after 353817. This was extensively benchmarked in https://reviews.llvm.org/D54889 llvm-svn: 353820
* tsan: add fiber supportDmitry Vyukov2019-02-1213-2/+464
| | | | | | | | | | | | | | | | | This patch adds functions for managing fibers: __tsan_get_current_fiber() __tsan_create_fiber() __tsan_destroy_fiber() __tsan_switch_to_fiber() __tsan_set_fiber_name() See the added tests for use examples. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D54889 llvm-svn: 353817
* tsan: Introduce in_symbolizer() function for Thread sanitizerDmitry Vyukov2019-02-124-22/+28
| | | | | | | | | This change is preparation for fiber support. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D58104 llvm-svn: 353805
* [CMake] Avoid internal dependencies in the runtimes buildPetr Hosek2019-02-121-1/+1
| | | | | | | When performing runtimes build, dependencies like clang and clang-headers aren't available. This was accidentally omitted in D57992. llvm-svn: 353796
* [libFuzzer] make the fork mode less verboseKostya Serebryany2019-02-125-28/+52
| | | | llvm-svn: 353794
* [libFuzzer] teach the fork mode to ignore OOMs and timeoutsKostya Serebryany2019-02-127-11/+47
| | | | llvm-svn: 353792
* [sanitizer] Don't compile GetPathAssumingFileIsRelativeToExec on FuchsiaPetr Hosek2019-02-121-9/+20
| | | | | | | | This avoids the unused function warning during compilation. Differential Revision: https://reviews.llvm.org/D58082 llvm-svn: 353787
* [CMake][XRay] Silence llvm-config error when checking library supportPetr Hosek2019-02-121-2/+4
| | | | | | | | | | Otherwise this propagates all the way to CMake and results in an error during configuration. We check and handle the result and report warning separately so this is not changing the behavior. Differential Revision: https://reviews.llvm.org/D58086 llvm-svn: 353784
* [libFuzzer] replace slow std::mt19937 with a much faster std::minstd_rand; ↵Kostya Serebryany2019-02-122-4/+5
| | | | | | second attempt after failed r352732, this time with a fix for cmake llvm-svn: 353782
* [libFuzzer] simplify the code for print_coverage=1 so that it doesn't fail ↵Kostya Serebryany2019-02-121-2/+2
| | | | | | on broken debug info llvm-svn: 353781
* [libFuzzer] Make coverage.test work on ARM64Julian Lettner2019-02-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This test instruments the following code with coverage, runs the fuzzer once, and asserts that there are uncovered PCs. The ARM64 backend optimizes this code using the `csel` (Conditional select) instruction, which removes all branching from the resulting machine code. The test then fails because we do not have any uncovered PCs. The easiest solution for now is to turn off optimization for the DSOs used in this test. ``` int DSO1(int a) { if (a < 123456) return 0; return 1; } ``` rdar://47646400 Reviewers: kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58087 llvm-svn: 353780
* [libFuzzer] run the -fork=1 tests only on linuxKostya Serebryany2019-02-122-1/+5
| | | | llvm-svn: 353777
* [libFuzzer] extend the -fork=1 functionality. Still not fully usable, but ↵Kostya Serebryany2019-02-1212-36/+110
| | | | | | good enough for the first unit test llvm-svn: 353775
* [NFC] Re-enable XFAILed fuzzer test on iOSJulian Lettner2019-02-111-1/+0
| | | | llvm-svn: 353737
* tsan: Implement pthread_exit() interceptor for Thread sanitizerVitaly Buka2019-02-091-0/+8
| | | | | | | | | | | | This change is preparation for fiber support. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D57876 Context: https://reviews.llvm.org/D54889 > llvm-svn: 353385 llvm-svn: 353627
* [tsan] Remove debug logging and disable test on ppc64beVitaly Buka2019-02-091-1/+1
| | | | llvm-svn: 353624
* [tsan] Remove debug logging and disable test on ppc64beVitaly Buka2019-02-091-5/+5
| | | | llvm-svn: 353623
* [tsan] Debug failing test on PPC botVitaly Buka2019-02-091-1/+5
| | | | llvm-svn: 353617
* [tsan] Remove pthread_exit interceptorVitaly Buka2019-02-091-8/+0
| | | | | | Crashes PPC bot llvm-svn: 353604
* [CMake] Don't set <PROJECT>_STANDALONE_BUILDPetr Hosek2019-02-091-1/+1
| | | | | | | | | We shouldn't be treating runtimes builds as standalone builds since we have enough of the context loaded into the runtimes environment. Differential Revision: https://reviews.llvm.org/D57992 llvm-svn: 353601
* [Fuzzer] Fix function prototype in fuzzer::ExternalFunctions. [NFC]David L. Jones2019-02-091-1/+1
| | | | | | | | | | | | | | The __sanitizer_acquire_crash_state function has int return type, but the fuzzer's external function definitions give it bool. Places where __sanitizer_acquire_crash_state is declared: include/sanitizer_common/sanitizer_interface_defs.h lib/sanitizer_common/sanitizer_interface_internal.h lib/sanitizer_common/sanitizer_common.cc lib/fuzzer/FuzzerExtFunctions.def (this is the only bool) llvm-svn: 353596
* Temporarily disable calls to getgrnam/getgrnam_r in test due to it hitting ↵Douglas Yung2019-02-091-2/+4
| | | | | | unrelated issues in EGLIBC 2.19. llvm-svn: 353594
* [libFuzzer] more refactoring; change some of the exit codes (timeout, OOM, ↵Kostya Serebryany2019-02-096-39/+57
| | | | | | interrupt) so that the parent process can distinguish those llvm-svn: 353584
* [libFuzzer] refactor the merging code, NFCKostya Serebryany2019-02-083-37/+52
| | | | llvm-svn: 353576
* [libFuzzer] remove two unused experimental flagsKostya Serebryany2019-02-087-91/+4
| | | | llvm-svn: 353573
* [libFuzzer] introduce an experimental mode -fork=1, where fuzzing happens in ↵Kostya Serebryany2019-02-087-52/+89
| | | | | | a subprocess (still running multiple inputs per process), thus making the fuzzing more resilient to timeouts and OOMs. This is just a skeleton of the code, and some associated refactoring, not a fully working feature yet. llvm-svn: 353570
* Fix Die() after pthread_exit call on macOSVitaly Buka2019-02-081-0/+3
| | | | | | | | | | | | | | | | | | | | Summary: Scoped interceptor should not be used when calling real pthread_exit(). On macOS C++ destructors are not called by pthread_exit(), and later check for empty thread ignore set fails. Patch by Yuri Per. Reviewers: dvyukov, vitalybuka Reviewed By: vitalybuka Subscribers: vitalybuka, thegameg, kubamracek, jfb, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57963 llvm-svn: 353561
* [InstrProf] Fix darwin errors after r353547Francis Visoiu Mistrih2019-02-081-8/+8
| | | | | | | | | | The macros were changed but not updated in the Darwin version. Fail here: http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/53739/ rdar://47925820 llvm-svn: 353560
* [tsan] Remove SCOPED_TSAN_INTERCEPTOR to try to fix ppc botVitaly Buka2019-02-081-1/+0
| | | | llvm-svn: 353552
* [InstrProf] Implement static profdata registrationReid Kleckner2019-02-089-65/+153
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The motivating use case is eliminating duplicate profile data registered for the same inline function in two object files. Before this change, users would observe multiple symbol definition errors with VC link, but links with LLD would succeed. Users (Mozilla) have reported that PGO works well with clang-cl and LLD, but when using LLD without this static registration, we would get into a "relocation against a discarded section" situation. I'm not sure what happens in that situation, but I suspect that duplicate, unused profile information was retained. If so, this change will reduce the size of such binaries with LLD. Now, Windows uses static registration and is in line with all the other platforms. Reviewers: davidxl, wmi, inglorion, void, calixte Subscribers: mgorny, krytarowski, eraman, fedor.sergeev, hiraditya, #sanitizers, dmajor, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57929 llvm-svn: 353547
* [scudo][standalone] Correct cmake copy/paste errorKostya Kortchinsky2019-02-081-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: I mistakenly used a SCUDO variable instead of SCUDO_STANDALONE one. The net result was that there were more architecture supported than I intended. Correct that, I'll add more architectures once the bots are enabled and green for x86. Reviewers: eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D57897 llvm-svn: 353528
* [libFuzzer] refactor the way we choose the element to cross-over with, NFC ↵Kostya Serebryany2019-02-087-19/+47
| | | | | | (expected1); add a flag -seed_inputs= to pass extra seed inputs as file paths, not dirs llvm-svn: 353494
* [libFuzzer] add a test for built-in CrossOver (there are unit tests for ↵Kostya Serebryany2019-02-082-0/+68
| | | | | | this, but it's worth having a full integration test like this) llvm-svn: 353488
* Silence -Wformat warnings about GetLastError returning ULONGReid Kleckner2019-02-071-7/+7
| | | | llvm-svn: 353485
* Commit macro intended to be included in r353483.Reid Kleckner2019-02-071-1/+1
| | | | llvm-svn: 353484
* [compiler rt] Win64 GetInstructionSize additional register MOV + stack ↵Reid Kleckner2019-02-072-2/+27
| | | | | | | | | | | | | | | | | | | | | | | alignment AND Current interception code does not cover all of the required registers on Windows for a specific flavor of MOV, so this patch adds cases to identify the following 5-byte instructions on 64-bit Windows: mov QWORD PTR [rsp + XX], rdx <- second integer argument mov QWORD PTR [rsp + XX], r9 <- third integer argument mov QWORD PTR [rsp + XX], r8 <- fourth integer argument The instruction for MOV [...] RCX is already covered in the previous version. Patch by Matthew McGovern! Reviewers: rnk Differential Revision: https://reviews.llvm.org/D57339 llvm-svn: 353483
* [safestack] Explain why tinfo at the end of the bufferVitaly Buka2019-02-071-0/+2
| | | | | | | | | | | | | | Reviewers: pcc, eugenis, vlad.tsyrklevich Reviewed By: vlad.tsyrklevich Subscribers: llvm-commits, jfb, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57863 llvm-svn: 353482
* [safestack] Remove pageSizeVitaly Buka2019-02-071-9/+2
| | | | | | | | | | | | | | | | | Summary: 3rd party sysconf interceptor may crash if it's called before unsafe_stack_setup However pageSize is not useful here. mmap should round up on it's own, SFS_CHECK can be removed. Reviewers: eugenis, vlad.tsyrklevich Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D57924 llvm-svn: 353481
* [safestack] Don't crash if stack size is not aligned as expectedVitaly Buka2019-02-071-1/+1
| | | | | | | | | | | | | | | | Summary: From runtime side looks it's OK to RoundUpTo to needed alignment as buffer is going to be RoundUpTo to page size anyway. Reviewers: eugenis, pcc Subscribers: #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D57866 llvm-svn: 353475
* [InstrProf] Port test suite to WindowsReid Kleckner2019-02-0739-132/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change, check-profile would run, but all tests would be marked unsupported on Windows. This is the new status of 'check-profile' after this change: Testing Time: 6.66s Expected Passes : 29 Expected Failures : 5 Unsupported Tests : 39 I moved many tests that exercise posix-y features like dlopen and DSOs into the Posix subdirectory, and ran the tests on Linux to validate my changes. These are the remaining tests that I handled on a case by case basis: - instrprof-path.c Passes, Fixed some path portability issues - instrprof-gcov-exceptions.test Passes, the FileCheck actually succeeds on Windows, so I RUNX'd it - instrprof-icall-promo.test XFAILed, probably due to C++ ABI differences in vtables - instrprof-merge-match.test - instrprof-merge.c - instrprof-merging.cpp XFAILed, These seem like real bugs that need fixing - instrprof-version-mismatch.c XFAILed, Overriding the weak version symbol doesn't work - instrprof-without-libc.c UNSUPPORTED, test needs an executable symbol table, Windows has none Reviewers: davidxl, wmi, void Subscribers: fedor.sergeev, #sanitizers, llvm-commits Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D57853 llvm-svn: 353435
* [scudo][standalone] Do not error out on spurious C(XX) flagsKostya Kortchinsky2019-02-071-1/+3
| | | | | | | | | | | | | | | | | | | | | | Summary: The standalone Scudo version is being built with `-Werror` which can be tripped by extraneous command line arguments. We have little control over those as they can be passed down to us by `CMAKE_C(XX)_FLAGS`, the reported scenario involving `-stdlib=libc++` (see https://reviews.llvm.org/D57412#1384504). To work around this, disable `-Wunused-command-line-argument`. Reviewers: eugenis, vitalybuka, Eugene.Zelenko Reviewed By: eugenis Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D57757 llvm-svn: 353418
* tsan: add more benchmarksDmitry Vyukov2019-02-072-0/+100
| | | | | | | | | func_entry_exit.cc is for __tsan_func_entry/exit (spends ~75% there), we don't yet have any. mop.cc is for memory access functions, as compared to mini_bench_local/shared.cc this benchmark passes through deduplication logic (ContainsSameAccess). llvm-svn: 353407
OpenPOWER on IntegriCloud