From f0292b57033ce2063c51f01fcd24937b81eb3699 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alex=20R=C3=B8nne=20Petersen?= Date: Sun, 9 Aug 2026 03:49:05 +0200 Subject: [PATCH] std.Thread: remove mips o32 workaround in LinuxThreadImpl.freeAndExit() Our minimum kernel version was released several years after this kernel bug was fixed. On top of that, it's a hacky workaround that depends on abicalls to work. Well past time to get rid of it. --- lib/std/Thread.zig | 5 ----- 1 file changed, 5 deletions(-) diff --git a/lib/std/Thread.zig b/lib/std/Thread.zig index bd3f9e1f019fea9de6f06b8da4df47cdf11eaa0a..473aa308f242cf1d24dc7b66d4e237fec6b7d03a 100644 --- a/lib/std/Thread.zig +++ b/lib/std/Thread.zig @@ -1275,12 +1275,7 @@ const LinuxThreadImpl = struct { : [ptr] "{r5}" (@intFromPtr(self.mapped.ptr)), [len] "{r6}" (self.mapped.len), ), - // We set `sp` to the address of the current function as a workaround for a Linux - // kernel bug that caused syscalls to return EFAULT if the stack pointer is invalid. - // The bug was introduced in 46e12c07b3b9603c60fc1d421ff18618241cb081 and fixed in - // 7928eb0370d1133d0d8cd2f5ddfca19c309079d5. .mips, .mipsel => asm volatile ( - \\ move $sp, $t9 \\ li $v0, 4091 # SYS_munmap \\ syscall \\ li $v0, 4001 # SYS_exit -- 2.54.0