summaryrefslogtreecommitdiff
path: root/lib/dfsan
AgeCommit message (Collapse)Author
2015-02-18Remove support for building sanitizers from Makefile/autoconf build on Linux.Alexey Samsonov
This is a re-application of r229554 restricted to Linux build only. Apple still uses Makefile/autoconf to build Clang and sanitizers. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229756 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17Revert "Remove support for building sanitizers from Makefile/autoconf build."Matthias Braun
This reverts commit r229556. Reverting this for now as internal apple builds rely on this functionality. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229585 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-17Remove support for building sanitizers from Makefile/autoconf build.Alexey Samsonov
They autotools build has a number of missing features, supports less OS, architectures, build configurations, doesn't have any tests and is hard to support in sync with CMake build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@229556 91177308-0d34-0410-b5e6-96231b3b80d8
2015-02-12[Sanitizer] Change InitializeFlags() signatures. NFC.Alexey Samsonov
These functions are always used to initialize singleton flags(), as well as other global data (common_flags()). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@228894 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-30[Sanitizers] Introduce GET_LINK_MAP_BY_DLOPEN_HANDLE() macroViktor Kutuzov
Differential Revision: http://reviews.llvm.org/D7233 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@227570 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-19[dfsan] Use append_no_rtti_flag instead of manually specifying -fno-rtti.Evgeniy Stepanov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226435 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-15[sanitizer] Flag parser rewrite.Evgeniy Stepanov
The new parser is a lot stricter about syntax, reports unrecognized flags, and will make it easier to implemented some of the planned features. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@226169 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-12[dfsan] Export dfsan_get_label_info function with C linkage.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225692 91177308-0d34-0410-b5e6-96231b3b80d8
2015-01-07[Sanitizer] Change the runtime flag representation.Alexey Samsonov
This mirrors r225239 to all the rest sanitizers: ASan, DFSan, LSan, MSan, TSan, UBSan. Now the runtime flag type, name, default value and description is located in the single place in the .inc file. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@225327 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-05[DFSAN][MIPS] adding support of DFSAN for MIPS64Peter Collingbourne
Minor changes to enable DFSAN on MIPS64 Patch by Kumar Sukhani! Differential Revision: http://reviews.llvm.org/D6437 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@223517 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-20[DFSan] Add flag to dump the labels when the program terminates.Lorenzo Martignoni
Differential Revision: http://reviews.llvm.org/D6306 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@222425 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-13Fix -Wcast-qual warnings in sanitizersAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221936 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05[dfsan] Add runtime function for aborting on indirect calls toPeter Collingbourne
uninstrumented vararg functions. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221364 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05[dfsan] Add libgo functions to ABI list.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221363 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05[dfsan] Upgrade ABI list to Ubuntu 14.04.Peter Collingbourne
This incorporates some of the newer functions used by (e.g.) the Go runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221362 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-05[dfsan] Modify build-libc-list.py to filter out local functions in generatedPeter Collingbourne
ABI list. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@221361 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-30Update __dfsw_s{,n}printf custom functions for new calling convention.Peter Collingbourne
Differential Revision: http://reviews.llvm.org/D6029 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@220907 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-15[compiler-rt] compiler-rt's CMake append_if function clashes with LLVM's, ↵Kuba Brecka
let's rename it to append_list_if Doing s/append_if/append_list_if/, no functional change. http://reviews.llvm.org/D5739 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219860 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-08Remove bashisms and switch to /bin/shEd Maste
On a default FreeBSD install Bash is not installed and fdescfs is not mounted. Use plain sh functionality instead. Differential Revision: http://reviews.llvm.org/D5631 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219333 91177308-0d34-0410-b5e6-96231b3b80d8
2014-10-08Custom wrappers for DFSanitizing sprintf & snprintf.Lorenzo Martignoni
Differential Revision: http://reviews.llvm.org/D5561 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@219293 91177308-0d34-0410-b5e6-96231b3b80d8
2014-08-19DFSan's set label function should avoid writing to the shadow memory when ↵Peter Collingbourne
the write would not change the value in memory. When writing a label to shadow memory, don't write if the value is already set to the value being written. This dramatically reduces real memory consumption in programs with sparse use of labels. Test Plan: It would be nice to test that unnecessary writes are skipped, but I do not see how a unit test could do this. Patch by Sam Kerner! Differential Revision: http://reviews.llvm.org/D4894 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@215961 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-26[DFSan] Fixup for r213980Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213997 91177308-0d34-0410-b5e6-96231b3b80d8
2014-07-25[Sanitizer] Introduce SANITIZER_CAN_USE_PREINIT_ARRAY definition and use it ↵Alexey Samsonov
across sanitizers. Get rid of ASAN_USE_PREINIT_ARRAY and LSAN_USE_PREINIT_ARRAY - just always use .preinit_array if it's available. This mode seems stable enough, and we've been relying on default values of these macro for a long time. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@213980 91177308-0d34-0410-b5e6-96231b3b80d8
2014-06-04[dfsan] Fix the declaration of dfsan_add_label.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@210202 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-30The newest versions of CMake require outputs of custom commands be inChandler Carruth
DEPENDS rather than SOURCES. The SOURCES just end up looking on the filesystem and not finding anything. Makes for very hard to debug build errors. =/ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207722 91177308-0d34-0410-b5e6-96231b3b80d8
2014-04-24Add user-defined callback on write() calls.Peter Collingbourne
Add dfsan_set_write_callback(), which sets a callback to be invoked when a write() call is invoked within DFSan instrumented code. Patch by Sam Kerner! Differential Revision: http://reviews.llvm.org/D3268 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@207131 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-31[CMake] Rename add_compiler_rt_static_runtime to add_compiler_rt_runtime.Alexey Samsonov
Soon there will be an option to build compiler-rt parts as shared libraries on Linux. Extracted from http://llvm-reviews.chandlerc.com/D3042 by Yuri Gribov. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@205183 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-26Add function to get the number of DFSan labels allocated.Peter Collingbourne
Expose the number of DFSan labels allocated by adding function dfsan_get_label_count(). Patch by Sam Kerner! Differential Revision: http://llvm-reviews.chandlerc.com/D3109 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204854 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-20[libsanitizer] Introduce flag descriptions.Alexander Potapenko
Extend ParseFlag to accept the |description| parameter, add dummy values for all existing flags. As the flags are parsed their descriptions are stored in a global linked list. The tool can later call __sanitizer::PrintFlagDescriptions() to dump all the flag names and their descriptions. Add the 'help' flag and make ASan, TSan and MSan print the flags if 'help' is set to 1. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@204339 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-13[CMake] Make append_if semantics similar to those used in LLVMAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@203773 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-25Update sanitizers' bash scripts.Alexey Samsonov
* Fix bash scripts to work on FreeBSD (patch by Viktor Kutuzov) * Update locations of lit tests in check_lint script. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@202145 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Rename several variablesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201575 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Add top-level target for each compiler-rt library, and add ↵Alexey Samsonov
'compiler-rt' target encompassing them all. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201556 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-18[CMake] Check for -fPIE and -ffreestanding flags for consistencyAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201549 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14Move DFSan test suite under test/Alexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201403 91177308-0d34-0410-b5e6-96231b3b80d8
2014-02-14Move shared configs for lit test suites to test/ and unittests/ directoriesAlexey Samsonov
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@201399 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-24Don't create check-ubsan and check-dfsan commands if they are not supported ↵Alexey Samsonov
on this platform git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@199979 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-19Fix -Werror compilation.Evgeniy Stepanov
It was broken in r197601. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197665 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-18[DFSan] New custom wrappersLorenzo Martignoni
Added the following custom wrappers: strstr strrchr memchr nanosleep socketpair Tweaked a couple of existing wrappers: if a wrapper returns a pointers derived from an input pointer, then return the label of the input pointer Sorted tests invocation Differential Revision: D2354 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@197601 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04[DFSan] Extend the ABI list to discard new glibc functionsLorenzo Martignoni
Differential Revision: http://llvm-reviews.chandlerc.com/D2291 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196389 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-04[DFSan] Change the way labels are propagated when comparing memory through ↵Lorenzo Martignoni
libc functions. Differential Revision: http://llvm-reviews.chandlerc.com/D2252 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@196388 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-27Added missing lib/dfsan/scripts/check_custom_wrappers.shLorenzo Martignoni
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195838 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-26Implement a bunch of custom glibc wrappers & corresponding testsLorenzo Martignoni
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195749 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-25build-libc-list.py: Replace --{,usr,gcc}lib with flags for specific libraries.Peter Collingbourne
This should allow us to cope with newer versions of GCC (and more esoteric directory layouts). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195695 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-21Revert r195381, "Implement a bunch of custom glibc wrappers & corresponding ↵Peter Collingbourne
tests." It broke a buildbot. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195392 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-21Implement a bunch of custom glibc wrappers & corresponding tests.Peter Collingbourne
- Introduce several new custom glibc wrappers - Implement some of the not yet implemented wrappers - Refactor and extend the tests - Add script to make sure all declare custom glibc wrappers are implemented & tested. Patch by Lorenzo Martignoni! Differential Revision: http://llvm-reviews.chandlerc.com/D2234 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195381 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19[dfsan] Tweaks for the ABI listPeter Collingbourne
- Add a bunch of glibc functions to the ABI list - Group similar functions in the ABI Patch by Lorenzo Martignoni! Differential Revision: http://llvm-reviews.chandlerc.com/D2185 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@195110 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-17[DFSan] Don't include public headers in dfsan runtime codeAlexey Samsonov
Summary: Definitions we use in public sanitizer headers may slightly conflict with the ones we use in private sanitizer runtimes. Moreover, we generally forbid to include any system headers (like <stdint.h>) in sanitizer runtime headers. This leads to inevitable duplication of selected interface function declarations, but we decided to live with it. Reviewers: pcc Reviewed By: pcc CC: kcc, llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2179 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194955 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-13[dfsan] Add a few easy functions to the ABI list.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190653 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-10[dfsan] Initial set of DFSAN_OPTIONS flags.Peter Collingbourne
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190379 91177308-0d34-0410-b5e6-96231b3b80d8