summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
diff options
context:
space:
mode:
authorKostya Kortchinsky <kostyak@google.com>2017-12-11 21:03:12 +0000
committerKostya Kortchinsky <kostyak@google.com>2017-12-11 21:03:12 +0000
commitab5f6aaa7556e24322c7e3cfb60c6b1f367d3f8e (patch)
treef5e5ff477b5863261893435cee42ce1e5fa5ab63 /compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
parentd2481bed05976765f43f2780f898869828897aa4 (diff)
downloadbcm5719-llvm-ab5f6aaa7556e24322c7e3cfb60c6b1f367d3f8e.tar.gz
bcm5719-llvm-ab5f6aaa7556e24322c7e3cfb60c6b1f367d3f8e.zip
[sanitizer] Revert rL320409
Summary: D40679 broke a couple of builds, reverting while investigating. Reviewers: alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D41088 llvm-svn: 320417
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc')
-rw-r--r--compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc29
1 files changed, 0 insertions, 29 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
index 591cd87d290..c68f2146dd1 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_linux_libcdep.cc
@@ -707,35 +707,6 @@ void LogMessageOnPrintf(const char *str) {
#endif // SANITIZER_LINUX
-// glibc cannot use clock_gettime from a preinit_array function as the vDSO
-// function pointers haven't been initialized yet. To prevent a crash, we check
-// for the presence of the glibc symbol __vdso_clock_gettime, and verify that it
-// is not null (it can be mangled so we can't use it directly). Bionic's
-// clock_gettime actually falls back to the syscall in the same situation.
-extern "C" SANITIZER_WEAK_ATTRIBUTE void *__vdso_clock_gettime;
-bool CanUseLibcClockGetTime() {
- return !SANITIZER_FREEBSD && !SANITIZER_NETBSD &&
- (SANITIZER_ANDROID || (&__vdso_clock_gettime && __vdso_clock_gettime));
-}
-
-// MonotonicNanoTime is a timing function that can leverage the vDSO by calling
-// clock_gettime. real_clock_gettime only exists if clock_gettime is
-// intercepted, so define it weakly and use it if available.
-extern "C" SANITIZER_WEAK_ATTRIBUTE
-int real_clock_gettime(u32 clk_id, void *tp);
-u64 MonotonicNanoTime() {
- timespec ts;
- if (CanUseLibcClockGetTime()) {
- if (&real_clock_gettime)
- real_clock_gettime(CLOCK_MONOTONIC, &ts);
- else
- clock_gettime(CLOCK_MONOTONIC, &ts);
- } else {
- internal_clock_gettime(CLOCK_MONOTONIC, &ts);
- }
- return (u64)ts.tv_sec * (1000ULL * 1000 * 1000) + ts.tv_nsec;
-}
-
} // namespace __sanitizer
#endif // SANITIZER_FREEBSD || SANITIZER_LINUX
OpenPOWER on IntegriCloud