summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2016-01-14[LSan] Use __tls_get_addr interceptor to keep track of dynamic TLS.Alexey Samsonov
Summary: We have a way to keep track of allocated DTLS segments: let's use it in LSan. Although this code is fragile and relies on glibc implementation details, in some cases it proves to be better than existing way of tracking DTLS in LSan: marking as "reachable" all memory chunks allocated directly by "ld". The plan is to eventually get rid of the latter, once we are sure it's safe to remove. Reviewers: kcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16164 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257785 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14Fix the cross compilation of unit tests. NFC (second attempt)Sumanth Gundapaneni
With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compiling environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision: http://reviews.llvm.org/D16165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257783 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[Coverage] add test cases for coverage testingXinliang David Li
1. One test covering coverage-mapping interfaction with linker GC 2. one test covering coverage-mapping with shared libaries git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257782 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[tsan] Introduce a "ignore_interceptors_accesses" optionKuba Brecka
On OS X, TSan already passes all unit and lit tests, but for real-world applications (even very simple ones), we currently produce a lot of false positive reports about data races. This makes TSan useless at this point, because the noise dominates real bugs. This introduces a runtime flag, "ignore_interceptors_accesses", off by default, which makes TSan ignore all memory accesses that happen from interceptors. This will significantly lower the coverage and miss a lot of bugs, but it eliminates most of the current false positives on OS X. Differential Revision: http://reviews.llvm.org/D15189 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257760 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[tsan] Fix the value of PTHREAD_MUTEX_RECURSIVE for OS X and FreeBSDKuba Brecka
The value of the constant PTHREAD_MUTEX_RECURSIVE is not "1" on FreeBSD and OS X. Differential Revision: http://reviews.llvm.org/D16075 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257758 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14sync up with master fileXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257746 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-14[Sanitizer] Pass proper values to DTLS_on_libc_memalign.Alexey Samsonov
Fix a surprising typo: the old code used to think that dynamic TLS segments were several times larger than they actually are. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13Revert r257686 "With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross ↵Hans Wennborg
compiling" This broke the build. For example, from http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/1191/steps/cmake%20stage%201/logs/stdio: -- Compiler-RT supported architectures: aarch64 CMake Error at projects/compiler-rt/cmake/Modules/AddCompilerRT.cmake:170 (string): string sub-command REPLACE requires at least four arguments. Call Stack (most recent call first): projects/compiler-rt/lib/CMakeLists.txt:4 (include) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257694 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13With COMPILER_RT_INCLUDE_TESTS turned ON and in a cross compilingSumanth Gundapaneni
environment, the unit tests fail to link. This patch does the following changes >Rename COMPILER_RT_TEST_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS to reflect the way it's used. >Add COMPILER_RT_TEST_COMPILER_CFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to build/compile the unit tests >Add COMPILER_RT_UNITTEST_LINKFLAGS to COMPILER_RT_UNITTEST_CFLAGS so that cross-compiler would be able to link the unit tests (if needed) Differential Revision:http://reviews.llvm.org/D15082 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257686 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13[WebAssembly] Enable the builtins library for WebAssembly.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257619 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13[WebAssembly] clang supports int128_t on wasm32 in addition to wasm64.Dan Gohman
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257618 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-13tsan: check errors in testDmitry Vyukov
Somebody reported flakiness of this test. Let's start by checking errors. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257585 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12[CMake] Adding experimental support for tvOS and watchOSChris Bieneman
Summary: * Refactored the iOS config-ix.cmake code to be a more compact loop over supported embedded platforms. * Added watchOS and tvOS as experimental platforms, they don't currently build so they are disabled by default Reviewers: zaks.anna, kubabrecka, samsonov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D16119 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257544 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12[compiler-rt] [msan] Remove stable-runtime requirement for insertvalue_origin.ccAdhemerval Zanella
This patch removes the requirement on stable-runtime on insertvalue_origin.cc testcase, added due a instrumentation failure on aarch64-linux. This is fixed on llvm code by r257375. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12[PGO] Add Linux specific test cases for profile runtimeXinliang David Li
(second try with more strict config check) Currently, only gc-sections related tests are added. Gold linker currently is required due to PR19161 of bfd linker. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12 Revert r257444 : arm build bots failureXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12[PGO] Add Linux specific test cases for profile runtimeXinliang David Li
Currently, only gc-sections related tests are added. Gold linker currently is required due to PR19161 of bfd linker. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257444 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12Fix comment of testXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257443 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-12[libFuzzer] extend the weak memcmp/strcmp/strncmp interceptors to receive ↵Kostya Serebryany
the result of the computations. With that, don't do any mutations if memcmp/etc returned 0 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257423 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[cfi] Fix __cfi_slowpath and __cfi_check signature.Evgeniy Stepanov
The first argument is uint64_t, not uintptr_t. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257233 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Fix typo in commentXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[PGO] Add runtime hook so that IR instrumentation can override versionXinliang David Li
IR level instrumentation needs to override version with variant bits. No change for FE instrumentation is needed. Test case is added to detect version mismatch. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[PGO] Introducing version mask macro/NFC (sync)Xinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[tsan] don't crash on closedir(0)Kostya Serebryany
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Fix CMake warning in CFI tests.Evgeniy Stepanov
CFI tests do not require the CFI runtime library on Windows. Do not add "cfi" as a dependency of "check-cfi" in that case. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Revert "Fix CMake warning in CFI tests."Evgeniy Stepanov
This is a bit more complex than that. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Fix CMake warning in CFI tests.Evgeniy Stepanov
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
2016-01-08Sync up InstrProfData.incXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Make ubsan suppression test pass on Windows.Nico Weber
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Use more strict checks for merge Profile resultsXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257151 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[PGO] Use new macro introduced/NFCXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257147 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[PGO] Update test to match sorted outputXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257146 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08profile: Do not pass -fPIC on Windows.Peter Collingbourne
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
2016-01-08[profile] Add comments to portability macros for readability (NFC)Vedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257126 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08Sync up InstrProfData.incXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257124 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-08[cmake] Indentation fix (NFC)Vedant Kumar
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257118 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-07[cmake] Add InstrProfilingWriter to libclang_rt on DarwinVedant Kumar
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
2016-01-07Sync up InstrProfData.inc fileXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257109 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-07Ensure safestack overflow test doesn't segfaultDimitry Andric
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
2016-01-07Follow-up fix for r256988 to unbreak the Linux buildbot.Kuba Brecka
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@257042 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06[compiler-rt] On Darwin, link all frameworks with -fapplication-extensionAnna Zaks
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
2016-01-06[sanitizers] Log all output to CrashReport on OS XAnna Zaks
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
2016-01-06[compiler-rt] Fix empty translation unit warningNathan Slingerland
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
2016-01-05[PGO] Enable building compiler-rt profile support library on WindowsNathan Slingerland
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
2016-01-05[sancov] adding internal functionMike Aizatsky
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256806 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05[sancov] coverage pc bufferMike Aizatsky
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
2016-01-04[PGO] Sync up template file with masterXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256722 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-03[PGO] Sync up template file with masterXinliang David Li
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@256711 91177308-0d34-0410-b5e6-96231b3b80d8
2015-12-30[PGO]: Eliminate custom typedefs in the FreeBSD case Xinliang David Li
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
2015-12-29[PGO]: Refactor VP data writerXinliang David Li
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