summaryrefslogtreecommitdiffstats
path: root/compiler-rt
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix build on sparc64-linux-gnu.Martin Liska2018-11-051-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D54030 llvm-svn: 346129
* [hwasan] Fix stack-uar.c after rCRT345110Fangrui Song2018-11-051-1/+1
| | | | | | Set -fno-discard-value-names so that the frame description string contains the variable name. llvm-svn: 346120
* [XRay] Update TSC math to handle wraparoundDean Michael Berris2018-11-054-81/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Prior to this change, we can run into situations where the TSC we're getting when exiting a function is less than the TSC we got when entering it. This would sometimes cause the counter for cumulative call times overflow, which was erroneously also being stored as a signed 64-bit integer. This change addresses both these issues while adding provisions for tracking CPU migrations. We do this because moving from one CPU to another doesn't guarantee that the timestamp counter for some architectures aren't guaranteed to be synchronised. For the moment, we leave the provisions there until we can update the data format to include the counting of CPU migrations we can catch. We update the necessary tests as well, ensuring that our expectations for the cycle accounting to be met in case of counter wraparound. Reviewers: mboerger Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D54088 llvm-svn: 346116
* Disable recursive interception for tzset in MSanKamil Rytarowski2018-11-041-0/+1
| | | | | | | This fixes sanitization of this library call on NetBSD. Extracted as a part of D42050. llvm-svn: 346098
* [compiler-rt] Support for passing through linker flags to libc++ buildPetr Hosek2018-11-031-2/+7
| | | | | | | | This may be needed when cross-compiling to certain platforms. Differential Revision: https://reviews.llvm.org/D54027 llvm-svn: 346063
* [compiler-rt][Fuzzer] Fix the fuzzer test buildPetr Hosek2018-11-021-2/+2
| | | | | | | | | This fixes the issue introduced in r345765 which changed the way in which the embedded libc++ is being built but omitted tests. Differential Revision: https://reviews.llvm.org/D54058 llvm-svn: 346052
* Workaround using new Clang with an old NDK.Dan Albert2018-11-021-0/+1
| | | | | | | | | We're using an old NDK and a new Clang. New Clangs default to `-stdlib=libc++` for Android, but those libraries cannot be found by default with an old NDK. Use an explicit `-stdlib=libstdc++` in the cxx_mode_flags. llvm-svn: 346051
* Try to unbreak the build of sanitizers on !NetBSDKamil Rytarowski2018-11-021-1/+4
| | | | | | | | Include the build of unpoison_passwd() and unpoison_group() for SANITIZER_INTERCEPT_FGETPWENT_R and SANITIZER_INTERCEPT_FGETGRENT_R. static void unpoison_passwd( llvm-svn: 346042
* Split getpwent and fgetgrent functions in interceptorsKamil Rytarowski2018-11-022-15/+33
| | | | | | | | | | | | | | | | | | | | | | | | Summary: NetBSD does not ship with fgetpwent_r() and fgetgrent_r(). Split their interceptors from getpwent_r() and getgrent_r() and disable for this OS. Installation of supernumerary interceptors causes leaking of errors to dlsym(3)-like operations. No functional change for other OSes. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: srhines, kubamracek, fedor.sergeev, llvm-commits, #sanitizers, mgorny Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54041 llvm-svn: 346038
* [PowerPC]Disable randomized address space on Linux ppc64leLei Huang2018-11-021-0/+11
| | | | | | | | | | | Recent versions of Ubuntu (17.04 and 18.04) on PowerPC have introduced changes to Address Space Layout Randomization (ASLR) that is causing 500+ sanitizer failures. This patch disables ASLR when running the sanitizers on PowerPC 64bit LE. Differential Revision: https://reviews.llvm.org/D52900 llvm-svn: 346030
* [NFC] Refactor initialisation of Darwin malloc zone fields into separate ↵Dan Liew2018-11-021-1/+5
| | | | | | | | | | | | | | | | | | function called `InitMallocZoneFields()` which is now called from `ReplaceSystemMalloc()`. Summary: The motivation here is to be able support initialisation of the malloc zone on other code paths. rdar://problem/45284065 Reviewers: kubamracek, george.karpenkov Subscribers: llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D54037 llvm-svn: 345983
* [XRay] Update delta computations in runtimeDean Michael Berris2018-11-022-5/+39
| | | | | | | | | | | | | | | | | | Summary: Fix some issues discovered from mostly manual inspection of outputs from the `llvm-xray fdr-dump` tool. It turns out we haven't been writing the deltas properly, and have been writing down zeros for deltas of some records. This change fixes this oversight born by the recent refactoring. Reviewers: mboerger Subscribers: llvm-commits, hiraditya Differential Revision: https://reviews.llvm.org/D54022 llvm-svn: 345954
* [XRay] Fix TSC and atomic custom/typed event accountingDean Michael Berris2018-11-016-12/+134
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is a follow-on change to D53858 which turns out to have had a TSC accounting bug when writing out function exit records in FDR mode. This change adds a number of tests to ensure that: - We are handling the delta between the exit TSC and the last TSC we've seen. - We are writing the custom event and typed event records as a single update to the buffer extents. - We are able to catch boundary conditions when loading FDR logs. We introduce a TSC matcher to the test helpers, which we use in the testing/verification of the TSC accounting change. Reviewers: mboerger Subscribers: mgorny, hiraditya, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D53967 llvm-svn: 345905
* [XRay] Add CPU ID in Custom Event FDR RecordsDean Michael Berris2018-11-013-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change cuts across compiler-rt and llvm, to increment the FDR log version number to 4, and include the CPU ID in the custom event records. This is a step towards allowing us to change the `llvm::xray::Trace` object to start representing both custom and typed events in the stream of records. Follow-on changes will allow us to change the kinds of records we're presenting in the stream of traces, to incorporate the data in custom/typed events. A follow-on change will handle the typed event case, where it may not fit within the 15-byte buffer for metadata records. This work is part of the larger effort to enable writing analysis and processing tools using a common in-memory representation of the events found in traces. The work will focus on porting existing tools in LLVM to use the common representation and informing the design of a library/framework for expressing trace event analysis as C++ programs. Reviewers: mboerger, eizan Subscribers: hiraditya, mgrang, llvm-commits Differential Revision: https://reviews.llvm.org/D53920 llvm-svn: 345798
* Compile and test i128 math builtins for Win64Reid Kleckner2018-11-0139-48/+104
| | | | | | | | | | | | | | | | | | | | | Summary: Windows has always been LLP64, not LP64, so the macros were incorrect. Check for _WIN64, since AArch64 sets that too. The tests have to be fixed up in two main ways: 1. Use 'ULL' suffixes to avoid sign extension when passing hex literals with the sign bit set to signed 128 arguments. Clang -fms-compatibility makes such hex literals signed, not unsigned. 2. Disable various tests for 80-bit long double interoperation with i128 values. Reviewers: joerg, mstorsjo Subscribers: javed.absar, kristof.beyls, hiraditya, aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D53918 llvm-svn: 345796
* [compiler-rt] Pass CMake C and C++ flags to the custom libc++Petr Hosek2018-10-311-3/+7
| | | | | | | | | | | When building the custom libc++ that's used by libFuzzer as well as MSan and TSan tests, passthrough the C and C++ flags that were passed to the compiler-rt CMake build. These may be needed to successfuly compile the library on a particular platform. Differential Revision: https://reviews.llvm.org/D53862 llvm-svn: 345788
* [compiler-rt][Fuzzer] Use the new C++ ABI namespace CMake supportPetr Hosek2018-10-311-1/+1
| | | | | | | | | libc++ now supports customizing the ABI namespace directly from the CMake build so we no longer need to rely on custom CFLAGS. Differential Revision: https://reviews.llvm.org/D53939 llvm-svn: 345765
* Update ioctl(2) operations for NetBSD 8.99.25Kamil Rytarowski2018-10-313-42/+66
| | | | | | | | | | | | Eliminate dropped operations, add new operations. Update included headers for newer need. Add a fallback definition of nvlist_ref_t, becaue this type is internal to libnpf and the kernel, not exported into public headers. llvm-svn: 345726
* Update generate_netbsd_ioctls.awk for NetBSD 8.99.25Kamil Rytarowski2018-10-311-127/+9
| | | | | | | Add dynamic detection of header files in /usr/include. Handle "nvlist_ref_t" needed by npf(4) ioctl(2) operations. llvm-svn: 345715
* Diable test suppressions-library for NetBSD/i386Kamil Rytarowski2018-10-311-0/+1
| | | | | | This is a part of the ASan test-suite. llvm-svn: 345707
* [asan] Remove stale -fno-exceptions flag in sanitizer_common as wellReid Kleckner2018-10-311-5/+0
| | | | llvm-svn: 345685
* [asan] Remove flags for clang-cl before it supported EHReid Kleckner2018-10-313-16/+0
| | | | | | | Also remove -Wno-undefined-inline, which needed to work around PR19898, which was fixed. llvm-svn: 345677
* Disable BufferOverflowAfterManyFrees for NetBSDKamil Rytarowski2018-10-301-0/+2
| | | | | | This test hangs in the i386 mode. llvm-svn: 345666
* Mark breaking asan tests on NetBSDKamil Rytarowski2018-10-306-1/+9
| | | | | | | | | | | | Failing ones: - coverage-reset - coverage - dlclose-test - interception-in-shared-lib-test - stack-use-after-return - tsd_dtor_leak llvm-svn: 345663
* [NFC][compiler-rt] Cleanup Implicit Conversion Sanitizer tests to use sized ↵Roman Lebedev2018-10-3015-249/+257
| | | | | | | | | | | | | | | | | | types Summary: As requested by @filcab in https://reviews.llvm.org/D50251#1280267 Reviewers: filcab, vsk, #sanitizers, vitalybuka Reviewed By: filcab, #sanitizers, vitalybuka Subscribers: vitalybuka, kubamracek, dberris, llvm-commits, filcab Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D53869 llvm-svn: 345661
* [compiler-rt][ubsan] Implicit Conversion Sanitizer - integer sign change - ↵Roman Lebedev2018-10-3016-3/+892
| | | | | | | | | | | | | | | | | | | | | | compiler-rt part Summary: This is a compiler-rt part. The clang part is D50250. See [[ https://bugs.llvm.org/show_bug.cgi?id=21530 | PR21530 ]], https://github.com/google/sanitizers/issues/940. Reviewers: vsk, filcab, #sanitizers Reviewed By: filcab, #sanitizers Subscribers: mclow.lists, srhines, kubamracek, dberris, rjmccall, rsmith, llvm-commits, regehr Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D50251 llvm-svn: 345659
* [GCOV] Make test path generic so it passes on all machinesMarco Castelluccio2018-10-301-1/+1
| | | | llvm-svn: 345656
* Switch getline_nohang from XFAIL to UNSUPPORTED for NetBSDKamil Rytarowski2018-10-301-2/+2
| | | | | | This test sometimes works, usually breaks. llvm-svn: 345655
* Mark vptr-non-unique-typeinfo as a broken test for NetBSD/i386Kamil Rytarowski2018-10-301-0/+1
| | | | llvm-svn: 345654
* Mark breaking sanitizer_common tests on NetBSDKamil Rytarowski2018-10-304-0/+7
| | | | | | | | | | Set XFAIL with appropriate configuration for: - NetBSD/getgroupmembership - Posix/dedup_token_length_test - Posix/readlinkat - get_module_and_offset_for_pc llvm-svn: 345651
* [builtins] Re-enable x86-only long double testsReid Kleckner2018-10-302-1/+13
| | | | | | | | | | | | | | | | | | | Summary: In r81552, the HAS_80_BIT_LONG_DOUBLE macro was added to the unit test only version of int_lib.h. One month later in r85260 the duplicate int_lib.h was removed, but the tests still passed because we don't build with -Werror. This is the minimal change to bring it back, and I decided to put the configuration macro next to our 128-bit integer support macro. Reviewers: joerg, compnerd, mstorsjo Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53838 llvm-svn: 345645
* [CMake] Check -ffreestanding as C not C++ flagPetr Hosek2018-10-301-1/+1
| | | | | | | | | | | When -ffreestanding is used, main() isn't considered special and when compiled as C++ code it'll get mangled which makes the compilation fail since main() will be undefined so this check will never succeed. Differential Revision: https://reviews.llvm.org/D49332 llvm-svn: 345632
* Handle NetBSD alias for pthread_sigmaskKamil Rytarowski2018-10-302-0/+7
| | | | | | | | | | | | | | | | | | | | | Summary: Add a new helper macro TSAN_INTERCEPTOR_NETBSD_ALIAS_THR2 that handles pthread(3)/libc aliases in scenarios when a name in both libraries differs not just in prefix namespace. Handle TSan pthread_sigmask mangling accordingly into __libc_thr_sigsetmask. Reviewers: vitalybuka, joerg Reviewed By: vitalybuka Subscribers: kubamracek, jfb, llvm-commits, #sanitizers, mgorny Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D53863 llvm-svn: 345627
* [GCOV] Add a test for function defined on one line (follow-up of ↵Calixte Denizet2018-10-303-0/+36
| | | | | | | | | | | | | | | | https://reviews.llvm.org/D53600) Summary: Add a test for coverage for function definition like void foo() { }. Reviewers: marco-c Reviewed By: marco-c Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D53601 llvm-svn: 345625
* Cast the return value of _Unwind_GetIP() to uptrKamil Rytarowski2018-10-301-1/+1
| | | | | | | This is needed for NetBSD to match the expected type in Unwind_GetIP(). llvm-svn: 345620
* Mark interception_failure_test with XFAIL for NetBSDKamil Rytarowski2018-10-301-1/+1
| | | | | | This test breaks also on FreeBSD. llvm-svn: 345619
* Disable ASan test asan_and_llvm_coverage_test for NetBSDKamil Rytarowski2018-10-301-0/+3
| | | | | | Right now the LLVM profile feature is turned off for this OS. llvm-svn: 345600
* Adapt ASan test heavy_uar_test for NetBSDKamil Rytarowski2018-10-301-2/+2
| | | | | | | | The stack size is tight for the main thread in multithread environment and follow the FreeBSD approach of reducing stack usage. llvm-svn: 345599
* Mark breaking TSan tests on NetBSD with XFAILKamil Rytarowski2018-10-303-1/+5
| | | | | | | | | Failing tests: - dtls - ignored-interceptors-mmap - mutex_lock_destroyed llvm-svn: 345595
* Cleanup includes in sanitizer_platform_limits_netbsd.ccKamil Rytarowski2018-10-301-105/+119
| | | | | | | | Sort the headers more correctly according to NetBSD style. Prevent in this code part clang-format, as shuffling the order will cause build failures. llvm-svn: 345586
* Regenerate syscall hooks for NetBSD 8.99.25Kamil Rytarowski2018-10-302-45/+39
| | | | | | | | | | Register new syscall getsockopt2. Drop removed syscalls pmc_get_info and pmc_control. While there address compiler warnings about potentially unused variables. llvm-svn: 345582
* Update generate_netbsd_syscalls.awk for NetBSD 8.99.25Kamil Rytarowski2018-10-301-8/+4
| | | | | | | | | | Register new syscall getsockopt2. Drop removed syscalls pmc_get_info and pmc_control. While there address compiler warnings about potentially unused variables. llvm-svn: 345580
* Handle pthread_sigmask in DemangleFunctionName()Kamil Rytarowski2018-10-301-0/+2
| | | | | | Translate __libc_thr_sigsetmask to pthread_sigmask on NetBSD. llvm-svn: 345574
* Drop now hidden ioctl(2) operations for NetBSDKamil Rytarowski2018-10-301-11/+7
| | | | | | POWER_IOC_GET_TYPE_WITH_LOSSAGE is no longer accessible from userland. llvm-svn: 345572
* Handle NetBSD symbol mangling for tzsetKamil Rytarowski2018-10-301-0/+1
| | | | | | | | Native code generated on NetBSD mangles tzet to __tzset50. Handle this accordingly in MSan. llvm-svn: 345571
* Handle NetBSD symbol mangling for nanosleep and vforkKamil Rytarowski2018-10-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | Summary: Native code generated on NetBSD mangles: - vfork into __vfork14 - nanosleep into __nanosleep50 Handle this accordingly in TSan. Reviewers: vitalybuka, dvyukov, joerg Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers, mgorny Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D53806 llvm-svn: 345570
* [XRay] Migrate FDR runtime to use refactored controllerDean Michael Berris2018-10-303-650/+238
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change completes the refactoring of the FDR runtime to support the following: - Generational buffer management. - Centralised and well-tested controller implementation. In this change we've had to: - Greatly simplify the code in xray_fdr_logging.cc to only implement the glue code for calling into the controller. - Implement the custom and typed event logging functions in the FDRLogWriter. - Imbue the `XRAY_NEVER_INSTRUMENT` attribute onto all functions in the controller implementation. Reviewers: mboerger, eizan, jfb Subscribers: jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D53858 llvm-svn: 345568
* [ubsan-minimal] update comments in CMakeLists.txtVitaly Buka2018-10-301-5/+3
| | | | | | | | | | | | | | | | | Summary: Prepend minimal when UBsan is mentioned and delete a dead comment Patch by Igor Sugak Reviewers: eugenis, pcc Reviewed By: eugenis Subscribers: mgorny, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D53826 llvm-svn: 345557
* [sanitizer] Move interceptor initialization check into real_clock_gettimeVitaly Buka2018-10-302-5/+4
| | | | | | | | | | Reviewers: cryptoad, kubamracek Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53777 llvm-svn: 345556
* [compiler-rt][builtins] Don't #include CoreFoundation in os_version_check.cErik Pilkington2018-10-291-8/+33
| | | | | | | | | | This breaks some configurations, so just forward declare everything that we need. rdar://35943793 Differential revision: https://reviews.llvm.org/D50269 llvm-svn: 345551
OpenPOWER on IntegriCloud