summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [hwasan] Remove dead code.Evgeniy Stepanov2018-11-095-74/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346452 91177308-0d34-0410-b5e6-96231b3b80d8
* Introduce `sanitizer_malloc_introspect_t` for Darwin which is a sub-class of ↵Dan Liew2018-11-081-1/+23
| | | | | | | | | | | | | | | | | | | | | | Darwin's `malloc_introspection_t` and use it when setting up the malloc zone. Summary: Currently `sanitizer_malloc_introspection_t` just adds a version field which is used to version the allocator ABI. The current allocator ABI version is returned by the new `GetMallocZoneAllocatorEnumerationVersion()` function. The motivation behind this change is to allow external processes to determine the allocator ABI of a sanitized process. rdar://problem/45284065 Reviewers: kubamracek, george.karpenkov, vitalybuka Subscribers: #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D54045 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346420 91177308-0d34-0410-b5e6-96231b3b80d8
* [Profile] The test for gcov-fork seems to be ok on armCalixte Denizet2018-11-081-2/+0
| | | | | | | | | | | | | | Summary: Remove the XFAIL for arm since it seems to be ok Reviewers: marco-c Reviewed By: marco-c Subscribers: javed.absar, kristof.beyls, delcypher, chrib, llvm-commits, #sanitizers, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D54263 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346409 91177308-0d34-0410-b5e6-96231b3b80d8
* Split lgammal() from INIT_LGAMMALKamil Rytarowski2018-11-072-4/+12
| | | | | | | | | | | | | | | | | | | | | | Summary: Introduce SANITIZER_INTERCEPT_LGAMMAL dedicated for lgammal(). Disable it for NetBSD as this routine is not implemented in this OS. Installation of supernumerary interceptors causes leaking of errors to dlsym(3)-like operations. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54054 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346352 91177308-0d34-0410-b5e6-96231b3b80d8
* Split remquol() from INIT_REMQUOKamil Rytarowski2018-11-072-4/+12
| | | | | | | | | | | | | | | | | | | | | | Summary: Introduce SANITIZER_INTERCEPT_REMQUOL dedicated for remquol(). Disable for for NetBSD as this routine is not implemented in this OS. Installation of supernumerary interceptors causes leaking of errors to dlsym(3)-like operations. Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54051 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346351 91177308-0d34-0410-b5e6-96231b3b80d8
* [CMake][ASan][HWASan] Set an explicit dependency on libc++ headersPetr Hosek2018-11-072-12/+32
| | | | | | | | | | | | | | We have seen failing builds due to a race condition between RTAsan_dynamic and libc++ headers builds, specifically libc++ headers depend on __config and if this header hasn't been copied into the final location, including other headers will typically result in failure. To avoid this race, we add an explicit dependency on libc++ headers which ensures that they've been copied into place before the sanitizer object library build starts. Differential Revision: https://reviews.llvm.org/D54198 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346339 91177308-0d34-0410-b5e6-96231b3b80d8
* [Profile] Mark gcov-fork test as failing for armCalixte Denizet2018-11-071-0/+2
| | | | | | | | | | | | | | Summary: instrprof-gcov-fork.test is failing with arm so mark it as XFAIL Reviewers: marco-c Reviewed By: marco-c Subscribers: javed.absar, kristof.beyls, delcypher, chrib, llvm-commits, sylvestre.ledru, #sanitizers Differential Revision: https://reviews.llvm.org/D54209 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346329 91177308-0d34-0410-b5e6-96231b3b80d8
* [Profile] Fix fork test and add tests for execlp and execvp after patch ↵Calixte Denizet2018-11-078-4/+102
| | | | | | | | | | | | | | | | https://reviews.llvm.org/D53593 Summary: This is a follow-up of patch https://reviews.llvm.org/D53593 Reviewers: marco-c Reviewed By: marco-c Subscribers: delcypher, llvm-commits, #sanitizers, sylvestre.ledru Differential Revision: https://reviews.llvm.org/D54167 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346314 91177308-0d34-0410-b5e6-96231b3b80d8
* [GCOV] Close file mapping handle on Windows, so flushed gcda files can be ↵Marco Castelluccio2018-11-076-8/+104
| | | | | | removed while the process is in execution git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346300 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay] Use TSC delta encoding for custom/typed eventsDean Michael Berris2018-11-073-69/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change updates the version number for FDR logs to 5, and update the trace processing to support changes in the custom event records. In the runtime, since we're already writing down the record preamble to handle CPU migrations and TSC wraparound, we can use the same TSC delta encoding in the custom event and typed event records that we use in function event records. We do the same change to typed events (which were unsupported before this change in the trace processing) which now show up in the trace. Future changes should increase our testing coverage to make custom and typed events as first class entities in the FDR mode log processing tools. This change is also a good example of how we end up supporting new record types in the FDR mode implementation. This shows the places where new record types are added and supported. Depends on D54139. Reviewers: mboerger Subscribers: hiraditya, arphaman, jfb, llvm-commits Differential Revision: https://reviews.llvm.org/D54140 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346293 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Only set soft coredump limit.Evgeniy Stepanov2018-11-072-4/+6
| | | | | | | | | | | | Summary: If user wants to raise it back, let them. Reviewers: kcc, vitalybuka Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D54190 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346284 91177308-0d34-0410-b5e6-96231b3b80d8
* [fuzzer] Read files as binaryJonathan Metzman2018-11-064-3/+28
| | | | | | | | | | | | Summary: Read corpus files as binary to avoid automatic conversions Reviewers: Dor1s, morehouse Reviewed By: Dor1s, morehouse Differential Revision: https://reviews.llvm.org/D54180 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346279 91177308-0d34-0410-b5e6-96231b3b80d8
* [Darwin] Export new weak external symbols when compiling with coverageVedant Kumar2018-11-061-0/+8
| | | | | | | | | | | Some weak external symbols were added to the profile runtime in D49953, and on Darwin, these need to be exported for tapi verification purposes. I've tightened the test so that future breakages can be caught earlier. rdar://45831054 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346276 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Return headed to fix build after r346258Vitaly Buka2018-11-061-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346270 91177308-0d34-0410-b5e6-96231b3b80d8
* [dfsan] Fix build after r346262Benjamin Kramer2018-11-061-1/+1
| | | | | | | | | | | | | | compiler-rt/lib/dfsan/dfsan.cc:426:3: error: call to 'InitializePlatformEarly' is ambiguous InitializePlatformEarly(); ^~~~~~~~~~~~~~~~~~~~~~~ compiler-rt/lib/dfsan/../sanitizer_common/sanitizer_common.h:901:6: note: candidate function void InitializePlatformEarly(); ^ compiler-rt/lib/dfsan/dfsan.cc:391:13: note: candidate function static void InitializePlatformEarly() { ^ git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346264 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Use "fast mmap" kernel flag for shadow memory on macOS 10.13.4+Kuba Mracek2018-11-068-2/+38
| | | | | | | | | | This speeds up process startup and teardown and also reduces lock contention when running multiple ASanified/TSanified processes simultaneously. Should greatly improve lit testing time. Differential Revision: https://reviews.llvm.org/D48445 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346262 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Fix nolibc unittests broken by r346215Vitaly Buka2018-11-062-30/+36
| | | | | | | | Subscribers: kubamracek, krytarowski, fedor.sergeev, llvm-commits Differential Revision: https://reviews.llvm.org/D54163 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346258 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Add char **GetEnviron() on all other platformsVitaly Buka2018-11-066-3/+21
| | | | | | | | Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D54165 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346257 91177308-0d34-0410-b5e6-96231b3b80d8
* Adapt UBSan integer truncation tests to NetBSDKamil Rytarowski2018-11-0610-198/+198
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The NetBSD headers use internal indirect type for standard *int*_t definitions. The internal type is unrolled inside the sanitizer into e.g. __int32_t from int32_t. This symbol mangling causes pattern mismatch in the interger truncation tests as they expect exact types such as 'int32_t'. Change the pattern rules so every acceptable internal form of *int*_t will be accepted flawlessly. Reviewers: lebedev.ri, vitalybuka, joerg Reviewed By: lebedev.ri Subscribers: kubamracek, dmgreen, llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54150 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346228 91177308-0d34-0410-b5e6-96231b3b80d8
* Prioritize the constructor call of __local_xray_dyninit()Kamil Rytarowski2018-11-061-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: For platforms without preinit support (such as NetBSD/amd64) the initialization routine __xray_init() was called in non-deterministic order compared to other constructors. This caused breakage failures as xray routines attempted to execute code with assumption of being initialized, which was no always true. Use GCC/Clang extension to set maximal priority to the constructor calling __xray_init(). This code switches away from C++ lambda form, as it did not allow to specify this compiler extension. Reviewers: dberris, joerg Reviewed By: dberris Subscribers: llvm-commits, mgorny, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D54136 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346222 91177308-0d34-0410-b5e6-96231b3b80d8
* [sanitizer] Use AT_EXECFN in ReExec() if availableBenjamin Kramer2018-11-062-0/+27
| | | | | | | | | | execve("/proc/self/exe") will not work if the binary relies on $EXEC_ORIGIN in an rpath. Query AT_EXECFN instead, which will give the same string that the current binary was exec'd with. Differential Revision: https://reviews.llvm.org/D54113 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346215 91177308-0d34-0410-b5e6-96231b3b80d8
* [XRay] Update XRayRecord to support Custom/Typed EventsDean Michael Berris2018-11-067-34/+41
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change cuts across LLVM and compiler-rt to add support for rendering custom events in the XRayRecord type, to allow for including user-provided annotations in the output YAML (as raw bytes). This work enables us to add custom event and typed event records into the `llvm::xray::Trace` type for user-provided events. This can then be programmatically handled through the C++ API and can be included in some of the tooling as well. For now we support printing the raw data we encounter in the custom events in the converted output. Future work will allow us to start interpreting these custom and typed events through a yet-to-be-defined API for extending the trace analysis library. Reviewers: mboerger Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D54139 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346214 91177308-0d34-0410-b5e6-96231b3b80d8
* Disable XRay test fork_basic_logging for NetBSDKamil Rytarowski2018-11-061-0/+3
| | | | | | | This code has not been ported so far. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346196 91177308-0d34-0410-b5e6-96231b3b80d8
* Follow Windows' approach for NetBSD in AlarmCallback()Kamil Rytarowski2018-11-061-1/+2
| | | | | | | | NetBSD's current behavior needs to ignore check for InFuzzingThread() in Fuzzer::AlarmCallback(). git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346194 91177308-0d34-0410-b5e6-96231b3b80d8
* [libFuzzer] Disable value-profile-cmp.test and fuzzer-oom.test on ARM64George Karpenkov2018-11-063-4/+3
| | | | | | | | | | value-profile-cmp was always flaky, and OOM fails to work in some environments. counters.test fails when vectorization is enabled, and it is more likely to kick in when compiling for ARM. Differential Revision: https://reviews.llvm.org/D54004 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346193 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizers] Disable SANITIZER_CAN_FAST_UNWIND on all SPARC targetsRainer Orth2018-11-052-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While testing my to-be-submitted Solaris sanitizer support on gcc mainline, I ran into an issue on Solaris/SPARC (sparc-sun-solaris2.11). Initially libasan.so failed to link: Undefined first referenced symbol in file __sanitizer::BufferedStackTrace::FastUnwindStack(unsigned long, unsigned long, unsigned long, unsigned long, unsigned int) /var/gcc/gcc-9.0.0-20181024/11.5-gcc-gas/sparc-sun-solaris2.11/./libsanitizer/asan/.libs/libasan.so This happens because SANITIZER_CAN_FAST_UNWIND is enabled on non-Linux SPARC targets (cf. sanitizer_stacktrace.h), but the guard around the SPARCv8-only definition in sanitizer_stacktrace_sparc.cc only works with clang: clang predefines __sparcv8__ on non-Solaris, and __sparcv8 only on Solaris gcc predefines __sparcv8 on Solaris, but __sparc_v8__ on non-Solaris The attached patch allows for all three variants. However, disabling SANITIZER_CAN_FAST_UNWIND on all SPARC targets fixes a couple of testsuite failures in the Solaris asan testsuite, so for now it's better to keep it disabled everywhere. This allowed the libsanitizer build to complete and gave reasonable (though slightly worse than on Solaris/x86) testsuite results. Differential Revision: https://reviews.llvm.org/D54099 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346155 91177308-0d34-0410-b5e6-96231b3b80d8
* [Sanitizers] Solaris largefile fixesRainer Orth2018-11-054-19/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | While testing the Solaris libsanitizer port on GCC mainline, I found that I'd messed up the largefile checks in various ways, some of which showed as compile failures (wrong structure sizes and member offsets), others at runtime, some of those only on sparc as a big-endian target. This patch fixes all of them: - OFF_T is now correctly defined for 32-bit largefile and traditional environments, and 64-bit. - The definition of __sanitizer_dirent now checks the correct conditionals. - sanitizer_procmaps_solaris.cc undefines _FILE_OFFSET_BITS: before Solaris 11.4 <procfs.h> doesn't even compile with largefile support enabled, but the use at hand doesn't need it anyway while g++ 9 will define _FILE_OFFSET_BITS=64 out of the box. - With full largefile support enabled, one needs to use e.g. mmap64 instead of mmap; this is hidden behind macros. With this patch I could bootstrap gcc mainline on both sparc-sun-solaris2.11 and i386-pc-solaris2.11. In addition, I've successfully built llvm on i386-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D54101 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346153 91177308-0d34-0410-b5e6-96231b3b80d8
* [UBsan] disable few tests for FreeBSDDavid Carlier2018-11-052-0/+4
| | | | | | | | | | | Reviewers: krytarowsky, vitalybuka Reviewed By: vitalybuka Differential Revision: https://reviews.llvm.org/D54103 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346145 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix build on sparc64-linux-gnu.Martin Liska2018-11-051-2/+2
| | | | | | | Differential Revision: https://reviews.llvm.org/D54030 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346129 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346120 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346116 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346098 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346063 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346052 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346051 91177308-0d34-0410-b5e6-96231b3b80d8
* 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( git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346042 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346038 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@346030 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345983 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345954 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345905 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345798 91177308-0d34-0410-b5e6-96231b3b80d8
* 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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345796 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345788 91177308-0d34-0410-b5e6-96231b3b80d8
* [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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345765 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345726 91177308-0d34-0410-b5e6-96231b3b80d8
* 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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345715 91177308-0d34-0410-b5e6-96231b3b80d8
* Diable test suppressions-library for NetBSD/i386Kamil Rytarowski2018-10-311-0/+1
| | | | | | | This is a part of the ASan test-suite. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345707 91177308-0d34-0410-b5e6-96231b3b80d8
* [asan] Remove stale -fno-exceptions flag in sanitizer_common as wellReid Kleckner2018-10-311-5/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345685 91177308-0d34-0410-b5e6-96231b3b80d8
* [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. git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@345677 91177308-0d34-0410-b5e6-96231b3b80d8