Skip to content

Commit e7703e8

Browse files
rorthmemfrob
authored andcommitted
[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
1 parent 97fcdab commit e7703e8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ DECLARE__REAL_AND_INTERNAL(uptr, sched_yield, void) {
160160
return sched_yield();
161161
}
162162

163+
DECLARE__REAL_AND_INTERNAL(void, usleep, u64 useconds) {
164+
struct timespec ts;
165+
ts.tv_sec = useconds / 1000000;
166+
ts.tv_nsec = (useconds % 1000000) * 1000;
167+
nanosleep(&ts, nullptr);
168+
}
169+
163170
DECLARE__REAL_AND_INTERNAL(uptr, execve, const char *filename,
164171
char *const argv[], char *const envp[]) {
165172
return _REAL(execve)(filename, argv, envp);

0 commit comments

Comments
 (0)