summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
* [compiler-rt] Add support for relative offset adjustment in interceptionEtienne Bergeron2016-07-211-9/+32
| | | | | | | | | | | | | | | | | Summary: Some instructions can only be copied if the relative offset is adjusted. This patch adds support for two common instruction. It's quite common to have a indirect load in the prologue (loading the security cookie). Reviewers: rnk Subscribers: llvm-commits, wang0109, chrisha Differential Revision: https://reviews.llvm.org/D22647 llvm-svn: 276336
* Enable cross-compilation across architectures on androidFrancis Ricci2016-07-211-1/+1
| | | | | | | | | | | | | | | Summary: This patch fixes cross-architecture compilation, by allowing flags like -target and --sysroot to be set for architecture testing and compilation. Reviewers: tberghammer, srhines, danalbert, beanz, compnerd Subscribers: tberghammer, llvm-commits, danalbert Differential Revision: https://reviews.llvm.org/D22415 llvm-svn: 276333
* [asan] Fix Win64 test portability issuesReid Kleckner2016-07-214-5/+6
| | | | | | | | | | | | | The OOM test should really only run on 32-bits, since it's hard to OOM on x64. The operator_array_new_with_dtor_left_oob tests need to account for the larger array cookie on x64 (8 bytes instead of 4). Use -std=c++14 in use-after-scope-capture.cc to avoid errors in the MSVC 2015 STL on Windows. The default there is C++14 anyway. llvm-svn: 276332
* Disable thread safe statics in clang-cl, they call the CRTReid Kleckner2016-07-212-2/+2
| | | | | | Also remove the needless static that was using them. llvm-svn: 276327
* Fix unsymbolize unittest. Adding win64 address.Etienne Bergeron2016-07-211-2/+2
| | | | llvm-svn: 276326
* [compiler-rt] Fix interception of memcpy/memmove on win64Etienne Bergeron2016-07-213-10/+8
| | | | | | | | | | | | | | Summary: This patch is fixing running interception unittests for memcpy/memmove on windows 64. Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: https://reviews.llvm.org/D22641 llvm-svn: 276324
* [sanitizer] allocator: remove kPopulateSize and only use ↵Kostya Serebryany2016-07-215-24/+28
| | | | | | SizeClassMap::MaxCached; ensure that TransferBatch size is a power of two, refactor TransferBatch creation/destruction into separate functions. llvm-svn: 276318
* Fix clang-cl warning and crash in sanitizersReid Kleckner2016-07-212-5/+6
| | | | | | | | | | Make kStderrFd a macro to avoid dynamic initialization of the report_file global. This actually causes a crash at runtime, because ASan initializes before static initializers run. Remove an unused variable in asan_win.cc. llvm-svn: 276314
* fix https://reviews.llvm.org/D22610Etienne Bergeron2016-07-212-1/+4
| | | | | | AppleClang can't compile the assignment expression. llvm-svn: 276311
* [compiler-rt] Fix memmove/memcpy overlap detection on windowsEtienne Bergeron2016-07-212-3/+6
| | | | | | | | | | | | | | | | | | | | Summary: The memcpy and memmove functions are the same on windows. The overlap detection logic is incorrect. printf-1 test: ``` stdin>:2:114: note: possible intended match here ==877412==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x0000002bf2a8,0x0000002bf2ad) and [0x0000002bf2a9, 0x0000002bf2ae) overlap ``` ^ Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: https://reviews.llvm.org/D22610 llvm-svn: 276299
* [compiler-rt] Disable some unittests on windows that rely on shell commandEtienne Bergeron2016-07-214-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: These unittests are not running on windows because they are using incorrect commands. They were not failing on 32-bits because there is a requirement: asan-64-bits. ``` $ "nm" "C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output\no_asan_gen_globals.c.tmp.exe" # command stderr: 'nm': command not found error: command failed with exit status: 127 ``` ``` $ "rm" "-rf" "C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output/coverage-tracing" $ "mkdir" "C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output/coverage-tracing" $ "A=x" # command stderr: 'A=x': command not found error: command failed with exit status: 127 ``` ``` $ "DIR=C:\src\llvm\ninja64\projects\compiler-rt\test\asan\X86_64WindowsConfig\TestCases\Output/coverage-order-pcs" # command stderr: 'DIR=C:\\src\\llvm\\ninja64\\projects\\compiler-rt\\test\\asan\\X86_64WindowsConfig\\TestCases\\Output/coverage-order-pcs': command not found error: command failed with exit status: 127 ``` Reviewers: rnk Subscribers: tberghammer, llvm-commits, danalbert, wang0109, srhines, kubabrecka, chrisha Differential Revision: https://reviews.llvm.org/D22612 llvm-svn: 276290
* [compiler-rt] Fix broken unittest on win64Etienne Bergeron2016-07-212-5/+17
| | | | | | | | | | | | | | | | | | | Summary: This is an other tentative to fix: https://reviews.llvm.org/D22588 It's less clever, but should work. Turn out there is not an easy way to write a portable print for a pointer in lowercase without the prefix 0x. Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: https://reviews.llvm.org/D22606 llvm-svn: 276286
* Revert r276256 - Attempt to fix clang-cmake-mips after r268977.Daniel Sanders2016-07-211-6/+0
| | | | | | It didn't fix the problem on the buildbot. CAN_TARGET_mips64 is still true. llvm-svn: 276258
* Attempt to fix clang-cmake-mips after r268977.Daniel Sanders2016-07-211-0/+6
| | | | | | | | I think it's wiped out the build area and fully-reconfigured for the first time since r268977. This seems to have caused Mips64 to become enabled when it wasn't before because compiling with -mabi=64 succeeds but linking with -mabi=64 fails. llvm-svn: 276256
* Default XRay building to OFF to let build bots that do not support building ↵Dean Michael Berris2016-07-211-1/+3
| | | | | | sanitizers to disable explicitly too llvm-svn: 276255
* [compiler-rt][XRay] re-submitting r276117, with fixes for build breakage due ↵Dean Michael Berris2016-07-2113-2/+647
| | | | | | | | | | | | | | | | | | | | | | | to extraneous and missing dependencies and attempts to build on unsupported OSes Summary: This is a fixed-up version of D21612, to address failure identified post-commit. Original commit description: This patch implements the initialisation and patching routines for the XRay runtime, along with the necessary trampolines for function entry/exit handling. For now we only define the basic hooks for allowing an implementation to define a handler that gets run on function entry/exit. We expose a minimal API for controlling the behaviour of the runtime (patching, cleanup, and setting the handler to invoke when instrumenting). Fixes include: - Gating XRay build to only Linux x86_64 and with the right dependencies in case it is the only library being built - Including <cstddef> to fix std::size_t issue Reviewers: kcc, rnk, echristo Subscribers: mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D22611 llvm-svn: 276251
* [Profile] bug fix: profile dir not recursively createdXinliang David Li2016-07-211-2/+6
| | | | llvm-svn: 276234
* [Profile] Add new test to cover %m specifier with shared library (instrumented)Xinliang David Li2016-07-211-0/+16
| | | | llvm-svn: 276229
* [compiler-rt] Fix broken SymInitialize unittestEtienne Bergeron2016-07-212-2/+4
| | | | | | | | | | | | | | | | Summary: By adding the initialisation of the symbolisation library (DbgHelp) we are swapping the order in which both warnings are produced. We can't use CHECK-NEXT as the dbghelp warning is multiline. Reviewers: rnk Subscribers: kubabrecka, llvm-commits, wang0109, chrisha Differential Revision: https://reviews.llvm.org/D22586 llvm-svn: 276228
* [Profile] More test clean up to read profile from directory specified by ↵Xinliang David Li2016-07-212-4/+6
| | | | | | -fprofile-generate= llvm-svn: 276226
* [Profile] Cleanup test to use new dir input featureXinliang David Li2016-07-211-8/+7
| | | | llvm-svn: 276225
* Sync up with llvm copy /NFCXinliang David Li2016-07-201-2/+2
| | | | llvm-svn: 276198
* [sanitizers] split sanitizer_allocator.h into a number of smaller .h files; NFCKostya Serebryany2016-07-2011-1437/+1587
| | | | llvm-svn: 276195
* revert rL276179: [compiler-rt] Fix broken unittest related to 64-bit print ↵Etienne Bergeron2016-07-202-6/+5
| | | | | | format llvm-svn: 276187
* Revert r276117 "[XRay] Basic initialization and flag definition for XRay ↵Hans Wennborg2016-07-2012-637/+1
| | | | | | | | | | | | | | | | | | | | | | | runtime" and also the follow-up "[xray] Only build xray on Linux for now" Two build errors were reported on the llvm-commits list: [ 88%] Building CXX object lib/xray/CMakeFiles/clang_rt.xray-x86_64.dir/xray_flags.cc.o /mnt/b/sanitizer-buildbot1/sanitizer-x86_64-linux/build/llvm/projects/compiler-rt/lib/xray/xray_init.cc:23:10: fatal error: 'llvm/Support/ELF.h' file not found #include "llvm/Support/ELF.h" ^ and In file included from /w/src/llvm.org/projects/compiler-rt/lib/xray/xray_interface.cc:16: /w/src/llvm.org/projects/compiler-rt/lib/xray/xray_interface_internal.h:36:8: error: no type named 'size_t' in namespace 'std' std::size_t Entries; ~~~~~^ llvm-svn: 276186
* [compiler-rt] Fix broken unittest related to 64-bit print formatEtienne Bergeron2016-07-202-5/+6
| | | | | | | | | | | | | | | Summary: The printf is not working correctly on 64-bit MSVC. The portable way to print "size_t" is to use "%zx" (size_t in hexa). Reviewers: rnk Subscribers: kubabrecka, llvm-commits, wang0109, chrisha Differential Revision: https://reviews.llvm.org/D22588 llvm-svn: 276179
* [compiler-rt] Don't require c++ headers when configuring compiler-rt buildsFrancis Ricci2016-07-201-2/+2
| | | | | | | | | | | | | | Summary: A sysroot without c++ headers is able to build compiler-rt, don't require them when configuring available architectures from cmake. Reviewers: samsonov, beanz, compnerd Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D22469 llvm-svn: 276151
* [compiler-rt] Fix target architecture matchingFrancis Ricci2016-07-201-1/+1
| | | | | | | | | | | | | | | Summary: Use stricter comparisons for architecture. This prevents cmake from failing for sysroots which can only compile armhf and not arm, since arm MATCHES armhf is true, while arm STREQUAL armhf is false. Reviewers: beanz, compnerd Subscribers: aemerson, llvm-commits Differential Revision: https://reviews.llvm.org/D22473 llvm-svn: 276148
* fix flaky test on windows sanitizer botsEtienne Bergeron2016-07-201-8/+8
| | | | llvm-svn: 276143
* [asan] trying to fix the android botKostya Serebryany2016-07-201-1/+0
| | | | llvm-svn: 276134
* Try to deflake Windows/dll_host.cc test by not using repeated echo appendingReid Kleckner2016-07-201-10/+12
| | | | llvm-svn: 276130
* [xray] Only build xray on Linux for nowReid Kleckner2016-07-203-5/+10
| | | | | | | | | | | Should fix the Windows buildbots, and maybe some other non-Linux Unix bots too. XRay currently depends on sanitizer_common, so associate it with the "build sanitizers" option and remove the option for separately controlling the XRay build. llvm-svn: 276124
* [compiler-rt/asan] Disable irrelevant unittest on win64Etienne Bergeron2016-07-201-0/+1
| | | | | | | | | | | | | | Summary: This test is allocating a 1gig chunk to make shadow allocation failed, but on 64-bits architecture the test is working. Reviewers: rnk Subscribers: kubabrecka, llvm-commits, wang0109, chrisha Differential Revision: https://reviews.llvm.org/D22553 llvm-svn: 276122
* [compiler-rt] [XRay] Basic initialization and flag definition for XRay runtimeDean Michael Berris2016-07-2013-1/+632
| | | | | | | | | | | | | | | Summary: This patch implements the initialisation and patching routines for the XRay runtime, along with the necessary trampolines for function entry/exit handling. For now we only define the basic hooks for allowing an implementation to define a handler that gets run on function entry/exit. We expose a minimal API for controlling the behaviour of the runtime (patching, cleanup, and setting the handler to invoke when instrumenting). Depends on D19904 Reviewers: echristo, kcc, rnk Subscribers: rnk, mehdi_amini, llvm-commits Differential Revision: https://reviews.llvm.org/D21612 llvm-svn: 276117
* tsan: fix windows buildDmitry Vyukov2016-07-201-3/+3
| | | | | | It's only asan that installs vectored SEH handler to map memory lazily. llvm-svn: 276112
* tsan: fix windows buildDmitry Vyukov2016-07-201-0/+14
| | | | | | | | | | | | Currently fails as: gotsan.cc: In function 'void* __sanitizer::__libc_memalign(__sanitizer::uptr, __sanitizer::uptr)': gotsan.cc:6194:50: error: 'posix_memalign' was not declared in this scope uptr error = posix_memalign(&p, alignment, size); Windows does not provide posix_memalign. llvm-svn: 276107
* tsan: fix leak of shadow stacksDmitry Vyukov2016-07-201-0/+6
| | | | llvm-svn: 276103
* Minor cleanup -- clear name structure before parsingXinliang David Li2016-07-201-6/+5
| | | | llvm-svn: 276089
* [Profile] implement interface to get profile path prefixXinliang David Li2016-07-203-1/+88
| | | | | | Differential Revision: http://reviews.llvm.org/D22546 llvm-svn: 276083
* [Profile] Test cleanup -- use new lit var for IR PGO tests /NFCXinliang David Li2016-07-194-17/+17
| | | | llvm-svn: 276036
* [Profile] Introduce lit test vars for IR based instrumentationXinliang David Li2016-07-191-2/+10
| | | | llvm-svn: 276034
* [asan] trying to fix the android botKostya Serebryany2016-07-191-5/+9
| | | | llvm-svn: 276031
* [Profile] introduce reusable internal interfaces to find dir separator \NFCXinliang David Li2016-07-193-5/+31
| | | | llvm-svn: 276027
* [Profile] move utility interfaces to the right header /NFCXinliang David Li2016-07-193-15/+14
| | | | llvm-svn: 276021
* [Profile] use portable macro /NFCXinliang David Li2016-07-191-1/+1
| | | | llvm-svn: 276019
* Add detect_stack_use_after_scope runtime flagVitaly Buka2016-07-198-4/+46
| | | | | | | | | | Summary: This flag could be used to disable check in runtime. Subscribers: kubabrecka Differential Revision: https://reviews.llvm.org/D22495 llvm-svn: 276004
* fix compiler warnings [NFC]Etienne Bergeron2016-07-191-3/+3
| | | | llvm-svn: 275984
* [compiler-rt] Fix Asan imports/exports unittestEtienne Bergeron2016-07-191-5/+24
| | | | | | | | | | | | | | | | | | | Summary: Avoid mismatch between imports/exports for 32-bit and 64-bits version. The test is running grep over macros to detect which functions are intercepted. Unfortunately, exception handlers differ in 32-bit and 64-bit. This patch is removing the exception handlers from the test. Reviewers: rnk Subscribers: llvm-commits, wang0109, kubabrecka, chrisha Differential Revision: https://reviews.llvm.org/D22484 llvm-svn: 275982
* [esan|wset] Fix flaky sampling testsDerek Bruening2016-07-198-18/+42
| | | | | | | Adds a new esan public interface routine __esan_get_sample_count() and uses it to ensure that tests of sampling receive the minimum number of samples. llvm-svn: 275948
* [esan] Fix sideline thread flaky assertDerek Bruening2016-07-191-1/+8
| | | | | | | | Fixes an esan sideline thread CHECK that failed to account for the sideline thread reaching its code before the internal_clone() return value was assigned in the parent. llvm-svn: 275946
OpenPOWER on IntegriCloud