[compiler-rt] b6df852 - tsan: fix fork syscall test
Dmitry Vyukov via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 30 01:23:39 PDT 2021
Author: Dmitry Vyukov
Date: 2021-04-30T10:23:34+02:00
New Revision: b6df85290118d17c1dddf412a1a44a83158133e3
URL: https://github.com/llvm/llvm-project/commit/b6df85290118d17c1dddf412a1a44a83158133e3
DIFF: https://github.com/llvm/llvm-project/commit/b6df85290118d17c1dddf412a1a44a83158133e3.diff
LOG: tsan: fix fork syscall test
Arm64 builders failed with:
error: use of undeclared identifier 'SYS_fork'
https://lab.llvm.org/buildbot/#/builders/7/builds/2575
Indeed, not all arches have fork syscall.
Implement fork via clone on these arches.
Differential Revision: https://reviews.llvm.org/D101603
Added:
Modified:
compiler-rt/test/tsan/Linux/fork_syscall.cpp
Removed:
################################################################################
diff --git a/compiler-rt/test/tsan/Linux/fork_syscall.cpp b/compiler-rt/test/tsan/Linux/fork_syscall.cpp
index 5930f42215f4c..2bfa1bb3cf3b0 100644
--- a/compiler-rt/test/tsan/Linux/fork_syscall.cpp
+++ b/compiler-rt/test/tsan/Linux/fork_syscall.cpp
@@ -16,7 +16,11 @@ static void *incrementer(void *p) {
int myfork() {
__sanitizer_syscall_pre_fork();
+#ifdef SYS_fork
int res = syscall(SYS_fork);
+#else
+ int res = syscall(SYS_clone, SIGCHLD, 0);
+#endif
__sanitizer_syscall_post_fork(res);
return res;
}
More information about the llvm-commits
mailing list