[llvm-branch-commits] [compiler-rt] release/19.x: [sanitizer_common] Don't use syscall(SYS_clone) on Linux/sparc64 (#100534) (PR #101137)

Fangrui Song via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Fri Aug 2 10:53:51 PDT 2024


================
@@ -826,10 +826,16 @@ uptr internal_sigaltstack(const void *ss, void *oss) {
   return internal_syscall(SYSCALL(sigaltstack), (uptr)ss, (uptr)oss);
 }
 
+extern "C" pid_t __fork(void);
+
 int internal_fork() {
 #    if SANITIZER_LINUX
 #      if SANITIZER_S390
   return internal_syscall(SYSCALL(clone), 0, SIGCHLD);
+#      elif SANITIZER_SPARC
+  // The clone syscall interface on SPARC differs massively from the rest,
+  // so fall back to __fork.
+  return __fork();
----------------
MaskRay wrote:

Does the `return internal_syscall(SYSCALL(fork));` code path work for sparc64?

https://github.com/llvm/llvm-project/pull/101137


More information about the llvm-branch-commits mailing list