summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix CMake warning in CFI tests.Evgeniy Stepanov2016-01-081-1/+1
| | | | | | | | | Fix incorrect condition for enabling the CFI tests. This removes the following CMake warnings on Windows: The dependency target "cfi" of target "check-all" does not exist. The dependency target "cfi" of target "check-cfi-and-supported" does not exist. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257199 91177308-0d34-0410-b5e6-96231b3b80d8
* Sync up InstrProfData.incXinliang David Li2016-01-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257195 91177308-0d34-0410-b5e6-96231b3b80d8
* Make ubsan suppression test pass on Windows.Nico Weber2016-01-081-13/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257183 91177308-0d34-0410-b5e6-96231b3b80d8
* Use more strict checks for merge Profile resultsXinliang David Li2016-01-081-30/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257151 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Use new macro introduced/NFCXinliang David Li2016-01-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257147 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Update test to match sorted outputXinliang David Li2016-01-081-66/+67
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257146 91177308-0d34-0410-b5e6-96231b3b80d8
* profile: Do not pass -fPIC on Windows.Peter Collingbourne2016-01-081-3/+0
| | | | | | Unbreaks clang-cl build (cl warns on this flag, clang-cl errors on it). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257136 91177308-0d34-0410-b5e6-96231b3b80d8
* [profile] Add comments to portability macros for readability (NFC)Vedant Kumar2016-01-081-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257126 91177308-0d34-0410-b5e6-96231b3b80d8
* Sync up InstrProfData.incXinliang David Li2016-01-081-20/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257124 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Indentation fix (NFC)Vedant Kumar2016-01-081-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257118 91177308-0d34-0410-b5e6-96231b3b80d8
* [cmake] Add InstrProfilingWriter to libclang_rt on DarwinVedant Kumar2016-01-071-1/+2
| | | | | | | | | llvmBufferWriter and a few related symbols were missing from libclang_rt on Darwin (PR26002). This should fix the problem. Patch by Dan Peebles! git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257110 91177308-0d34-0410-b5e6-96231b3b80d8
* Sync up InstrProfData.inc fileXinliang David Li2016-01-071-7/+12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257109 91177308-0d34-0410-b5e6-96231b3b80d8
* Ensure safestack overflow test doesn't segfaultDimitry Andric2016-01-071-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In rL255491, the safestack overflow test was disabled for aarch64, since it "is currently failing on an AArch64 buildbot with a segfault, but it is currently passing on other configuration". While testing on FreeBSD on x86, I also encountered a segfault. This is because the `fct()` function actually writes before and after `buffer`, and on FreeBSD this crashes because `buffer` is usually allocated at the end of a page. That this runs correctly on Linux is probably just by accident. I propose to fix this by adding a pre and post buffer, to act as a safety zone. The pre and post buffers must be accessed in an 'unsafe' way, otherwise -fsanitize=safestack will allocate them on the safe stack, and they will not bookend `buffer` itself. Therefore, I create them large enough for `fct()`, and call it on both of them. On FreeBSD, this makes the test run as expected, without segfaulting, and I suppose this will also fix the segfault on AArch64. I do not have AArch64 testing capabilities, so if someone could try that out, I would be much obliged. Reviewers: pcc, kcc, zatrazz Subscribers: llvm-commits, aemerson, emaste Differential Revision: http://reviews.llvm.org/D15725 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257106 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow-up fix for r256988 to unbreak the Linux buildbot.Kuba Brecka2016-01-071-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257042 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] On Darwin, link all frameworks with -fapplication-extensionAnna Zaks2016-01-061-0/+5
| | | | | | | | | | | | The ASan dylib as well as other compiler-rt dylibs work with app extensions, so we should add -fapplication-extension to the link line when building them. This will avoid linker warnings when using the dylibs in app extensions. (APIs unavailable to app extensions are listed here: https://developer.apple.com/library/ios/documentation/General/Conceptual/ExtensibilityPG/ExtensionOverview.html#//apple_ref/doc/uid/TP40014214-CH2-SW6) Differential Revision: http://reviews.llvm.org/D15550 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256989 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizers] Log all output to CrashReport on OS XAnna Zaks2016-01-067-17/+25
| | | | | | | | | | | Log all of sanitizers' output (not just ASan bug reports) to CrashReport, which simplifies diagnosing failed checks as well as other errors. This also allows to strip the color sequences early from the printed buffer, which is more efficient than what we had perviously. Differential Revision: http://reviews.llvm.org/D15396 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256988 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] Fix empty translation unit warningNathan Slingerland2016-01-061-2/+5
| | | | | | Change to not compile in WindowsMMap.c on anything except WIN32. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256947 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Enable building compiler-rt profile support library on WindowsNathan Slingerland2016-01-056-2/+206
| | | | | | | | | | | | Summary: This change configures Windows builds to build the complier-rt profile support library (clang_rt.profile-i386.lib). Windows API incompatibilities in the compiler-rt profile lib are also fixed. Reviewers: davidxl, dnovillo Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D15830 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256848 91177308-0d34-0410-b5e6-96231b3b80d8
* [sancov] adding internal functionMike Aizatsky2016-01-051-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256806 91177308-0d34-0410-b5e6-96231b3b80d8
* [sancov] coverage pc bufferMike Aizatsky2016-01-054-0/+77
| | | | | | Differential Revision: http://reviews.llvm.org/D15871 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256804 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Sync up template file with masterXinliang David Li2016-01-041-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256722 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Sync up template file with masterXinliang David Li2016-01-031-0/+19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256711 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO]: Eliminate custom typedefs in the FreeBSD case Xinliang David Li2015-12-301-18/+4
| | | | | | | | | | | Patch by: Sean Bruno Use o/s provided sys/types.h to bring in Profiling types. Differential Revision: http://reviews.llvm.org/D15088 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256647 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO]: Refactor VP data writerXinliang David Li2015-12-294-48/+252
| | | | | | | | | | | Extract the buffered filer writer code used by value profile writer and turn it into common/sharable buffered fileIO interfaces. Added a test case for the buffered file writer and rewrite the VP dumping using the new APIs. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256604 91177308-0d34-0410-b5e6-96231b3b80d8
* For the asan_symbolize.py script, use addr2line as the default systemDimitry Andric2015-12-291-1/+1
| | | | | | | | symbolizer on FreeBSD too. This allows the asan-symbolize-bad-path.cc test to succeed. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256578 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO]: Do not update Data->Value field during profile write.Xinliang David Li2015-12-296-118/+150
| | | | | | | | | | | The profile reader no longer depends on this field to be updated and point to owning func's vp data. The VP data also no longer needs to be allocated in a contiguous memory space. Differential Revision: http://reviews.llvm.org/D15258 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256543 91177308-0d34-0410-b5e6-96231b3b80d8
* Add more testing checksXinliang David Li2015-12-291-0/+43
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256538 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Make the test case more robustXinliang David Li2015-12-291-10/+21
| | | | | | | | | Make the testing results not depending on function output order. This allows more strict result check. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256537 91177308-0d34-0410-b5e6-96231b3b80d8
* Check test results more strictly (NFC)Xinliang David Li2015-12-291-6/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256536 91177308-0d34-0410-b5e6-96231b3b80d8
* [power] Fix test case target checksBill Seurer2015-12-241-1/+1
| | | | | | | | | Several test cases that used to fail on both power LE and BE now run correctly on LE. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256391 91177308-0d34-0410-b5e6-96231b3b80d8
* XFAIL ubsan suppressions.cpp test on Windows for now.Nico Weber2015-12-231-0/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256307 91177308-0d34-0410-b5e6-96231b3b80d8
* [cfi] Fix handling of uninstrumented libraries.Evgeniy Stepanov2015-12-222-1/+6
| | | | | | CFI shadow for non-CFI libraries should be "unchecked", not "invalid". git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256285 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Move buffer write callback to a common fileXinliang David Li2015-12-223-19/+21
| | | | | | | | This is a NFC refactoring enabling code sharing by file writer. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256264 91177308-0d34-0410-b5e6-96231b3b80d8
* fix a gcc warningNico Weber2015-12-222-2/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256256 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Add mincore test.Evgeniy Stepanov2015-12-211-0/+34
| | | | | | | ASan does not really do anything interesting with mincore, but this test verifies that the function still works correctly. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256207 91177308-0d34-0410-b5e6-96231b3b80d8
* [compiler-rt] [tsan] Add support for PIE build on AArch64Adhemerval Zanella2015-12-213-6/+68
| | | | | | | | | | | | | | | | | | | | This patch adds PIE executable support for aarch64-linux. It adds two more segments: - 0x05500000000-0x05600000000: 39-bits PIE program segments - 0x2aa00000000-0x2ab00000000: 42-bits PIE program segments Fortunately it is possible to use the same transformation formula for the new segments range with some adjustments in shadow to memory formula (it adds a constant offset based on the VMA size). A simple testcase is also added, however it is disabled on x86 due the fact it might fail on newer kernels [1]. [1] https://git.kernel.org/linus/d1fd836dcf00d2028c700c7e44d2c23404062c90 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256184 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix fopen interceptor to not crash if path is NULLKostya Serebryany2015-12-212-1/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256182 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] testing _WIN64 instead of _WIN32Xinliang David Li2015-12-201-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256129 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Implement BOOL_CMPXCHG for WindowsXinliang David Li2015-12-201-0/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256128 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] Fix build failure with MSVCXinliang David Li2015-12-191-10/+8
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256103 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBSan] Implement runtime suppressions (PR25066).Alexey Samsonov2015-12-186-51/+151
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Add the ability to suppress UBSan reports for files/functions/modules at runtime. The user can now pass UBSAN_OPTIONS=suppressions=supp.txt with the contents of the form: signed-integer-overflow:file-with-known-overflow.cpp alignment:function_doing_unaligned_access vptr:shared_object_with_vptr_failures.so Suppression categories match the arguments passed to -fsanitize= flag (although, see below). There is no overhead if suppressions are not provided. Otherwise there is extra overhead for symbolization. Limitations: 1) sometimes suppressions need debug info / symbol table to function properly (although sometimes frontend generates enough info to do the match). 2) it's only possible to suppress recoverable UB kinds - if you've built the code with -fno-sanitize-recover=undefined, suppressions will not work. 3) categories are fine-grained check kinds, not groups like "undefined" or "integer", so you can't write "undefined:file_with_ub.cc". Reviewers: rsmith, kcc Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D15363 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256018 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r255996 ("[tsan] Add a DCHECK to verify __tsan_read* and __tsan_write ↵Kuba Brecka2015-12-183-46/+62
| | | | | | | | | | function aren't called from ScopedInterceptor"). There are some test failures on the Linux buildbots. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255997 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Add a DCHECK to verify __tsan_read* and __tsan_write function aren't ↵Kuba Brecka2015-12-183-62/+46
| | | | | | | | | | | | called from ScopedInterceptor Interceptors using ScopedInteceptor should never call into user's code before the ScopedInterceptor is out of scope (and its destructor is called). Let's add a DCHECK to enforce that. Differential Revision: http://reviews.llvm.org/D15381 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255996 91177308-0d34-0410-b5e6-96231b3b80d8
* [tsan] Fix scoping of ScopedInteceptor in libdispatch supportKuba Brecka2015-12-183-0/+36
| | | | | | | | | | Some interceptors in tsan_libdispatch_mac.cc currently wrongly use TSAN_SCOPED_INTERCEPTOR/ScopedInterceptor. Its constructor can start ignoring memory accesses, and the destructor the stops this -- however, e.g. dispatch_sync can call user's code, so the ignoring will extend to user's code as well. This is not expected and we should only limit the scope of ScopedInterceptor to TSan code. This patch introduces annotations that mark the beginning and ending of a callback into user's code. Differential Revision: http://reviews.llvm.org/D15419 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255995 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in MSC pathXinliang David Li2015-12-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255938 91177308-0d34-0410-b5e6-96231b3b80d8
* [PGO] cleanup: unify prefix for portability macrosXinliang David Li2015-12-1612-80/+83
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255748 91177308-0d34-0410-b5e6-96231b3b80d8
* [cfi] Exclude ubsan runtime library from non-diag CFI builds.Evgeniy Stepanov2015-12-162-3/+21
| | | | | | | Split the CFI runtime in two: cfi and cfi_diag. The latter includes UBSan runtime to allow printing diagnostics. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255735 91177308-0d34-0410-b5e6-96231b3b80d8
* [cfi] Fix GCC build.Evgeniy Stepanov2015-12-161-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255733 91177308-0d34-0410-b5e6-96231b3b80d8
* [cfi] Limit cross-dso tests to Linux.Evgeniy Stepanov2015-12-161-0/+9
| | | | | | Mac is missing the driver support to link the CFI runtime library. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255730 91177308-0d34-0410-b5e6-96231b3b80d8
* [cfi] Fix shadow sanity check.Evgeniy Stepanov2015-12-161-4/+5
| | | | | | | The current check may break if the starting address in fill_shadow is not page-aligned. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@255725 91177308-0d34-0410-b5e6-96231b3b80d8