[PATCH] D105878: [sanitizer_common] Define internal_usleep on Solaris
Rainer Orth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 13 01:22:44 PDT 2021
ro created this revision.
ro added reviewers: dvyukov, vitalybuka.
ro added a project: Sanitizers.
Herald added subscribers: pengfei, fedor.sergeev.
ro requested review of this revision.
Herald added a subscriber: Sanitizers.
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.`
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D105878
Files:
compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
Index: compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
===================================================================
--- compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
+++ compiler-rt/lib/sanitizer_common/sanitizer_solaris.cpp
@@ -160,6 +160,13 @@
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, &ts);
+}
+
DECLARE__REAL_AND_INTERNAL(uptr, execve, const char *filename,
char *const argv[], char *const envp[]) {
return _REAL(execve)(filename, argv, envp);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D105878.358187.patch
Type: text/x-patch
Size: 670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210713/ffcc0e51/attachment.bin>
More information about the llvm-commits
mailing list