summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* Revert "[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors."Evgeniy Stepanov2019-03-024-87/+65
| | | | | | | | | Breaks TSan on Mac, which does return REAL(func)(... in COMMON_INTERCEPTOR_ENTER, which is not OK when REAL(func) has return type of void. llvm-svn: 355256
* Revert "Revert "[sanitizers] Don't use Windows Trace Logging on MinGW""Vlad Tsyrklevich2019-03-022-3/+15
| | | | | | | This reverts my orignal revert in r355250, I misread the buildbot logs. Volodymyr's commit in r355244 fixed the build. llvm-svn: 355251
* Revert "[sanitizers] Don't use Windows Trace Logging on MinGW"Vlad Tsyrklevich2019-03-022-15/+3
| | | | | | | This reverts commits r355236 and r355244, they broke the Linux sanitizer build. llvm-svn: 355250
* [sanitizers] Fix build on macOS with LogFullErrorReport redefinition error.Volodymyr Sapsai2019-03-021-1/+1
| | | | | | | | | | | | | | | | macOS has implementation of LogFullErrorReport and INLINE void LogFullErrorReport(const char *buffer) {} was causing > compiler-rt/lib/sanitizer_common/sanitizer_mac.cc:658:6: error: redefinition of 'LogFullErrorReport' Fixup for r355236. rdar://problem/48526020 llvm-svn: 355244
* [NFC][Sanitizer] Replace last uses of old Unwind APIJulian Lettner2019-03-012-25/+24
| | | | | | | | | | | | | Replace remaining uses of old Unwind API in unit tests. Allows us to remove the old API and WillUseFastUnwind can be made private. Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D58754 llvm-svn: 355242
* [NFC][Sanitizer] Test unexpectedly passes on ppc64be botJulian Lettner2019-03-011-1/+1
| | | | llvm-svn: 355239
* [CMake] Don't use llvm_replace_compiler_optionMartin Storsjo2019-03-011-3/+7
| | | | | | | | | | | | | | Building compiler-rt standalone outside of the main llvm tree is supported, and in this case, the llvm cmake modules are unavailable. (And even if they are available, it requires including LLVMProcessSources.cmake, which currently isn't included.) This fixes building compiler-rt standalone with MSVC/clang-cl. Differential Revision: https://reviews.llvm.org/D58767 llvm-svn: 355237
* [sanitizers] Don't use Windows Trace Logging on MinGWMartin Storsjo2019-03-012-3/+15
| | | | | | | | | | | | | | | | | | | mingw-w64 currently is lacking the headers for this feature. Make the include lowercase at the same time. We consistently use lowercase for windows header includes, as windows itself is case insensitive, the SDK headers (in general, not necessarily considering this particular header) aren't consistent among themselves about what the proper canonical capitalization for headers are, and MinGW uses all lowercase names for the headers (as it is often used on case sensitive filesystems). In case mingw-w64 later gets this header, we can revert this (but keep the include lowercased). Differential Revision: https://reviews.llvm.org/D58765 llvm-svn: 355236
* [NFC][Sanitizer][Windows] Fix refactoring oversightJulian Lettner2019-03-011-1/+1
| | | | | | Fix mistake in previous commit: 9fe3b4906f351292691cd594b30fe6cf7230b94d llvm-svn: 355234
* [NFC][Sanitizer] Make GetStackTrace a private method of BufferedStackTraceJulian Lettner2019-03-018-52/+53
| | | | | | | | | | GetStackTrace is a implementation detail of BufferedStackTrace. Make it a private method. Reviewed By: vitalybuka Differential-Revision: https://reviews.llvm.org/D58753 llvm-svn: 355232
* [sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors.Evgeniy Stepanov2019-03-014-65/+87
| | | | llvm-svn: 355231
* Revert "[sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors."Evgeniy Stepanov2019-03-014-29/+21
| | | | | | This change is incomplete. llvm-svn: 355230
* [sanitizer] Fix return type of __bzero and __aeabi_mem* interceptors.Evgeniy Stepanov2019-03-014-21/+29
| | | | | | They return void, unlike memset/memcpy/memmove. llvm-svn: 355225
* [msan] Add an interceptor for ttyname().Evgeniy Stepanov2019-03-013-3/+22
| | | | llvm-svn: 355214
* Reland "[compiler-rt] Intercept the bcmp() function."Clement Courbet2019-03-018-28/+89
| | | | | | | Fix test issues on darwin: The REQUIRES for the test should be the same as the guard for whether we intercept bcmp. llvm-svn: 355204
* [scudo][standalone] Fix tests makefileKostya Kortchinsky2019-03-011-2/+2
| | | | | | | | | | | | | | | | | | | | | Summary: A missing `STATIC` entailed some annoying to debug failures wrt 32 vs 64 binaries. Additionally I noticed I was using the wrong variable (the Scudo one as opposed to the Scudo Standalone one). See https://reviews.llvm.org/D58184#1412417 and below for discussion. Reviewers: vitalybuka, eugenis, brzycki Reviewed By: vitalybuka, brzycki Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58794 llvm-svn: 355203
* [sanitizers] Explicitly use GetModuleFileNameW with wchar_tMartin Storsjo2019-03-011-1/+1
| | | | | | | | Alternatively we could define the string as TCHAR. Differential Revision: https://reviews.llvm.org/D58766 llvm-svn: 355180
* [NFC][Sanitizer] Add new BufferedStackTrace::Unwind APIJulian Lettner2019-03-0112-78/+80
| | | | | | | | | | | | | | | | | | | | | Retrying without replacing call sites in sanitizer_common (which might not have a symbol definition). Add new Unwind API. This is the final envisioned API with the correct abstraction level. It hides/slow fast unwinder selection from the caller and doesn't take any arguments that would leak that abstraction (i.e., arguments like stack_top/stack_bottom). GetStackTrace will become an implementation detail (private method) of the BufferedStackTrace class. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58741 > llvm-svn: 355168 llvm-svn: 355172
* Revert "[NFC][Sanitizer] Add new BufferedStackTrace::Unwind API"Julian Lettner2019-03-0113-83/+88
| | | | | | This reverts commit 6112f37e758ebf2405955e091a745f5003c1f562. llvm-svn: 355171
* [NFC][Sanitizer] Add new BufferedStackTrace::Unwind APIJulian Lettner2019-03-0113-88/+83
| | | | | | | | | | | | | | | | Add new Unwind API. This is the final envisioned API with the correct abstraction level. It hides/slow fast unwinder selection from the caller and doesn't take any arguments that would leak that abstraction (i.e., arguments like stack_top/stack_bottom). GetStackTrace will become an implementation detail (private method) of the BufferedStackTrace class. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58741 llvm-svn: 355168
* [hwasan] Disable vfork code when building w/o interceptors.Evgeniy Stepanov2019-03-011-1/+1
| | | | | | Don't define vfork when OMPILER_RT_HWASAN_WITH_INTERCEPTORS=OFF. llvm-svn: 355165
* [sanitizer] Build everything whereever possible with -z text.Evgeniy Stepanov2019-03-012-0/+3
| | | | | | | | | | | | Reviewers: pcc, phosek Subscribers: mgorny, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58755 llvm-svn: 355164
* cfi: Rename source file from cc to cppNico Weber2019-02-282-2/+4
| | | | | | See discussion on https://reviews.llvm.org/D58620 for the review. llvm-svn: 355144
* [CMake][LibFuzzer] Match symbol visibility setting between LibFuzzer object ↵Dan Liew2019-02-281-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | files and unit tests. Summary: This fixes inconsistent symbol visibility. This shows up as a linker warning if r336238 (43f633564e338a6dde83d49a48e5bfcbfdce292c) is reverted. ``` ld: warning: direct access in function 'fuzzer::CleanseCrashInput(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&, fuzzer::FuzzingOptions const&)' from file '/Volumes/data/dev/llvm/upstream/master/builds/projects/compiler-rt/lib/fuzzer/tests/libRTFuzzerTest.x86_64.a(FuzzerDriver.cpp.o)' to global weak symbol 'fuzzer::Command::ignoreRemainingArgs()::kIgnoreRemaining' from file 'FuzzerTestObjects.FuzzerUnittest.cpp.x86_64.o' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings. ``` r336238 just hid the issue rather than fixing the real issue. On macOS and other platforms we usually compile with `-fvisibility=hidden` but the unit tests were compiled without this flag. Reviewers: george.karpenkov, kubamracek, kcc, yln Subscribers: mgorny, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58055 llvm-svn: 355143
* [hwasan] Fix vfork handling with large stack limit.Evgeniy Stepanov2019-02-281-3/+1
| | | | | | | | | | | Remove the maximum stack cleanup size check. With ulimit -s unlimited main thread stack can be very large, but we don't really have a choice other than cleaning all of it. It should be reasonably fast - hwasan cleans large shadow ranges with a single madvise call. This change fixes check-hwasan after ulimit -s unlimited. llvm-svn: 355137
* Revert "Revert "[sanitizers] Restore internal_readlink for x32""H.J. Lu2019-02-282-1/+9
| | | | | | | | | This reverts revision 354601 and disables ReadBinaryNameCached check on Windows since Windows has no working ReadBinaryName. Differential Revision: https://reviews.llvm.org/D58788 llvm-svn: 355129
* [Sanitizer] lit test config: Respect existing parallelism_groupJulian Lettner2019-02-284-4/+8
| | | | llvm-svn: 355128
* [sanitizer] Fix vfork interceptor on i386 w/ dynamic runtime.Evgeniy Stepanov2019-02-281-2/+16
| | | | | | | | PLT calls on i386 expect GOT base address in %ebx. This call does not need to go through PLT strictly speaking, but I'd rather avoid future surprises and implement the most general case. llvm-svn: 355125
* [PGO] Update InstrProfData.inc to sync with llvmRong Xu2019-02-281-0/+2
| | | | llvm-svn: 355119
* [NFC][Sanitizer] Weak linkage is not available on WindowsJulian Lettner2019-02-282-7/+14
| | | | | | | | | | | The concept of weak linkage is not available on Windows. The available workarounds in LLVM/sanitizer runtimes have their own problems. Define a separte symbol ubsan_GetStackTrace to work around the issue now. At lest this way it is painfully obvious that we still have to do more cleanup. Follow-up to revision: https://reviews.llvm.org/D58651 llvm-svn: 355113
* [sanitizer] Got rid of text relocations in i386 vfork interceptor.Evgeniy Stepanov2019-02-281-2/+6
| | | | llvm-svn: 355064
* Add username to TODO comment in sanitizer to satisfy sanitizer lint check. NFCDouglas Yung2019-02-281-1/+1
| | | | llvm-svn: 355062
* [NFC][TSan] Don't define GetStackTrace when compiling for GoJulian Lettner2019-02-281-0/+2
| | | | | | rdar://48455255 llvm-svn: 355053
* [NFC][Sanitizer] Use correct WEAK annotation to make Windows workJulian Lettner2019-02-281-1/+1
| | | | | | | The previous fix didn't work for Windows: https://github.com/llvm/llvm-project/commit/52b751088b11547e0f4ef0589ebbe5e57752c68c llvm-svn: 355052
* [Sanitizer] Attempt to fix linker error on ARM variantsJulian Lettner2019-02-272-11/+14
| | | | | | | Previous commit: https://github.com/llvm/llvm-project/commit/a0884da62a471f08c65a03e337aea23203a43eb8 llvm-svn: 355046
* [compiler-rt] Windows Trace Logging for error reports.Matthew G McGovern2019-02-272-2/+36
| | | | | | | | Adds option for collecting sanitixer dumps via trace logging. - Set log_to_syslog=1 to enable this output. - Consult https://aka.ms/windowstracelogging for details on use. llvm-svn: 355045
* [InstrProf] Use separate comdat group for data and countersReid Kleckner2019-02-271-2/+9
| | | | | | | | | | | | | | | | | | | | | | | Summary: I hadn't realized that instrumentation runs before inlining, so we can't use the function as the comdat group. Doing so can create relocations against discarded sections when references to discarded __profc_ variables are inlined into functions outside the function's comdat group. In the future, perhaps we should consider standardizing the comdat group names that ELF and COFF use. It will save object file size, since __profv_$sym won't appear in the symbol table again. Reviewers: xur, vsk Subscribers: eraman, hiraditya, cfe-commits, #sanitizers, llvm-commits Tags: #clang, #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58737 llvm-svn: 355044
* [sanitizer] Fix compilation errors in r355030.Evgeniy Stepanov2019-02-275-5/+12
| | | | | | | | Disable hwasan interceptor on non-linux, non-x86-or-arm platforms. Add @plt to the asm call that clang intergrated-as infers but gcc does not. llvm-svn: 355041
* [NFC][Sanitizer] Pull up GetStackTrace into sanitizer_commonJulian Lettner2019-02-2713-108/+114
| | | | | | | | | | | | | | | | | | | | We already independently declare GetStackTrace in all (except TSan) sanitizer runtime headers. Lets move it to sanitizer_stacktrace.h to have one canonical way to fill in a BufferedStackFrame. Also enables us to use it in sanitizer_common itself. This patch defines GetStackTrace for TSan and moves the function from ubsan_diag.cc to ubsan_diag_standalone.cc to avoid duplicate symbols for the UBSan-ASan runtime. Other than that this patch just moves the code out of headers and into the correct namespace. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58651 llvm-svn: 355039
* Fixup compilation/test failures after r354960 and r355013.James Y Knight2019-02-271-4/+6
| | | | llvm-svn: 355034
* [hwasan, asan] Intercept vfork.Evgeniy Stepanov2019-02-2723-4/+355
| | | | | | | | | | | | | | | Summary: Intercept vfork on arm, aarch64, i386 and x86_64. Reviewers: pcc, vitalybuka Subscribers: kubamracek, mgorny, javed.absar, krytarowski, kristof.beyls, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58533 llvm-svn: 355030
* [hwasan] Fix tests after .cc->.cpp renaming.Evgeniy Stepanov2019-02-271-2/+2
| | | | llvm-svn: 355028
* [NFC][Sanitizer] Hard-code fast/slow unwinder at call siteJulian Lettner2019-02-2710-25/+47
| | | | | | | | | | | | | Also assert that the caller always gets what it requested. This purely mechanical change simplifies future refactorings and eventual removal of BufferedStackTrace::Unwind. Reviewers: vitalybuka Differential Revision: https://reviews.llvm.org/D58557 llvm-svn: 355022
* [libFuzzer][Windows] Port fork mode to WindowsJonathan Metzman2019-02-277-16/+81
| | | | | | | | | | | | | | | | | | | | | Summary: Port libFuzzer's fork mode to Windows. Implement Windows versions of MkDir, RmDir, and IterateDirRecursive to do this. Don't print error messages under new normal uses of FileSize (on a non-existent file). Implement portable way of piping output to /dev/null. Fix test for Windows and comment fork-sigusr.test on why it won't be ported to Win. Reviewers: zturner Reviewed By: zturner Subscribers: kcc, zturner, jdoerfert, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58513 llvm-svn: 355019
* [Darwin][NFC] Refactor throttling of 64bit sanitizer tests on DarwinJulian Lettner2019-02-278-29/+30
| | | | | | | | | | | | | | | | | | | Underlying condition for throttling is "has large mmap'd regions" (i.e., shadow memory) and not sanitizers in general (e.g., UBSan does not need to be throttled). Rename parallelism group `darwin-64bit-sanitizer` to `shadow-memory` and apply it unconditionally to all tests which require it. We can then have all the Darwin throttling logic in one place in the commen lit config. Throttle sanitizer_common unit tests. Configuration was previously missing from sanitizer_common/Unit/lit.site.cfg. Reviewed by: kubamracek Differential Revision: https://reviews.llvm.org/D58677 llvm-svn: 355018
* Attempt to fix buildbot after r354972 [#1]. NFCI.Alexey Lapshin2019-02-271-2/+6
| | | | llvm-svn: 355013
* [scudo][standalone] Add a standalone vector classKostya Kortchinsky2019-02-275-4/+167
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This CL adds a standalone vector class that will be used by the scoped strings when they land. We reimplement our own vector class because we can't use the std library one. It's mostly borrowed from the current sanitizer_common one, with LLVM code style changes. Additionnally a casing change in a function name that slipped through the previous review (the function isn't used yet). Reviewers: vitalybuka, eugenis, flowerhack, dmmoore415, mcgrathr, morehouse Reviewed By: vitalybuka Subscribers: mgorny, delcypher, #sanitizers, llvm-commits Tags: #llvm, #sanitizers Differential Revision: https://reviews.llvm.org/D58689 llvm-svn: 354999
* hwasan: Rename source files from cc to cppNico Weber2019-02-2712-20/+21
| | | | | | | | | | | | | | | | | | | As discussed elsewhere: LLVM uses cpp as its C++ source extension; the sanitizers should too. This updates files in hwasan. Patch generated by for f in lib/hwasan/*.cc ; do svn mv $f ${f%.cc}.cpp; done followed by for f in lib/hwasan/*.cpp ; do sed -i '' -e '1s/\.cc -/.cpp /' $f; done CMakeLists.txt updated manually. Differential Revision: https://reviews.llvm.org/D58620 llvm-svn: 354989
* [NFC][Sanitizer] Add TODO commentsJulian Lettner2019-02-272-4/+2
| | | | llvm-svn: 354947
* [X86] Add 'znver2' and 'cascadelake' support to __cpu_indicator_init.Craig Topper2019-02-261-6/+20
| | | | | | | | For 'cascadelake' this is adding a 'avx512vnni' feature check to the 0x55 skylake-avx512 model check. These CPUs use the same model number and only differ in the stepping number. But the feature flag is simpler than collecting all the stepping numbers. For 'znver2' this is just syncing with LLVM's Host.cpp. llvm-svn: 354927
OpenPOWER on IntegriCloud