summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [CMake] Separate the detection Darwin platforms architectures for theDan Liew2019-09-132-31/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | built-ins from the rest of compiler-rt. The detection of supported platform (os) architectures for Darwin relies on the `darwin_test_archs()` CMake function. This is used both for building the builtins (`builtin-config-ix.cmake`) and for the rest of the compiler-rt (`config-ix.cmake`). `darwin_test_archs()` implements a cache, presumably to speed up CMake re-configures. Unfortunately this caching is buggy because it depends on external global state (i.e. the `TEST_COMPILE_ONLY` variable) and this is not taken into account. For `config-ix.cmake` `TEST_COMPILE_ONLY` is not set and for `builtin-config-ix.cmake` `TEST_COMPILE_ONLY` is set to `On`. This makes the `darwin_test_archs()` function racey in the sense that a call from one calling context will poison the cache for the other calling context. This is actually an issue George Karpenkov discovered a while back and had an incomplete patch for (https://reviews.llvm.org/D45337) but this was never merged. To workaround this, this patch switches to using a different set of variables for the platform architecture builtins, i.e. `DARWIN_<OS>_ARCHS` -> `DARWIN_<OS>_BUILTIN_ARCHS`. This avoids the cache poisoning problem because the cached variable names are different. This also has the advantage that the the configured architectures for builtins and the rest of the compiler-rt are now independent and can be set differently if necessary. Note in `darwin_test_archs()` we also now pass `-w` to the compiler because `try_compile_only()` treats compiler warnings as errors. This was extremely fragile because compiler warnings (can easily appear due to a buggy compiler or SDK headers) would cause compiler-rt to think an architecture on Darwin wasn't supported. rdar://problem/48637491 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371871 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Add ubsan interface header.Pierre Gousseau2019-09-132-0/+33
| | | | | | | | | | This is to document __ubsan_default_options(). Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D67503 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371822 91177308-0d34-0410-b5e6-96231b3b80d8
* Add getauxval() compat for NetBSDKamil Rytarowski2019-09-122-3/+21
| | | | | | | | | | | | | | | | | | | | | | | Summary: getauxval() is not available on NetBSD and there is no a direct equivalent. Add a function that implements the same semantics with NetBSD internals. Reorder the GetPageSize() functions to prefer the sysctl approach for NetBSD. It no longer makes a difference which approach is better. Avoid changing conditional code path. Reviewers: vitalybuka, dvyukov, mgorny, joerg Reviewed By: vitalybuka Subscribers: llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67329 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371758 91177308-0d34-0410-b5e6-96231b3b80d8
* Split many_tls_keys.cpp into two testsKamil Rytarowski2019-09-122-0/+61
| | | | | | | | | | | | | | | | | | | | | Summary: many_tls_keys_pthread.cpp for TSD many_tls_keys_thread.cpp for TLS The TSD test is unsupported on NetBSD as it assumes TLS used internally. TSD on NetBSD does not use TLS. Reviewers: joerg, vitalybuka, mgorny, dvyukov, kcc Reviewed By: vitalybuka Subscribers: jfb, llvm-commits, #sanitizers Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D67428 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371757 91177308-0d34-0410-b5e6-96231b3b80d8
* Use host's executable suffix for clang when cross-compiling compiler-rtReid Kleckner2019-09-121-2/+12
| | | | | | | | | | | | | | | | | | | | | When cross-compiling compiler-rt as part of LLVM e. g. for Linux on a Windows host and using the just-built clang as cross-compiler, we set the -DBUILTINS_CMAKE_ARGS="-DCMAKE_SYSTEM_NAME=Linux" flag in top-level cmake invocation, which causes CMAKE_EXECUTABLE_SUFFIX to be an empty string in the nested cmake invocation for building builtins. But the compiler for compiling test cases is meant to be run on host, therefore it may have the '.exe' suffix. Handle this by asking cmake about the host system. Patch by Sergej Jaskiewicz <jaskiewiczs@icloud.com> Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D67401 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371754 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] cpplint of inc files in backgroundVitaly Buka2019-09-121-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371705 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Remove some cpplint filtersVitaly Buka2019-09-1222-63/+77
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371704 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Run cpplint only for check-sanitizerVitaly Buka2019-09-122-3/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371703 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Better lint output for .inc filesVitaly Buka2019-09-123-19/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371702 91177308-0d34-0410-b5e6-96231b3b80d8
* [dfsan] Revert dfsan_set_label removalVitaly Buka2019-09-111-0/+5
| | | | | | It's part of interface, maybe it is used in external code. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371691 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove NOLINTs from compiler-rtVitaly Buka2019-09-1192-398/+402
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371687 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix mac buildVitaly Buka2019-09-111-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371680 91177308-0d34-0410-b5e6-96231b3b80d8
* Update compiler-rt cpplint.pyVitaly Buka2019-09-1121-2726/+4953
| | | | | | https://github.com/cpplint/cpplint/commit/adb3500107f409ac5491188ae652ac3f4d03d9d3 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371675 91177308-0d34-0410-b5e6-96231b3b80d8
* [libFuzzer] Remove hardcoded number of new features in merge_two_step.test.Max Moroz2019-09-111-2/+2
| | | | | | | | | | | | | | | | | | | | Summary: The number of features can be different on different platforms. This should fixed broken builders, e.g. http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/7946 Reviewers: Dor1s Reviewed By: Dor1s Subscribers: kristof.beyls, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67458 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371647 91177308-0d34-0410-b5e6-96231b3b80d8
* [scudo][standalone] Android related improvementsKostya Kortchinsky2019-09-115-15/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This changes a few things to improve memory footprint and performances on Android, and fixes a test compilation error: - add `stdlib.h` to `wrappers_c_test.cc` to address https://bugs.llvm.org/show_bug.cgi?id=42810 - change Android size class maps, based on benchmarks, to improve performances and lower the Svelte memory footprint. Also change the 32-bit region size for said configuration - change the `reallocate` logic to reallocate in place for sizes larger than the original chunk size, when they still fit in the same block. This addresses patterns from `memory_replay` dumps like the following: ``` 202: realloc 0xb48fd000 0xb4930650 12352 202: realloc 0xb48fd000 0xb48fd000 12420 202: realloc 0xb48fd000 0xb48fd000 12492 202: realloc 0xb48fd000 0xb48fd000 12564 202: realloc 0xb48fd000 0xb48fd000 12636 202: realloc 0xb48fd000 0xb48fd000 12708 202: realloc 0xb48fd000 0xb48fd000 12780 202: realloc 0xb48fd000 0xb48fd000 12852 202: realloc 0xb48fd000 0xb48fd000 12924 202: realloc 0xb48fd000 0xb48fd000 12996 202: realloc 0xb48fd000 0xb48fd000 13068 202: realloc 0xb48fd000 0xb48fd000 13140 202: realloc 0xb48fd000 0xb48fd000 13212 202: realloc 0xb48fd000 0xb48fd000 13284 202: realloc 0xb48fd000 0xb48fd000 13356 202: realloc 0xb48fd000 0xb48fd000 13428 202: realloc 0xb48fd000 0xb48fd000 13500 202: realloc 0xb48fd000 0xb48fd000 13572 202: realloc 0xb48fd000 0xb48fd000 13644 202: realloc 0xb48fd000 0xb48fd000 13716 202: realloc 0xb48fd000 0xb48fd000 13788 ... ``` In this situation we were deallocating the old chunk, and allocating a new one for every single one of those, but now we can keep the same chunk (we just updated the header), which saves some heap operations. Reviewers: hctim, morehouse, vitalybuka, eugenis, cferris, rengolin Reviewed By: morehouse Subscribers: srhines, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67293 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371628 91177308-0d34-0410-b5e6-96231b3b80d8
* [libFuzzer] Make -merge=1 to reuse coverage information from the control file.Max Moroz2019-09-114-23/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change allows to perform corpus merging in two steps. This is useful when the user wants to address the following two points simultaneously: 1) Get trustworthy incremental stats for the coverage and corpus size changes when adding new corpus units. 2) Make sure the shorter units will be preferred when two or more units give the same unique signal (equivalent to the `REDUCE` logic). This solution was brainstormed together with @kcc, hopefully it looks good to the other people too. The proposed use case scenario: 1) We have a `fuzz_target` binary and `existing_corpus` directory. 2) We do fuzzing and write new units into the `new_corpus` directory. 3) We want to merge the new corpus into the existing corpus and satisfy the points mentioned above. 4) We create an empty directory `merged_corpus` and run the first merge step: ` ./fuzz_target -merge=1 -merge_control_file=MCF ./merged_corpus ./existing_corpus ` this provides the initial stats for `existing_corpus`, e.g. from the output: ` MERGE-OUTER: 3 new files with 11 new features added; 11 new coverage edges ` 5) We recreate `merged_corpus` directory and run the second merge step: ` ./fuzz_target -merge=1 -merge_control_file=MCF ./merged_corpus ./existing_corpus ./new_corpus ` this provides the final stats for the merged corpus, e.g. from the output: ` MERGE-OUTER: 6 new files with 14 new features added; 14 new coverage edges ` Alternative solutions to this approach are: A) Store precise coverage information for every unit (not only unique signal). B) Execute the same two steps without reusing the control file. Either of these would be suboptimal as it would impose an extra disk or CPU load respectively, which is bad given the quadratic complexity in the worst case. Tested on Linux, Mac, Windows. Reviewers: morehouse, metzman, hctim, kcc Reviewed By: morehouse Subscribers: JDevlieghere, delcypher, mgrang, #sanitizers, llvm-commits, kcc Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D66107 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371620 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "clang-misexpect: Profile Guided Validation of Performance ↵Dmitri Gribenko2019-09-112-185/+0
| | | | | | | | | | | | | | | | | | | Annotations in LLVM" This reverts commit r371584. It introduced a dependency from compiler-rt to llvm/include/ADT, which is problematic for multiple reasons. One is that it is a novel dependency edge, which needs cross-compliation machinery for llvm/include/ADT (yes, it is true that right now compiler-rt included only header-only libraries, however, if we allow compiler-rt to depend on anything from ADT, other libraries will eventually get used). Secondly, depending on ADT from compiler-rt exposes ADT symbols from compiler-rt, which would cause ODR violations when Clang is built with the profile library. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371598 91177308-0d34-0410-b5e6-96231b3b80d8
* clang-misexpect: Profile Guided Validation of Performance Annotations in LLVMPetr Hosek2019-09-112-0/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch contains the basic functionality for reporting potentially incorrect usage of __builtin_expect() by comparing the developer's annotation against a collected PGO profile. A more detailed proposal and discussion appears on the CFE-dev mailing list (http://lists.llvm.org/pipermail/cfe-dev/2019-July/062971.html) and a prototype of the initial frontend changes appear here in D65300 We revised the work in D65300 by moving the misexpect check into the LLVM backend, and adding support for IR and sampling based profiles, in addition to frontend instrumentation. We add new misexpect metadata tags to those instructions directly influenced by the llvm.expect intrinsic (branch, switch, and select) when lowering the intrinsics. The misexpect metadata contains information about the expected target of the intrinsic so that we can check against the correct PGO counter when emitting diagnostics, and the compiler's values for the LikelyBranchWeight and UnlikelyBranchWeight. We use these branch weight values to determine when to emit the diagnostic to the user. A future patch should address the comment at the top of LowerExpectIntrisic.cpp to hoist the LikelyBranchWeight and UnlikelyBranchWeight values into a shared space that can be accessed outside of the LowerExpectIntrinsic pass. Once that is done, the misexpect metadata can be updated to be smaller. In the long term, it is possible to reconstruct portions of the misexpect metadata from the existing profile data. However, we have avoided this to keep the code simple, and because some kind of metadata tag will be required to identify which branch/switch/select instructions are influenced by the use of llvm.expect Patch By: paulkirth Differential Revision: https://reviews.llvm.org/D66324 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371584 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove xfail i386 NetBSD mark in vptr-non-unique-typeinfo.cppKamil Rytarowski2019-09-101-1/+0
| | | | | | | This test passes now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371575 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove xfail NetBSD mark from ignored-interceptors-mmap.cppKamil Rytarowski2019-09-101-1/+0
| | | | | | | This test now passes. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371574 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBSan] Follow up fix for r371442.Max Moroz2019-09-091-1/+1
| | | | | | | | | | | | | | Reviewers: vitalybuka, hctim, Dor1s Reviewed By: Dor1s Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67371 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371453 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Add AnnotateIgnoreReadsBegin declaration to tsan/test.hJulian Lettner2019-09-096-31/+5
| | | | | | | | | | | | Declare the family of AnnotateIgnore[Read,Write][Begin,End] TSan annotations in compiler-rt/test/tsan/test.h so that we don't have to declare them separately in every test that needs them. Replace usages. Leave usages that explicitly test the annotation mechanism: thread_end_with_ignore.cpp thread_end_with_ignore3.cpp git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371446 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBSan] Do not overwrite the default print_summary sanitizer option.Max Moroz2019-09-092-1/+11
| | | | | | | | | | | | | | | | | | | | | Summary: This option is true by default in sanitizer common. The default false value was added a while ago without any reasoning in https://github.com/llvm-mirror/compiler-rt/commit/524e934112a593ac081bf2b05aa0d60a67987f05 so, presumably it's safe to remove for consistency. Reviewers: hctim, samsonov, morehouse, kcc, vitalybuka Reviewed By: hctim, samsonov, vitalybuka Subscribers: delcypher, #sanitizers, llvm-commits, kcc Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D67193 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371442 91177308-0d34-0410-b5e6-96231b3b80d8
* [TSan] Add interceptors for mach_vm_[de]allocateJulian Lettner2019-09-096-10/+150
| | | | | | | | | | | | I verified that the test is red without the interceptors. rdar://40334350 Reviewed By: kubamracek, vitalybuka Differential Revision: https://reviews.llvm.org/D66616 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371439 91177308-0d34-0410-b5e6-96231b3b80d8
* compiler-rt: use fp_t instead of long double, for consistencyEd Maste2019-09-094-4/+4
| | | | | | | | | Most builtins accepting or returning long double use the fp_t typedef. Change the remaining few cases to do so. Differential Revision: https://reviews.llvm.org/D35034 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371400 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable LSan for NetBSD/i386 in test/asan/lit.cfg.pyKamil Rytarowski2019-09-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371354 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable LSan tests for NetBSD/i386Kamil Rytarowski2019-09-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371338 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop marking 5 ASan tests as failing on NetBSD/i386Kamil Rytarowski2019-09-084-6/+0
| | | | | | | | | | | Unexpected Passing Tests (4): AddressSanitizer-i386-netbsd :: TestCases/Posix/coverage-reset.cpp AddressSanitizer-i386-netbsd :: TestCases/Posix/coverage.cpp AddressSanitizer-i386-netbsd :: TestCases/Posix/interception-in-shared-lib-test.cpp AddressSanitizer-i386-netbsd :: TestCases/suppressions-library.cpp git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371337 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Only run dlopen-mixed-c-cxx.c with static runtimeJonas Hahnfeld2019-09-081-2/+3
| | | | | | | | | | | | | | This is what the original bug (http://llvm.org/PR39641) and the fix in https://reviews.llvm.org/D63877 have been about. With the dynamic runtime the test only passes when the asan library is linked against libstdc++: In contrast to libc++abi, it does not implement __cxa_rethrow_primary_exception so the regex matches the line saying that asan cannot intercept this function. Indeed, there is no message that the runtime failed to intercept __cxa_throw. Differential Revision: https://reviews.llvm.org/D67298 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371336 91177308-0d34-0410-b5e6-96231b3b80d8
* Enable leak-detection for NetBSD/amd64 in test/asanKamil Rytarowski2019-09-081-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371335 91177308-0d34-0410-b5e6-96231b3b80d8
* Do not intercept malloc_usable_size on NetBSDKamil Rytarowski2019-09-081-1/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371334 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert "Revert "[builtins] Rounding mode support for addxf3/subxf3""Yi Kong2019-09-0514-17/+261
| | | | | | | | Test failure fixed. This reverts commit e204d244badb2e9765a1020f41c773f63da208f4. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@371003 91177308-0d34-0410-b5e6-96231b3b80d8
* [X86] Add support for avx512bf16 for __builtin_cpu_supports and ↵Craig Topper2019-09-041-1/+7
| | | | | | compiler-rt's cpu indicator. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370915 91177308-0d34-0410-b5e6-96231b3b80d8
* compiler-rt: use 64-bit time_t for all FreeBSD archs except i386Ed Maste2019-09-031-1/+1
| | | | | | | | | At present only i386 has 32-bit time_t on FreeBSD. Reviewed by: dim Differential Revision: https://reviews.llvm.org/D66758 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370756 91177308-0d34-0410-b5e6-96231b3b80d8
* compiler-rt: use more __sanitizer_time_t on FreeBSDEd Maste2019-09-031-11/+11
| | | | | | | | | A few structs were using long for time_t members. NFC. Reviewed by: devnexen Differential Revision: https://reviews.llvm.org/D66756 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370755 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] enable x86 libfuzzer on WindowsMatthew G McGovern2019-08-291-0/+2
| | | | | | | | - recent commit https://reviews.llvm.org/D66433 enabled libfuzzer to build on windows, this just enables the option to build as part of the the regular build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370390 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Support monorepo layout in symbolizer build scriptVitaly Buka2019-08-291-6/+21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370288 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Simplify COMPILER_RT setup in lint scriptVitaly Buka2019-08-281-8/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370277 91177308-0d34-0410-b5e6-96231b3b80d8
* Further relax checks in asan-symbolize-bad-path.cppAlexander Richardson2019-08-281-2/+2
| | | | | | | | | | It turns out that the DarwinSymbolizer does not print the "in" part for invalid files but instead prints #0 0xabcdabcd (.../asan-symbolize-bad-path.cpp.tmp/bad/path:i386+0x1234) This tests is only checking that asan_symbolize.py doesn't hang or crash, so further relax the checks to ensure that the test passes on macOS. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370243 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay] Fixing one test case for FreeBSDDavid Carlier2019-08-281-0/+10
| | | | | | | | | | Reviewers: dberris Reviewed By: dberris Differential Revision: https://reviews.llvm.org/D66867 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370209 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Don't use libcxx if it's not enabled by LLVM_ENABLE_PROJECTSVitaly Buka2019-08-281-18/+24
| | | | | | | | | This fixes sanitizer-x86_64-linux-fuzzer which switched to new layout and not it can't link as libcxx is always there. We should support and tests libcxx but still it was unexpected that libfuzzer ignored LLVM_ENABLE_PROJECTS_USED. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370153 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer_common] Close superfluous file descriptors in spawned processJulian Lettner2019-08-271-5/+23
| | | | | | | | | | | | | | Use attribute flag `POSIX_SPAWN_CLOEXEC_DEFAULT` in the call to `posix_spawn`. If this flag is set, then only file descriptors explicitly described by the file_actions argument are available in the spawned process; all of the other file descriptors are automatically closed in the spawned process. POSIX_SPAWN_CLOEXEC_DEFAULT is an Apple-specific extension. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370121 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix asan-symbolize-bad-path.cpp on DarwinAlexander Richardson2019-08-271-1/+2
| | | | | | | | I accidentally made the CHECK line stricter when committing D65322. While it happens to work for Linux and FreeBSD, it broke on Darwin. This commit restores the previous behaviour. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370110 91177308-0d34-0410-b5e6-96231b3b80d8
* Add GWP-ASan fuzz target to compiler-rt/tools.Mitch Phillips2019-08-275-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: @eugenis to approve addition of //compiler-rt/tools. @pree-jackie please confirm that this WFY. D66494 introduced the GWP-ASan stack_trace_compressor_fuzzer. Building fuzz targets in compiler-rt is a new affair, and has some challenges: - If the host compiler doesn't have compiler-rt, the -fsanitize=fuzzer may not be able to link against `libclang_rt.fuzzer*`. - Things in compiler-rt generally aren't built when you want to build with sanitizers using `-DLLVM_USE_SANITIZER`. This tricky to work around, so we create the new tools directory so that we can build fuzz targets with sanitizers. This has the added bonus of fixing the problem above as well, as we can now just guard the fuzz target build to only be done with `-DLLVM_USE_SANITIZE_COVERAGE=On`. Reviewers: eugenis, pree-jackie Reviewed By: eugenis, pree-jackie Subscribers: dberris, mgorny, #sanitizers, llvm-commits, eugenis, pree-jackie, lebedev.ri, vitalybuka, morehouse Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D66776 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370094 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan_symbolize] Fix broken pipe handling for python 2.7Alexander Richardson2019-08-271-3/+9
| | | | | | | | I D65322 I added a check for BrokenPipeError. However, python 2.7 doesn't have BrokenPipeError. To be python 2.7 and 3 compatible we need to catch IOError instead and check for errno == errno.EPIPE. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370025 91177308-0d34-0410-b5e6-96231b3b80d8
* NFC: clang-format r370008 to suppress lint errorsVitaly Buka2019-08-272-7/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370023 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax test introduced in D65322Alexander Richardson2019-08-271-2/+2
| | | | | | | | | | | It is possible that addr2line returns a valid function and file name for the passed address on some build configuations. The test is only checking that asan_symbolize doesn't assert any more when passed a valid file with an invalid address so there is no need to check that it can't find a valid function name. This should fix http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370021 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix buildbotDavid Carlier2019-08-272-4/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370011 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Using huge page on FreeBSD for shadow mappingDavid Carlier2019-08-274-4/+29
| | | | | | | | | | | | | - Unless explicit configuration, using FreeBSD super pages feature for shadow mapping. - asan only for now. Reviewers: dim, emaste, vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D65851 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370008 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Add lld into dependency of sanitizer_common unittestsVitaly Buka2019-08-271-0/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@370007 91177308-0d34-0410-b5e6-96231b3b80d8