summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Try to fix OOB tests on at least Windows after r367642Nico Weber2019-08-051-1/+1
| | | | | | | | | gtest's built-in regex engine doesn't support (). Looks like it's not needed, just remove it. See PR42868 for more details. llvm-svn: 367873
* compiler-rt: Rename .cc file in test/dfsan to cppNico Weber2019-08-051-1/+1
| | | | | | See r367849 et al. llvm-svn: 367854
* compiler-rt: Rename .cc file in test/lsan to .cppFangrui Song2019-08-051-1/+1
| | | | | | Like r367463, but for test/lsan. llvm-svn: 367803
* [sanitizer_common][tests] Fix SanitizerCommon-Unit :: ↵Rainer Orth2019-08-021-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ./Sanitizer-*-Test/SanitizerCommon.PthreadDestructorIterations on Solaris SanitizerCommon.PthreadDestructorIterations currently FAILs on Solaris: [ RUN ] SanitizerCommon.PthreadDestructorIterations /vol/llvm/src/compiler-rt/local/lib/sanitizer_common/tests/sanitizer_posix_test.cc:58: Failure Value of: destructor_executed Actual: true Expected: false [ FAILED ] SanitizerCommon.PthreadDestructorIterations (1 ms) It turns out that destructor is called 4 times after the first call to SpawnThread, but 5 times after the second. While PTHREAD_DESTRUCTOR_ITERATIONS is 4 in <limits.h>, the Solaris pthread_key_create(3C) man page documents If, after all the destructors have been called for all keys with non- null values, there are still some keys with non-null values, the process will be repeated. POSIX requires that this process be executed at least PTHREAD_DESTRUCTOR_ITERATIONS times. Solaris calls the destructors repeatedly until all values with associated destructors are NULL. Destructors that set new values can cause an infinite loop. The patch adjusts the test case to allow for this. Tested on x86_64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D65055 llvm-svn: 367705
* compiler-rt: Rename .cc file in test/tsan to .cppFangrui Song2019-08-021-1/+1
| | | | | | Like r367463, but for test/tsan. llvm-svn: 367656
* Fix flaky test caused by PR42868Vitaly Buka2019-08-021-22/+21
| | | | llvm-svn: 367642
* Remove a few straggler ".cc"s in compiler-rt/libNico Weber2019-08-0113-13/+13
| | | | llvm-svn: 367589
* compiler-rt: Call a generated c++ file in hwasan .cpp instead of .ccNico Weber2019-08-011-3/+3
| | | | llvm-svn: 367572
* compiler-rt: Rename .cc file in lib/scudo/standalone/tests to .cppNico Weber2019-08-0123-46/+49
| | | | | | | | Like r367463, but for scudo/standalone/tests. With this, all files in compiler-rt/lib have extension cpp. llvm-svn: 367569
* compiler-rt: Rename .cc file in lib/scudo/standalone to .cppNico Weber2019-08-0115-33/+37
| | | | | | Like r367463, but for scudo/standalone. llvm-svn: 367568
* compiler-rt: Rename .cc file in lib/tsan/{benchmarks,dd,go} to .cppNico Weber2019-08-0112-13/+13
| | | | | | | | | Like r367463, but for tsan/{benchmarks,dd,go}. The files benchmarks aren't referenced in the build anywhere and where added in 2012 with the comment "no Makefiles yet". llvm-svn: 367567
* compiler-rt: Rename .cc file in lib/tsan/tests/{rtl,unit} to .cppNico Weber2019-08-0122-38/+43
| | | | | | Like r367463, but for tsan/tests/{rtl,unit}. llvm-svn: 367566
* compiler-rt: Rename .cc file in lib/tsan/rtl to .cppNico Weber2019-08-0139-95/+101
| | | | | | Like r367463, but for tsan/rtl. llvm-svn: 367564
* compiler-rt: Rename .cc file in lib/msan/tests to .cppNico Weber2019-08-014-6/+11
| | | | | | Like r367463, but for msan/tests. llvm-svn: 367563
* compiler-rt: Rename .cc file in lib/msan to .cppNico Weber2019-08-0111-18/+19
| | | | | | Like r367463, but for msan. llvm-svn: 367562
* compiler-rt: Rename .cc file in lib/lsan to .cppNico Weber2019-08-0113-24/+27
| | | | | | Like r367463, but for lsan. llvm-svn: 367561
* compiler-rt: Rename .cc file in lib/{interception/tests,safestack} to .cppNico Weber2019-08-016-9/+11
| | | | | | Like r367463, but for interception/tests and safestack. llvm-svn: 367560
* compiler-rt: Rename .cc file in lib/asan/tests to .cppNico Weber2019-08-0116-28/+36
| | | | | | Like r367463, but for asan/tests llvm-svn: 367559
* compiler-rt: Rename .cc file in lib/asan to .cppNico Weber2019-08-0145-97/+103
| | | | | | Like r367463, but for asan. llvm-svn: 367558
* Try to heal bots more after r367551Nico Weber2019-08-011-1/+1
| | | | llvm-svn: 367555
* Try to heal bots after r367551Nico Weber2019-08-011-1/+1
| | | | llvm-svn: 367552
* compiler-rt: Rename .cc file in lib/{dfsan,stats,ubsan_minimal} to .cppNico Weber2019-08-0110-13/+15
| | | | | | Like r367463, but for dfsan, stats, ubsan_minimal. llvm-svn: 367551
* compiler-rt: Rename .cc file in lib/xray/tests/unit to .cppNico Weber2019-08-0110-17/+19
| | | | | | Like r367463, but for xray/texts/unit. llvm-svn: 367550
* compiler-rt: Rename .cc file in lib/xray to .cppNico Weber2019-08-0121-49/+63
| | | | | | Like r367463, but for xray. llvm-svn: 367546
* compiler-rt: Try to appease lint script.Nico Weber2019-07-312-9/+7
| | | | | | | | | | | | | A bot complains: /b/sanitizer-x86_64-linux-autoconf/build/llvm/projects/compiler-rt/lib/sanitizer_common/tests/malloc_stress_transfer_test.cpp:2: Streams are highly discouraged. [readability/streams] [3] /b/sanitizer-x86_64-linux-autoconf/build/llvm/projects/compiler-rt/lib/sanitizer_common/tests/sanitizer_libc_test.cpp:11: Streams are highly discouraged. [readability/streams] [3] lib/CMakeFiles/SanitizerLintCheck.dir/build.make:57: recipe for target 'lib/CMakeFiles/SanitizerLintCheck' failed I do not know why this apparently wasn't a problem when the files had extension .cc. llvm-svn: 367493
* Attempt to heal bots after r367467Nico Weber2019-07-311-1/+1
| | | | llvm-svn: 367473
* compiler-rt: Rename .cc file in lib/sanitizer_common/symbolizer to .cppNico Weber2019-07-313-3/+3
| | | | llvm-svn: 367471
* Attempt to heal tsan bot after r367463Nico Weber2019-07-311-1/+1
| | | | llvm-svn: 367469
* compiler-rt: Rename .cc file in lib/sanitizer_common/tests to .cppNico Weber2019-07-3135-68/+71
| | | | | | | | | | | See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $(basename $f) . ; done and manually updated references to renamed files found by that. llvm-svn: 367467
* compiler-rt: Rename .cc file in lib/sanitizer_common to .cppNico Weber2019-07-3183-209/+212
| | | | | | | | | | | See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated (many) references to renamed files found by that. llvm-svn: 367463
* Attempt to heal bots after r367456Nico Weber2019-07-311-1/+1
| | | | llvm-svn: 367462
* compiler-rt: Rename .cc file in lib/profile to .cppNico Weber2019-07-313-2/+2
| | | | | | | | See https://reviews.llvm.org/D58620 for discussion. Note how the comment in the file already said ".cpp" :) llvm-svn: 367460
* compiler-rt: Rename .cc files in lib/interception to .cpp.Nico Weber2019-07-315-8/+8
| | | | | | | | | | | See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated references to renamed files found by that. llvm-svn: 367456
* compiler-rt: Rename .cc files in lib/ubsan to .cpp.Nico Weber2019-07-3118-37/+36
| | | | | | | | | | | See https://reviews.llvm.org/D58620 for discussion, and for the commands I ran. In addition I also ran for f in $(svn diff | diffstat | grep .cc | cut -f 2 -d ' '); do rg $f . ; done and manually updated references to renamed files found by that. llvm-svn: 367452
* gn build: Add build files for compiler-rt/lib/profileNico Weber2019-07-311-3/+7
| | | | | | Differential Revision: https://reviews.llvm.org/D65518 llvm-svn: 367450
* gn build: Fix redundant object files in builtin lib.Nico Weber2019-07-311-18/+0
| | | | | | | | | | | | | | | | | | | | | | compiler-rt's builtin library has generic implementations of many functions, and then per-arch optimized implementations of some. In the CMake build, both filter_builtin_sources() and an explicit loop at the end of the build file (see D37166) filter out the generic versions if a per-arch file is present. The GN build wasn't doing this filtering. Just do the filtering manually and explicitly, instead of being clever. While here, also remove files from the mingw/arm build that are redundantly listed after D39938 / r318139 (both from the CMake and the GN build). While here, also fix a target_os -> target_cpu typo. Differential Revision: https://reviews.llvm.org/D65512 llvm-svn: 367448
* [Sanitizer][ASAN][MSAN] Fix infinite recursion on FreeBSDAlexander Richardson2019-07-313-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: MSAN was broken on FreeBSD by https://reviews.llvm.org/D55703: after this change accesses to the key variable call __tls_get_addr, which is intercepted. The interceptor then calls GetCurrentThread which calls MsanTSDGet which again calls __tls_get_addr, etc... Using the default implementation in the SANITIZER_FREEBSD case fixes MSAN for me. I then applied the same change to ASAN (introduced in https://reviews.llvm.org/D55596) but that did not work yet. In the ASAN case, we get infinite recursion again during initialization, this time because calling pthread_key_create() early on results in infinite recursion. pthread_key_create() calls sysctlbyname() which is intercepted but COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED returns true, so the interceptor calls internal_sysctlbyname() which then ends up calling the interceptor again. I fixed this issue by using dlsym() to get the libc version of sysctlbyname() instead. This fixes https://llvm.org/PR40761 Reviewers: vitalybuka, krytarowski, devnexen, dim, bsdjhb, #sanitizers, MaskRay Reviewed By: MaskRay Subscribers: MaskRay, emaste, kubamracek, jfb, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D65221 llvm-svn: 367442
* [asan_symbolize] More debugging outputDan Liew2019-07-311-0/+1
| | | | | | | | | When a line fails to match the stackframe regex we now report it in the log. rdar://problem/49476995 llvm-svn: 367380
* [asan_symbolize] Add `--skip-uuid-validation` option to `ModuleMapPlugIn`.Dan Liew2019-07-311-10/+26
| | | | | | | | | This option disables the validation of binary UUIDs. This is useful in environments where the `otool` binary is not available. rdar://problem/49476995 llvm-svn: 367379
* [asan_symbolize] Provide better error message when extracting the UUID of a ↵Dan Liew2019-07-311-1/+3
| | | | | | | | binary fails rdar://problem/49476995 llvm-svn: 367378
* Revert "[compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for ↵Francis Visoiu Mistrih2019-07-291-5/+0
| | | | | | | | | xray (2)" This reverts commit r367250. It's failing on green dragon: http://lab.llvm.org:8080/green/job/clang-stage1-RA/482/console. llvm-svn: 367265
* [compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (2)Puyan Lotfi2019-07-291-0/+5
| | | | | | | | | | | Second attempt. Haven't found a better way to pass the libcxx include path for building compiler-rt with libcxx; this seems to be missing only for xray. Differential Revision: https://reviews.llvm.org/D65307 llvm-svn: 367250
* [compiler-rt] Reverting r367239 (xray include path) to fix bot build breakage.Puyan Lotfi2019-07-291-3/+0
| | | | llvm-svn: 367246
* Appending COMPILER_RT_LIBCXX_PATH include path to -isystem for compiler-rt xrayPuyan Lotfi2019-07-291-0/+3
| | | | | | | | | Haven't found a better way to pass the libcxx include path for building compiler-rt with libcxx; this seems to be missing only for xray. Differential Revision: https://reviews.llvm.org/D65307 llvm-svn: 367239
* Don't initialize interceptor_metadata_map unless SI_POSIX is setEugene Leviant2019-07-281-1/+3
| | | | | | Differential revision: https://reviews.llvm.org/D64794 llvm-svn: 367188
* [profile] In Android, do not mkdir() dirs in GCOV_PREFIXPirama Arumuga Nainar2019-07-251-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In Android, attempting to mkdir() or even stat() top-level directories like /data causes noisy selinux denials. During whole-system coverage instrumentation, this causes a deluge of noisy messages that drown out legitimate selinux denials, that should be audited and fixed. To avoid this, skip creating any directory in GCOV_PREFIX (thereby assuming that it exists). - Android platform ensures that the GCOV_PREFIX used in Android is created and read/writable by all processes. - This only affects the Android platform (by checking against __ANDROID_API_FUTURE__) and for apps built with Clang coverage, the runtime will still create any non-existent parent directories for the coverage files. Reviewers: srhines, davidxl Subscribers: krytarowski, #sanitizers, danalbert, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D65245 llvm-svn: 367064
* [sanitizer_common] Allow customization of StartSymbolizerSubprocessJulian Lettner2019-07-252-7/+13
| | | | | | | | | | | | | | Summary: Make SymbolizerProcess::StartSymbolizerSubprocess virtual and protected to allow subclasses to customize it via "override and call". Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D65252 llvm-svn: 366967
* [scudo][standalone] Optimization passKostya Kortchinsky2019-07-2414-94/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This introduces a bunch of small optimizations with the purpose of making the fastpath tighter: - tag more conditions as `LIKELY`/`UNLIKELY`: as a rule of thumb we consider that every operation related to the secondary is unlikely - attempt to reduce the number of potentially extraneous instructions - reorganize the `Chunk` header to not straddle a word boundary and use more appropriate types Note that some `LIKELY`/`UNLIKELY` impact might be less obvious as they are in slow paths (for example in `secondary.cc`), but at this point I am throwing a pretty wide net, and it's consistant and doesn't hurt. This was mosly done for the benfit of Android, but other platforms benefit from it too. An aarch64 Android benchmark gives: - before: ``` BM_youtube/min_time:15.000/repeats:4/manual_time_mean 445244 us 659385 us 4 BM_youtube/min_time:15.000/repeats:4/manual_time_median 445007 us 658970 us 4 BM_youtube/min_time:15.000/repeats:4/manual_time_stddev 885 us 1332 us 4 ``` - after: ``` BM_youtube/min_time:15.000/repeats:4/manual_time_mean 415697 us 621925 us 4 BM_youtube/min_time:15.000/repeats:4/manual_time_median 415913 us 622061 us 4 BM_youtube/min_time:15.000/repeats:4/manual_time_stddev 990 us 1163 us 4 ``` Additional since `-Werror=conversion` is enabled on some platforms we are built on, enable it upstream to catch things early: a few sign conversions had slept through and needed additional casting. Reviewers: hctim, morehouse, eugenis, vitalybuka Reviewed By: vitalybuka Subscribers: srhines, mgorny, javed.absar, kristof.beyls, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D64664 llvm-svn: 366918
* [libFuzzer] Fix __sanitizer_print_memory_profile return type in ExtFunctions.defMax Moroz2019-07-231-1/+1
| | | | | | | | | | | | | | | | | | Summary: Looks like a typo, as that function actually returns void and is used as such in libFuzzer code as well. Reviewers: kcc, Dor1s Reviewed By: Dor1s Subscribers: delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D65160 llvm-svn: 366834
* [compiler-rt][builtins] Provide __clear_cache for SPARCRainer Orth2019-07-231-0/+10
| | | | | | | | | | | | | | | While working on https://reviews.llvm.org/D40900, two tests were failing since __clear_cache aborted. While libgcc's __clear_cache is just empty, this only happens because gcc (in gcc/config/sparc/sparc.c (sparc32_initialize_trampoline, sparc64_initialize_trampoline)) emits flush insns directly. The following patch mimics that. Tested on sparcv9-sun-solaris2.11. Differential Revision: https://reviews.llvm.org/D64496 llvm-svn: 366822
OpenPOWER on IntegriCloud