summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* Prospective test fix in response to r358104.John McCall2019-04-111-1/+1
| | | | llvm-svn: 358149
* [NFC] Use clearer naming for local variablesJF Bastien2019-04-103-25/+25
| | | | llvm-svn: 358145
* [TSan][libdispatch] Replace CFRunLoop with dispatch_semaphore, pt. 1Julian Lettner2019-04-096-53/+54
| | | | | | | | | | | | Remove the dependency on Foundation so we can start running those tests on other platforms. Rename/move of tests will be done in a separate commit. Reviewed By: kubamracek, dvyukov Differential Revision: https://reviews.llvm.org/D60347 llvm-svn: 358023
* [scudo][standalone] Add flags & related parsersKostya Kortchinsky2019-04-099-0/+510
| | | | | | | | | | | | | | | | | | | | | | | Summary: As with other Sanitizers, and the current version of Scudo, we can provide flags in differents way: at compile time, through a weak function, through an environment variable. This change adds support for the configuration flags, and the string parsers. Those are fairly similar to the sanitizer_common way of doing things. Reviewers: morehouse, hctim, vitalybuka Reviewed By: morehouse, vitalybuka Subscribers: mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59597 llvm-svn: 358011
* [asan_symbolize] Move argument parser epilog text into script doc comment.Dan Liew2019-04-091-3/+5
| | | | | | | | | | | | | | | | | | Summary: This will make it easier to expand on the documentation in the future that avoids cluttering the code. rdar://problem/49476995 Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka Subscribers: #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60398 llvm-svn: 357978
* hwasan: Enable -hwasan-allow-ifunc by default.Peter Collingbourne2019-04-091-2/+1
| | | | | | | | | It's been on in Android for a while without causing problems, so it's time to make it the default and remove the flag. Differential Revision: https://reviews.llvm.org/D60355 llvm-svn: 357960
* [asan_symbolize] Use proper logging infrastructure.Dan Liew2019-04-084-14/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The previous logging infrastructure had several problems: * Debugging output was emitted to standard output which is also where the symbolized output would go. Interleaving these two separate bits of information makes inspecting the output difficult and could potentially break tests. * Enabling debugging output requires modifying the script which is not very conveninent. * When debugging it isn't immediately obvious where the output is coming from. This patch uses the Python standard library logging infrastructure which fixes all of the above problems. Logging is controlled using two new options. * `--log-level` - Sets the logging level, default is `info`. * `--log-dest` - Set the logging destination, default is standard error. Some simple test cases for the feature are included. rdar://problem/49476995 Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka Subscribers: #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60343 llvm-svn: 357951
* [Sanitizer] Make wcrtomb test posix-onlyPavel Labath2019-04-081-0/+3
| | | | | | | | | | | | wcrtomb is not intercepted on windows, so this test fails there. It's not clear to me why we do not intercept this function there (I'll look into that separately), but for now this should at least make the windows sanitizer bot green again (broken by r357889, when I added this test). I also add "UNSUPPORTED: android" as this function is also not intercepted there. llvm-svn: 357892
* [Sanitizer] Fix a possible write to freed memory in the wcrtomb interceptorPavel Labath2019-04-083-7/+59
| | | | | | | | | | | | | | | | | | Summary: r357240 added an interceptor for wctomb, which uses a temporary local buffer to make sure we don't write to unallocated memory. This patch applies the same technique to wcrtomb, and adds some additional tests for this function. Reviewers: vitalybuka, eugenis Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59984 llvm-svn: 357889
* [TSan][libdispatch] Remove Darwin-only version of fully-ported testsJulian Lettner2019-04-0610-428/+0
| | | | | | | Remove 10 tests that already have a copy in tsan/libdispatch, without dependencies on Darwin-specifis. llvm-svn: 357832
* tsan: Update test expectations.Peter Collingbourne2019-04-061-2/+2
| | | | llvm-svn: 357831
* [gn] Support for building compiler-rt builtinsPetr Hosek2019-04-051-81/+111
| | | | | | | | | | | | | | | | This is support for building compiler-rt builtins, The library build should be complete for a subset of supported platforms, but not all CMake options have been replicated in GN. We always use the just built compiler to build all the runtimes, which is equivalent to the CMake runtimes build. This simplifies the build configuration because we don't need to support arbitrary host compiler and can always assume the latest Clang. With GN's toolchain support, this is significantly more efficient than the CMake runtimes build. Differential Revision: https://reviews.llvm.org/D60331 llvm-svn: 357821
* Use binary write mode in WriteToFile function to avoid appended \r ↵Vitaly Buka2019-04-053-1/+38
| | | | | | | | | | | | | | | | | | | | | characters on Windows Summary: When using libfuzzer on Windows, in the contents of a crash sample, bytes that can be mistaken for a \n are replaced by a \r\n sequence. As a consequence, crashes are not reproducible. This patch will open files in binary mode to fix this issue. The patch does not affect POSIX systems. Patch by tuktuk Reviewers: kcc, vitalybuka Reviewed By: vitalybuka Subscribers: dexonsmith, jdoerfert, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60008 llvm-svn: 357807
* [Sanitizers] Provide __internal_dup on SolarisRainer Orth2019-04-051-0/+4
| | | | | | | | | | | | | | | | | | | | Both LLVM 8.0.0 and current trunk fail to link libclang_rt.ubsan.standalone-*.so on Solaris 11/x86 with GCC 8.1.0: Undefined first referenced symbol in file Scanning dependencies of target clang_rt.asan_cxx-x86_64 __sanitizer::internal_dup(int) ../sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_posix.cc.o ld: fatal: symbol referencing errors collect2: error: ld returned 1 exit status make[2]: *** [projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan_standalone-dynamic-i386.dir/build.make:233: lib/clang/9.0.0/lib/sunos/libclang_rt.ubsan_standalone-i386.so] Error 1 Fixed by providing an implementation, which allowed the i386-pc-solaris2.11 build to finish. Differential Revision: https://reviews.llvm.org/D60045 llvm-svn: 357753
* [Sanitizers] Fix sanitizer_linux_libcdep.cc compilation on SolarisRainer Orth2019-04-051-0/+1
| | | | | | | | | | | | | | | | | | | | | Both LLVM 8.0.0 and current trunk fail to compile on Solaris 11/x86 with GCC 8.1.0: /vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc: In function ‘void __sanitizer::ReExec()’: /vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:831:14: error: ‘getexecname’ was not declared in this scope pathname = getexecname(); ^~~~~~~~~~~ /vol/llvm/src/llvm/dist/projects/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc:831:14: note: suggested alternative: ‘gethostname’ pathname = getexecname(); ^~~~~~~~~~~ gethostname This is easily fixed by including <stdlib.h> which declares that function. With that patch, compilation continues. Differential Revision: https://reviews.llvm.org/D60044 llvm-svn: 357751
* [TSan][libdispatch] Make test work on Linux, pt. 2Julian Lettner2019-04-051-2/+2
| | | | llvm-svn: 357741
* [libFuzzer] Another follow up fix for Data Flow scripts in Py3.Max Moroz2019-04-041-2/+6
| | | | | | | | | | | | | | Reviewers: Dor1s Reviewed By: Dor1s Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60289 llvm-svn: 357732
* [libFuzzer] Fix output format in data flow merge script after Py3 change.Max Moroz2019-04-041-1/+1
| | | | | | | | | | | | | | Reviewers: Dor1s Reviewed By: Dor1s Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60288 llvm-svn: 357730
* [TSan][libdispatch] Make test work on LinuxJulian Lettner2019-04-041-3/+4
| | | | llvm-svn: 357729
* Remove unneeded ymath.h include from int_math.hReid Kleckner2019-04-041-1/+0
| | | | | | | | | | | | This avoids a conflict between stdbool.h, which defines bool to _Bool in xkeycheck.h. From what I can tell, ymath.h is an internal header, and the intention is that users should include math.h directly instead. It doesn't appear to provide declarations of anything required for our builtins. This include was added back in r249513 from 2015, and it's possible that ymath.h provided something this code needed at the time, but today it does not. llvm-svn: 357728
* [TSan][libdispatch] Stricter checks via `--implicit-check-not`Julian Lettner2019-04-047-16/+8
| | | | | | | | `--implicit-check-not='ThreadSanitizer'` checks in the entire output while `// CHECK-NOT: ThreadSanitizer` only checks after (before) the previous (next) match. llvm-svn: 357727
* [libFuzzer] Make DataFlow scripts Python3 compatible.Max Moroz2019-04-042-6/+8
| | | | | | | | | | | | | | | | | | | Summary: Python2 will hit end of life soon: https://pythonclock.org/ This change also makes the integration with OSS-Fuzz a bit simpler: https://github.com/google/oss-fuzz/issues/1632 Reviewers: morehouse, kcc Reviewed By: morehouse Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D60282 llvm-svn: 357726
* [winasan] Fix strrchr interception with vs2019 CRTReid Kleckner2019-04-041-0/+2
| | | | | | | | | | | | | | strrchr in vs2019 CRT begins with unrecognized instructions. VCRUNTIME140!strrchr: 4533c9 xor r9d, r9d 4c8bc1 mov r8, rcx Patch by Christopher Reid! Differential Revision: https://reviews.llvm.org/D60217 llvm-svn: 357725
* [TSan][libdispatch] Specify libdispatch header dir for lit testsJulian Lettner2019-04-043-11/+14
| | | | | | | | | Specify libdispatch header dir (include path) for lit tests. This is the last missing piece in order to run the libdispatch tests on Linux even when libdispatch is installed in a custom path instead of a default (system) location. llvm-svn: 357707
* [NFC][TSan][libdispatch] Better CMake variable namesJulian Lettner2019-04-044-8/+8
| | | | llvm-svn: 357664
* [TSan][libdispatch] Add Cmake option for libdispatch install pathJulian Lettner2019-04-041-12/+5
| | | | llvm-svn: 357657
* Fix typos in tests. NFC.Xing GUO2019-04-031-1/+1
| | | | | | | | | | | | | | Reviewers: Higuoxing Reviewed By: Higuoxing Subscribers: kubamracek, cfe-commits, #sanitizers, llvm-commits Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D60183 llvm-svn: 357577
* [NFC][TSan][libdispatch] Cleanup testJulian Lettner2019-04-021-6/+6
| | | | llvm-svn: 357530
* [NFC] Test is C++, not CJulian Lettner2019-04-021-0/+0
| | | | llvm-svn: 357524
* [TSan][libdispatch] We don't require any setup on DarwinJulian Lettner2019-04-021-1/+1
| | | | llvm-svn: 357519
* [NFC][libdispatch] Improve a few testsJulian Lettner2019-04-023-6/+7
| | | | llvm-svn: 357510
* Fix problem with ar_to_bc.sh script introduced by r357450.Peter Collingbourne2019-04-021-2/+2
| | | | | | | The new code wasn't matching absolute paths correctly. Should unbreak sanitizer-x86_64-linux bot. llvm-svn: 357502
* Fix tests after r357452Hans Wennborg2019-04-022-4/+4
| | | | llvm-svn: 357462
* ar_to_bc.sh: replace readlink -f with custom relative path resolutionFangrui Song2019-04-021-2/+2
| | | | | | | | | | llvm-ar is a crunchgen-style executable dispatching to dlltool,ranlib,lib,ar based on argv[0]. In our content-addressable storage, readlink -f resolves paths to some digest and thus lost the original "llvm-ar" filename. Replace it with a custom path resolution to fix the problem. llvm-svn: 357450
* [compiler-rt][test] Make instrprof-set-dir-mode test tolerant of group IDMatt Davis2019-04-021-1/+5
| | | | | | | | | | | | | | | | | | | Patch from 'troyj': Hi, I ran into a problem with this test when the source was located in certain directories. The mkdir(2) man page states that the set-group-ID bit is inherited from the parent directory, but this test was written in such a way that it assumes the bit is unset. Whether that assumption is true depends on where the checkout lives, which leads to some people being able to reproduce the problem whereas others cannot. I think the correct fix is to exclude the bit from the check. Making probinson a reviewer since they reviewed the original test. Patch landed for troyj, thanks! Differential Revision: D53832 llvm-svn: 357449
* [cmake] Change deprecated $<CONFIG> to $<CONFIGURATION>. NFCFangrui Song2019-03-301-1/+1
| | | | | | | See rL357338 for a similar change. The informational expression $<CONFIGURATION> has been deprecated since CMake 3.0 llvm-svn: 357348
* [Sanitizer] Add interceptor for wctombPavel Labath2019-03-294-0/+50
| | | | | | | | | | | | | | | | | Summary: This is required to avoid msan false positives for code using this function (although generally one should avoid using this function in favor of wcrtomb). Reviewers: eugenis, EricWF, vitalybuka Subscribers: srhines, kubamracek, fedor.sergeev, delcypher, llvm-commits, #sanitizers Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59548 llvm-svn: 357240
* Revert "[builtins] Rounding mode support for addxf3/subxf3"Yi Kong2019-03-2714-241/+16
| | | | | | | | This reverts commit 2cabea054e40ae2837da959d0ca89ae25cf1b1f1. Test failure on buildbots. llvm-svn: 357048
* [builtins] Rounding mode support for addxf3/subxf3Yi Kong2019-03-2614-16/+241
| | | | | | | | | | | | | | | | | Implement rounding mode support for addxf3/subxf3. On architectures that implemented the support, this will access the corresponding floating point environment register to apply the correct rounding. For other architectures, it will keep the current behaviour and use IEEE-754 default rounding mode (to nearest, ties to even). ARM32/AArch64 support implemented in this change. i386 and AMD64 will be added in a follow up change. Differential Revision: https://reviews.llvm.org/D57143 llvm-svn: 357035
* Fix typos in compiler-rt/lib/builtins/atomic.cHubert Tong2019-03-231-1/+10
| | | | | | | | | | | | | | | | | | | Summary: This patch fixes typos in file compiler-rt/lib/builtins/atomic.c. Reviewers: jasonliu, hubert.reinterpretcast, jfb Reviewed By: jfb Subscribers: t.p.northover, theraven, dberris, jfb, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59228 Patch by Xing Xue. llvm-svn: 356844
* [NFC][TSan][libdispatch] Don't use ignore_noninstrumented_modules on LinuxJulian Lettner2019-03-221-3/+0
| | | | llvm-svn: 356728
* Enable `asan/TestCases/Posix/start-deactivated.cc` test for iOS.Dan Liew2019-03-212-2/+1
| | | | | | | | | | | | | | | | | | | Summary: To make this test pass it was necesary to change `iossim_run.py` to propagate the `ASAN_ACTIVATION_OPTIONS` environment variable into the testing environment. rdar://problem/49114807 Reviewers: kubamracek, yln, serge-sans-paille Subscribers: #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D59660 llvm-svn: 356701
* Make __cpu_model a hidden symbol, to match libgcc.Sterling Augustine2019-03-201-0/+10
| | | | | | | | | | | | | | | Also hide __cpu_inicator_init and __cpu_features2 for similar reasons. Summary: Make __cpu_model a hidden symbol, to match libgcc. Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59561 llvm-svn: 356581
* [scudo][standalone] Add error reportsKostya Kortchinsky2019-03-206-37/+339
| | | | | | | | | | | | | | | | | | | | | Summary: This change adds fatal error messages for various error conditions that will be added later in the code. This also addresses a `TODO` now that we have `reportCheckFailed` (which lead me to notice a few variables that were not cased properly so I changed that as well). Reviewers: morehouse, hctim, vitalybuka Reviewed By: morehouse, hctim, vitalybuka Subscribers: mgorny, delcypher, jfb, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59551 llvm-svn: 356556
* [builtins] Divide shouldn't underflow if rounded result would be normal.Eli Friedman2019-03-196-2/+133
| | | | | | | | | | | We were treating certain edge cases that are actually normal as denormal results, and flushing them to zero; we shouldn't do that. Not sure this is the cleanest way to implement this edge case, but I wanted to avoid adding any code on the common path. Differential Revision: https://reviews.llvm.org/D59070 llvm-svn: 356529
* [TSan][libdispatch] Avoid infinite recursion in dispatch_apply[_f] interceptorsJulian Lettner2019-03-191-9/+29
| | | | | | | | | | | | | | | | | In libdispatch, dispatch_apply is implemented in terms of dispatch_apply_f. Unfortunately, this means that we can't implement the interceptor for dispatch_apply_f by forwarding to the dispatch_apply interceptor. In the interceptor dispatch_apply_f, we can't use WRAP(dispatch_apply). WRAP(dispatch_apply) -> REAL(dispatch_apply_f). Requires duplication of some setup code. Reviewed By: kubamracek Differential Revision: https://reviews.llvm.org/D59526 llvm-svn: 356467
* [scudo][standalone] Add string utility functionsKostya Kortchinsky2019-03-197-13/+385
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add some string utility functions, notably to format strings, get lengths, convert a string to a number. Those functions will be used in reports and flags (coming up next). They were mostly borrowed from sanitizer_common. Make use of the string length function in a couple places in the platform code that was checked in with inlined version of it. Add some tests. Reviewers: morehouse, eugenis, vitalybuka, hctim Reviewed By: morehouse, vitalybuka Subscribers: mgorny, delcypher, jdoerfert, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D59262 llvm-svn: 356457
* [asan] Disable -Wfortify-source in intentional OOB testsReid Kleckner2019-03-182-4/+4
| | | | | | Needed after r356397 llvm-svn: 356426
* [NFC][TSan][libdispatch] Fix test for dispatch_apply[_f]Julian Lettner2019-03-181-12/+18
| | | | | | | | | | | | | | | | * Array index out of bounds: 100 iterations, but size of array is 2. * Unmatched barrier_init (2) with barrier_wait (200) * Number of iterations must be smaller than the available parallelism for the queue, otherwise we deadlock (since every barrier_wait call blocks the thread). Scary: All of this worked reliably in gcd-apply.mm (for Darwin) Rievewed By: kubamracek Differential Revision: https://reviews.llvm.org/D59510 llvm-svn: 356418
* [TSan][libdispatch] Configure libdispatch lit testsJulian Lettner2019-03-161-1/+6
| | | | llvm-svn: 356311
OpenPOWER on IntegriCloud