summaryrefslogtreecommitdiff
path: root/lib/interception
Commit message (Collapse)AuthorAge
* [ASan] Add CMake configs for libclang_rt.asan_iossim_dynamic.dylib Alexander Potapenko2013-11-07
| | | | | | | | | | | CMake changes to build the ASan runtime for the iOS simulator. This is a universal library targeting the same architectures as the OSX ASan runtime does, thus the iossim version can't live in the same universal libclang_rt.asan_osx_dynamic.dylib The difference between the OSX and iossim builds is in the -mios-simulator-version-min and -ios_simulator_version_min flags that tell Clang to compile and link iossim code. The iossim runtime can only be built on a machine with both Xcode and the iOS Simulator SDK installed. If xcodebuild -version -sdk iphonesimulator Path returns a nonempty path, it is used when compiling and linking the iossim runtime. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@194199 91177308-0d34-0410-b5e6-96231b3b80d8
* Make some pthread_mutex_* and pthread_cond_* interceptors common.Alexey Samsonov2013-10-16
| | | | | | | | | | | | Reviewers: eugenis, dvyukov Reviewed By: dvyukov CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D1937 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@192774 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix linking of tsan runtime into dynamic librariesDmitry Vyukov2013-09-19
| | | | | | | | | versioned symbols can not be linked into dynamic library w/o linker script also simplifies code as side effect git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@191056 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Remove the explicit function prototypes for intercepted functions on ↵Timur Iskhodzhanov2013-09-10
| | | | | | Windows git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@190411 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: fix linking when -ltsan is passed before -lpthreadDmitry Vyukov2013-09-03
| | | | | | | | | | | | libpthread is weird: /lib/x86_64-linux-gnu/libpthread.so.0:000000000000b9b0 T pthread_cond_init@@GLIBC_2.3.2 /lib/x86_64-linux-gnu/libpthread.so.0:000000000000c720 T pthread_cond_init@GLIBC_2.2.5 let's do it with @@ for now we can always introduce more macros parameters later git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189788 91177308-0d34-0410-b5e6-96231b3b80d8
* asan: fix android buildDmitry Vyukov2013-09-03
| | | | | | | android does not have dlvsym git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189781 91177308-0d34-0410-b5e6-96231b3b80d8
* tsan: properly intercept pthread_cond functionsDmitry Vyukov2013-09-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@189767 91177308-0d34-0410-b5e6-96231b3b80d8
* [libsanitizer] Introduce INTERCEPTOR_WITH_SUFFIX which is to be used for ↵Alexander Potapenko2013-05-20
| | | | | | | | | appending the __DARWIN_ALIAS() version suffixes to function names on Darwin. This should fix asan/lit_tests/wait.cc under ASan. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@182259 91177308-0d34-0410-b5e6-96231b3b80d8
* add Linux syscall wrappers and ThreadLister to sanitizer_commonKostya Serebryany2013-02-27
| | | | | | | | | ThreadLister is a Linux-specific class for obtaining the thread IDs of a process from procfs (/proc/<pid>/task/). It will be used by leak checking code. Also add several syscall wrappers which will be required by the same code that uses ThreadLister, but are not used in ThreadLister itself. Patch by Sergey Matveev git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@176179 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Refactoring: nuke the redundant function declarations in ↵Alexander Potapenko2013-02-21
| | | | | | | | | | | asan_intercepted_functions.h that had been used on OS X only. The INTERCEPTOR() macro on OS X is now responsible for declaring the wrapped function, the wrapper and the pair of pointers to them in __DATA,__interposition section. Thus adding an interceptor requires editing a single file now. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175740 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] fix x32 build (H.J. Lu)Kostya Serebryany2013-02-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@175140 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] OFF_T on Mac is u64.Evgeniy Stepanov2013-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174600 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Exclude off64_t test on mac.Evgeniy Stepanov2013-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174598 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] include stddef.h for ptrdiff_t in interception type testAlexey Samsonov2013-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174597 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Add a missing header.Evgeniy Stepanov2013-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174594 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Fix wrong size of OFF_T on 32-bit platforms.Evgeniy Stepanov2013-02-07
| | | | | | | | This broke pread/pwrite interceptors when building without -D_FILE_OFFSET_BITS=64, and always on Android. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174593 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Delete the code related to static runtime on OS X.Alexander Potapenko2013-02-05
| | | | | | | | Nuke lib/interception/mach_override. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@174383 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] include sanitizer_common headers when building interception libraryAlexey Samsonov2013-01-30
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173930 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Further split private and public sanitizer headers.Evgeniy Stepanov2013-01-30
| | | | | | | And make msan_interface.h C-compatible. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@173928 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Add add_compiler_rt_osx_object_library to create universal libraries ↵Alexey Samsonov2013-01-20
| | | | | | on Mac git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172979 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: Generalize build rules for different arches for sanitizer_common, ↵Alexey Samsonov2013-01-18
| | | | | | asan, ubsan git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172829 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake: create AddCompilerRT module and implement convenience ↵Alexey Samsonov2013-01-18
| | | | | | add_compiler_rt_object_library function git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172826 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake variables renaming: X86_64->x86_64 I386->i386Alexey Samsonov2013-01-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172812 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Common *scanf interceptors.Evgeniy Stepanov2013-01-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@172805 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] replace size_t with SIZE_T in interceptors (same for ssize_t, ↵Kostya Serebryany2012-12-13
| | | | | | off_t and off64_t). This is done to avoid confusion and to make the code work with compilers that define size_t w/o any includes (MSVC) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@170103 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Add the "lea $imm(%rip),%rax" instruction to mach_override.cAlexander Potapenko2012-11-15
| | | | | | | The need for this has been reported by Jack Howarth (howarth@bromo.med.uc.edu) who's porting ASan-Darwin to GCC git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@168032 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] Apply some ASan-relevant pieces of patch by Ruben Van Boxem. In the ↵Alexey Samsonov2012-09-24
| | | | | | same time, remove ASan from CMake build on Windows after conversation with Timur. We don't want to support building ASan on Windows until it is in a working state. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@164486 91177308-0d34-0410-b5e6-96231b3b80d8
* Pass -std=c99 when compiling mach_override.cAlexander Potapenko2012-09-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163717 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix compiler warnings: remove __attribute__((visibility)) for static ↵Alexander Potapenko2012-09-12
| | | | | | functions, use unsigned char instead of char. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163707 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] more macro/casting magic to suppress warningsAlexey Samsonov2012-09-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163706 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Fix compiler warnings (including void* arithmetic) in mach_overrideAlexey Samsonov2012-09-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163698 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] fix interception macro for Android buildAlexey Samsonov2012-09-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163692 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] get rid of empty DEFAULT_CONVENTION in interception lib to ↵Alexey Samsonov2012-09-11
| | | | | | remove empty macro arguments git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163622 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake build rules for ASan Android runtime and tests.Evgeniy Stepanov2012-09-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163613 91177308-0d34-0410-b5e6-96231b3b80d8
* Add "movsbl %dh, %ecx" and "testb %r8, %r8" to mach_override.Alexander Potapenko2012-09-06
| | | | | | | | This should fix http://code.google.com/p/address-sanitizer/issues/detail?id=105 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163301 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] hoist more compile flags to SANITIZER_COMMON_CFLAGS var and add the ↵Alexey Samsonov2012-09-05
| | | | | | rest of flags/defs from old Makefile to CMake git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@163204 91177308-0d34-0410-b5e6-96231b3b80d8
* Some flag cleanup for the sanitizer runtimes.Chandler Carruth2012-08-29
| | | | | | | | | | | | This hoists most of the CFLAGS into a common variable. It also adds detection for -Wno-c99-extensions and uses it to silence a pile of warnings. Finally, it switches to the proper flag -rdynamic. With this, the cmake build is warning free on my bootstrap Linux build. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162809 91177308-0d34-0410-b5e6-96231b3b80d8
* CMake build rules for ASan/Android runtime.Evgeniy Stepanov2012-08-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162675 91177308-0d34-0410-b5e6-96231b3b80d8
* Commit the source and CMake changes that will allow to build ASan runtimeAlexander Potapenko2012-08-17
| | | | | | | | | as a shared library on Mac OS. This will provide an alternative to mach_override. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@162091 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] CMake support for building ASan runtime as a universal binary on MacAlexey Samsonov2012-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161665 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the non-interface mach_override functions static to avoid name clashes ↵Alexander Potapenko2012-08-09
| | | | | | with user code that may contain its own mach_override. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161577 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] cleanup CMake files for interception and sanitizer_common helper ↵Alexey Samsonov2012-08-08
| | | | | | libraries git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161485 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] fix windows buildAlexey Samsonov2012-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161170 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow-up for r161168 for WindowsAlexey Samsonov2012-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161169 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] Workaround for a compiler warning - ISO C++ forbids casting ↵Alexey Samsonov2012-08-02
| | | | | | pointer-to-function to pointer-to-object, so we use cast via integral type git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161168 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for "movsbl %sil,%ecx" (x86_64) and "movsbl $imm(%ebp), %edx" ↵Alexander Potapenko2012-08-01
| | | | | | | | | | (i386) to our fork of mach_override. This is an extended version of a patch by Rafael Avila de Espindola (rafael.espindola@gmail.com) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@161116 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] silence various warnings in cmake build of asan unit testsAlexey Samsonov2012-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159347 91177308-0d34-0410-b5e6-96231b3b80d8
* [ASan] cleanup: trailing semicolons, trailing colons in enumsAlexey Samsonov2012-06-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159338 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizer] fight more semicolons in macro definitions (to please mac cmake ↵Alexey Samsonov2012-06-28
| | | | | | build) git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159337 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleanup the handling of CFLAGS even more in the cmake build for ASan.Chandler Carruth2012-06-25
| | | | | | | | | | | | | | | | | | | | | | | | | Add the initial support for building ASan tests. The first change here is to try to get the CFLAGS to more closely match those used by the old Makefile. There are probably still goofs here, ASan folks, your review would be appreciated. The second big change is to add support for building both instrumentation based an non-instrumentation based unittests for ASan. They are built a bit differently from how the old makefiles managed things. Specifically, there are two binaries, one for the non-instrumented case, and one for the instrumented case. Also, the instrumented unit tests rely on the host compiler supporting AddressSanitizer's intrumentation pass. This is kind-of gross, but I don't know of a better way yet. I've mailed llvmdev to discuss this issue. One big caveat is that the detection logic currently doesn't work. I've commented it out temporarily as I'd like to get feedback from the ASan developers, etc. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@159134 91177308-0d34-0410-b5e6-96231b3b80d8