[compiler-rt] 4543098 - [sanitizer_common] Define internal_usleep on Solaris
Rainer Orth via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 13 02:15:47 PDT 2021
Author: Rainer Orth
Date: 2021-07-13T11:15:03+02:00
New Revision: 45430983ef8235f2a018e7daa10a0ad71ef7b85c
URL: https://github.com/llvm/llvm-project/commit/45430983ef8235f2a018e7daa10a0ad71ef7b85c
DIFF: https://github.com/llvm/llvm-project/commit/45430983ef8235f2a018e7daa10a0ad71ef7b85c.diff
LOG: [sanitizer_common] Define internal_usleep on Solaris
The Solaris/amd64 buildbot
<https://lab.llvm.org/staging/#/builders/101/builds/2845> has recently been
broken several times, at least one of those remains unfixed:
[63/446] Generating Sanitizer-x86_64-Test
[...]
Undefined first referenced
symbol in file
_ZN11__sanitizer15internal_usleepEy /opt/llvm-buildbot/home/solaris11-amd64/clang-solaris11-amd64/stage1/projects/compiler-rt/lib/sanitizer_common/tests/libRTSanitizerCommon.test.x86_64.a(sanitizer_common.cpp.o)
ld: fatal: symbol referencing errors
Thist patch fixes it by defining the missing `internal_usleep`.
Tested on `amd64-pc-solaris2.11.`
Differential Revision: https://reviews.llvm.org/D105878
Added:
Modified:
compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
Removed:
################################################################################
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
index c43c26dc615f..3e283d1c6106 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
@@ -160,6 +160,13 @@ DECLARE__REAL_AND_INTERNAL(uptr, sched_yield, void) {
return sched_yield();
}
+DECLARE__REAL_AND_INTERNAL(void, usleep, u64 useconds) {
+ struct timespec ts;
+ ts.tv_sec = useconds / 1000000;
+ ts.tv_nsec = (useconds % 1000000) * 1000;
+ nanosleep(&ts, nullptr);
+}
+
DECLARE__REAL_AND_INTERNAL(uptr, execve, const char *filename,
char *const argv[], char *const envp[]) {
return _REAL(execve)(filename, argv, envp);
More information about the llvm-commits
mailing list