summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib
Commit message (Collapse)AuthorAgeFilesLines
* Use /usr/bin/env to find pythonEd Maste2015-05-282-2/+2
| | | | | | | | | | Python may not be /usr/bin/python on some systems. For example, on FreeBSD it will be /usr/local/bin/python. Reviewers: samsonov Differential Revision: http://reviews.llvm.org/D9914 llvm-svn: 238428
* [ASan] Add new interceptors to asan_win_dll_thunk.cc to fix build errors on ↵Yury Gribov2015-05-281-0/+4
| | | | | | | | Windows. Patch by Maria Guseva! llvm-svn: 238407
* [sanitizer] More string interceptors: strstr, strcasestr, strspn, strcspn, ↵Yury Gribov2015-05-284-11/+108
| | | | | | | | | | strpbrk. Patch by Maria Guseva. Differential Revision: http://reviews.llvm.org/D9017 llvm-svn: 238406
* [ASan] New approach to dynamic allocas unpoisoning. Patch by Max Ostapenko!Yury Gribov2015-05-282-0/+27
| | | | | | Differential Revision: http://reviews.llvm.org/D7098 llvm-svn: 238401
* [asan] Fix build dependency issues with ASan version list file.Evgeniy Stepanov2015-05-271-2/+15
| | | | | | | | | | CMake pre-3.1 has a bug where a shared library depending on a custom_target does not really depend on it. This commit implements a hilariously ugly workaround for this problem, see code comments for more details. llvm-svn: 238367
* [msan] Mprotect all inaccessible memory regions.Evgeniy Stepanov2015-05-243-12/+33
| | | | | | | | | | | | | | | | | Fix 2 bugs in memory mapping setup: - the invalid region at offset 0 was not protected because mmap at address 0 fails with EPERM on most Linux systems. We did not notice this because the check condition was flipped: the code was checking that mprotect has failed. And the test that was supposed to catch this was weakened by the mitigations in the mmap interceptor. - when running without origins, the origin shadow range was left unprotected. The new test ensures that mmap w/o MAP_FIXED always returns valid application addresses. llvm-svn: 238109
* [dfsan] ignore more __sanitizer callbacksKostya Serebryany2015-05-231-5/+3
| | | | llvm-svn: 238085
* builtins: mark functions as aapcs on WindowsSaleem Abdulrasool2015-05-221-1/+5
| | | | | | | | Windows does not use AAPCS, but rather AAPCS-VFP, and thus the functions which are assumed to be AAPCS will cause invalid argument setup. Ensure that the functions are marked as AAPCS. llvm-svn: 238056
* [ASan/Win] Add DLL thunk for new coverage hookReid Kleckner2015-05-191-0/+1
| | | | | | Should fix dll_host.cc test failing on bots. llvm-svn: 237725
* [sanitizer] Recognize static TLS in __tls_get_addr interceptor.Evgeniy Stepanov2015-05-166-3/+39
| | | | | | | Current code tries to find the dynamic TLS header to the left of the TLS block without checking that it's not a static TLS allocation. llvm-svn: 237495
* [Builtins] Implement f2h/h2f by jumping to trunc/extend.Ahmed Bougacha2015-05-142-4/+8
| | | | | | | | | | | | Follow-up to r237161; seems like we can't use aliases, but we can do better than duplicating the bodies, especially when that body, after inlining, isn't as small as it looks. Better approaches welcome. Perhaps the best thing is just to have an #ifndef __APPLE__ over the GNUEABI names, since they're not used there. llvm-svn: 237323
* Include missing 'sanitizer_platform_limits_posix.h'Ismail Pazarbasi2015-05-121-0/+1
| | | | | | Unbreak Mac builds. `#include` seems to be forgotten during staging. llvm-svn: 237190
* Call system's sigfillset and sigprocmask functions from sanitizersIsmail Pazarbasi2015-05-121-0/+7
| | | | | | | | | | Reviewers: kcc, glider, dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9637 llvm-svn: 237177
* Sanitizers: Implement `GetRSS` on Mac OS XIsmail Pazarbasi2015-05-121-3/+12
| | | | | | | | | | Reviewers: kcc, glider, dvyukov Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9636 llvm-svn: 237173
* [Builtins] Implement half-precision conversions.Ahmed Bougacha2015-05-127-5/+92
| | | | | | | | | | | | | | | | | Mostly uninteresting, except: - in __extendXfYf2, when checking if the number is normal, the old code relied on the unsignedness of src_rep_t, which is a problem when sizeof(src_rep_t) < sizeof(int): the result gets promoted to int, the signedness of which breaks the comparison. I added an explicit cast; it shouldn't affect other types. - we can't pass __fp16, so src_t and src_rep_t are the same. - the gnu_*_ieee symbols are simply duplicated definitions, as aliases are problematic on mach-o (where only weak aliases are supported; that's not what we want). Differential Revision: http://reviews.llvm.org/D9693 llvm-svn: 237161
* [sanitizer] Update "sancov.py missing" to allow __sanitizer_cov_with_check().Sergey Matveev2015-05-121-1/+5
| | | | llvm-svn: 237149
* [UBSan] Add missing header that defines SANITIZER_CAN_USE_PREINIT_ARRAYAlexey Samsonov2015-05-111-0/+1
| | | | | | | Otherwise this compile definition was undefined, and .preinit_array was never used on the platforms that support it. llvm-svn: 237045
* [Msan] Fix the if_indextoname.cc test to pass on FreeBSDViktor Kutuzov2015-05-111-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D9456 llvm-svn: 236999
* [asan/fuzzer] define a dummy weak __sanitizer_cov_trace_cmpKostya Serebryany2015-05-081-0/+3
| | | | llvm-svn: 236907
* builtins: Implement the functions from stdatomic.hJustin Bogner2015-05-086-0/+116
| | | | | | | | | | | Talking to John and Doug, we concluded that these functions from stdatomic really do belong here in compiler-rt rather than in libc, since the compiler owns stdatomic.h and these need to refer to clang-specific builtins. Nonetheless, I've only added these on darwin for now - other platforms should probably do the same unless their libc does implement these functions. llvm-svn: 236805
* Intercept scandir() on FreeBSDViktor Kutuzov2015-05-071-1/+2
| | | | | | Committed unreviewed with premission. llvm-svn: 236720
* Intercept rand_r() on FreeBSDViktor Kutuzov2015-05-071-1/+2
| | | | | | Committed unreviewed with premission. llvm-svn: 236719
* Add dfsan_weak_hook_memcmpKostya Serebryany2015-05-071-0/+9
| | | | | | | | | | | | | | | | | | | Summary: Add a weak hook to be called from dfsan's custom memcmp. The primary user will be lib/Fuzzer. If this works well we'll add more hooks (strcmp, etc). Test Plan: Will be covered by lib/Fuzzer tests. Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9541 llvm-svn: 236679
* Add api_list entries for the dfsan-based fuzzerKostya Serebryany2015-05-062-1/+20
| | | | | | | | | | | | | | | | Summary: Add api_list entries for the dfsan-based fuzzer Test Plan: covered by check-fuzzer Reviewers: pcc Reviewed By: pcc Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9538 llvm-svn: 236657
* [sanitizer] Extend sancov.py to show which PCs are missing from coverage.Sergey Matveev2015-05-061-4/+41
| | | | | | | | Example usage: sancov.py print a.out.1234.sancov | sancov.py missing a.out llvm-svn: 236637
* [asan] Fall back to /proc/$PID/maps on Android L.Evgeniy Stepanov2015-05-063-4/+45
| | | | | | | | dl_iterate_phdr is somewhat broken in L (see the code for details). We add runtime OS version detection and fallback to /proc/maps on L or earlier. This fixes a number of ASan tests on L. llvm-svn: 236628
* [Msan] Fix the ioctl_custom.cc test to pass on FreeBSDViktor Kutuzov2015-05-061-14/+6
| | | | | | Differential Revision: http://reviews.llvm.org/D9459 llvm-svn: 236581
* [Msan] Fix the ifaddrs.cc test to build and pass on FreeBSDViktor Kutuzov2015-05-061-1/+2
| | | | | | Differential Revision: http://reviews.llvm.org/D9457 llvm-svn: 236579
* [ASan][MIPS] Fix null_deref.cc test on MIPS64Sagar Thakur2015-05-061-1/+1
| | | | | | | | | | Symbol for pc used in ucontext->uc_mcontext was wrong. Reviewers: dsanders, kcc, samsonov Subscribers: llvm-commits, mohit.bhakkad, jaydeep Differential Revision: http://reviews.llvm.org/D9246 llvm-svn: 236572
* [sanitizer][MIPS] Implement clone for MIPSSagar Thakur2015-05-061-3/+63
| | | | | | | | Reviewers: kcc, samsonov, earthdok Subscribers: dsanders, jaydeep, Anand.Takale, mohit.bhakkad, llvm-commits Differential Revision: http://reviews.llvm.org/D8318 llvm-svn: 236570
* [asan] Fix dynamic-runtime tests.Evgeniy Stepanov2015-05-061-2/+3
| | | | | | | | | | They are not part of check-all :( This change adds sized-delete operators to the version list, and disables the hack that excluded versioned symbols from the dynamic list - this is not an issue in this case. llvm-svn: 236559
* [asan] Fix compiler-rt build.Evgeniy Stepanov2015-05-051-1/+4
| | | | | | i386 runtime library was accidentally using the x86_64 version script without a dependency. llvm-svn: 236556
* [asan] Use a version script to limit the symbols exported by the ASan shared ↵Evgeniy Stepanov2015-05-052-4/+27
| | | | | | runtime library. llvm-svn: 236551
* [asan] fix IsDeadlySignalKostya Serebryany2015-05-051-2/+2
| | | | llvm-svn: 236545
* Build ASan runtime library with -z global on Android.Evgeniy Stepanov2015-05-051-0/+14
| | | | llvm-svn: 236537
* Disable exceptions with Clang on Windows in lib/sanitizer-common/testsReid Kleckner2015-05-051-2/+7
| | | | | | | While I'm here, fix a copy-paste bug so we get debug info for these tests. llvm-svn: 236505
* tsan: add memory access functions that accept pcDmitry Vyukov2015-05-053-0/+54
| | | | | | This is required for Java support, as real PCs don't work for Java. llvm-svn: 236484
* [asan] under handle_abort=1 option intercept SIGABRT in addition to ↵Kostya Serebryany2015-05-053-2/+6
| | | | | | SIGSEGV/SIGBUS. Among other things this will allow to set up a death callback for SIGABRT and thus properly handle assert() in lib/Fuzzer llvm-svn: 236474
* Disable exceptions for clang-compiled unittest code on WindowsReid Kleckner2015-05-011-0/+5
| | | | llvm-svn: 236357
* Fix float->uint conversion for inputs less than 0Derek Schuff2015-05-013-1/+3
| | | | | | | | | | | | | | | | | | | | Summary: The spec for these functions says that they should return 0 in this case but this regressed in r234148. That revision essentially delegates the conversion to the hardware, but that has different behavior on different platforms (e.g. it is wrong on x86). Also fix a typo in the name of __fixunsdfti Test Plan: The existing unit tests now pass Reviewers: joerg, howard.hinnant Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D9305 llvm-svn: 236319
* [asancov] Fix coverage reserving 4x the necessary amount of memory on fork.Evgeniy Stepanov2015-05-011-1/+2
| | | | llvm-svn: 236294
* This change is the first of 3 patches to add support for specifyingEric Christopher2015-04-282-18/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the profile output from the command line via -fprofile-instr-generate=<path>, where the specified output path/file will be overridden by the LLVM_PROFILE_FILE environment variable. Several changes are made to the runtime to support this: Add a new interface __llvm_profile_override_default_filename that will set the profile output filename, but allows LLVM_PROFILE_FILE to override. This is the interface used by the new option. Refactor the pid-expansion done for LLVM_PROFILE_FILE into a separate routine that can be shared by the various filename setting routines (so that the filename from the option can also use the "%p" syntax). Move the truncation into setFilename, and only truncate if there is a new filename specified (to maintain support for appending to the same profile file in the case of multiple shared objects built with profiling). Move the handling for a NULL filename passed to __llvm_profile_set_filename and __llvm_profile_override_default_filename into the new setFilenamePossiblyWithPid routine. This now correctly resets the output file to default.profraw instead of NULL. The handling for a null LLVM_PROFILE_FILE (which should not reset) is done by caller setFilenameFromEnvironment. Patch by Teresa Johnson. llvm-svn: 236055
* [asan] Use dl_iterate_phdr on Android.Evgeniy Stepanov2015-04-281-9/+19
| | | | | | It's available on Android/ARM starting with API 21 (L). llvm-svn: 236014
* tsan: fix a bug memory access handlingDmitry Vyukov2015-04-281-1/+2
| | | | | | | | | | We incorrectly replaced shadow slots when the new value is not stronger than the old one. The bug can lead to false negatives. The bug was detected by Go race test suite: https://github.com/golang/go/issues/10589 llvm-svn: 236008
* [Msan] Fix the getline.cc test to pass on FreeBSDViktor Kutuzov2015-04-282-18/+26
| | | | | | Differential Revision: http://reviews.llvm.org/D9251 llvm-svn: 235975
* [TSan] Attempt to fix old Makefile build.Alexey Samsonov2015-04-282-2/+3
| | | | llvm-svn: 235960
* Export __ubsan_* symbols from MSan and TSan runtimes.Alexey Samsonov2015-04-282-0/+2
| | | | llvm-svn: 235958
* Allow UBSan+MSan and UBSan+TSan combinations (Clang part).Alexey Samsonov2015-04-287-11/+68
| | | | | | | | Embed UBSan runtime into TSan and MSan runtimes in the same as we do in ASan. Extend UBSan test suite to also run tests for these combinations. llvm-svn: 235954
* [asan] Fix ASan build on Android/AArch64.Evgeniy Stepanov2015-04-272-3/+25
| | | | | | The build for aarch64 is not enabled in cmake/config-ix.cmake yet. llvm-svn: 235944
* Introduce tsan_cxx and msan_cxx libraries (compiler-rt part).Alexey Samsonov2015-04-272-9/+27
| | | | | | | | For now tsan_cxx and msan_cxx contain only operator new/delete replacements. In the future, when we add support for running UBSan+TSan and UBSan+MSan, they will also contain bits ubsan_cxx runtime. llvm-svn: 235928
OpenPOWER on IntegriCloud