Merge "Replaces vfork() implementation with fork()"
diff --git a/benchmarks/math_benchmark.cpp b/benchmarks/math_benchmark.cpp
index 3602de4..a9748cd 100644
--- a/benchmarks/math_benchmark.cpp
+++ b/benchmarks/math_benchmark.cpp
@@ -16,6 +16,7 @@
 
 #include "benchmark.h"
 
+#include <fenv.h>
 #include <math.h>
 
 // Avoid optimization.
@@ -113,10 +114,49 @@
 }
 BENCHMARK(BM_math_isinf_ZERO);
 
+static void BM_math_sin_fast(int iters) {
+  StartBenchmarkTiming();
 
+  d = 1.0;
+  for (int i = 0; i < iters; ++i) {
+    d += sin(d);
+  }
 
+  StopBenchmarkTiming();
+}
+BENCHMARK(BM_math_sin_fast);
 
+static void BM_math_sin_feupdateenv(int iters) {
+  StartBenchmarkTiming();
 
+  d = 1.0;
+  for (int i = 0; i < iters; ++i) {
+    fenv_t __libc_save_rm;
+    feholdexcept(&__libc_save_rm);
+    fesetround(FE_TONEAREST);
+    d += sin(d);
+    feupdateenv(&__libc_save_rm);
+  }
+
+  StopBenchmarkTiming();
+}
+BENCHMARK(BM_math_sin_feupdateenv);
+
+static void BM_math_sin_fesetenv(int iters) {
+  StartBenchmarkTiming();
+
+  d = 1.0;
+  for (int i = 0; i < iters; ++i) {
+    fenv_t __libc_save_rm;
+    feholdexcept(&__libc_save_rm);
+    fesetround(FE_TONEAREST);
+    d += sin(d);
+    fesetenv(&__libc_save_rm);
+  }
+
+  StopBenchmarkTiming();
+}
+BENCHMARK(BM_math_sin_fesetenv);
 
 static void BM_math_fpclassify_NORMAL(int iters) {
   StartBenchmarkTiming();
diff --git a/benchmarks/time_benchmark.cpp b/benchmarks/time_benchmark.cpp
index 75132e5..3bf8c07 100644
--- a/benchmarks/time_benchmark.cpp
+++ b/benchmarks/time_benchmark.cpp
@@ -35,4 +35,17 @@
   StopBenchmarkTiming();
 }
 BENCHMARK(BM_time_localtime_tz);
+
 #endif
+
+static void BM_time_clock_gettime(int iters) {
+  StartBenchmarkTiming();
+
+  struct timespec t;
+  for (int i = 0; i < iters; ++i) {
+    clock_gettime(CLOCK_MONOTONIC, &t);
+  }
+
+  StopBenchmarkTiming();
+}
+BENCHMARK(BM_time_clock_gettime);
diff --git a/benchmarks/unistd_benchmark.cpp b/benchmarks/unistd_benchmark.cpp
index 12b788a..f2c9d73 100644
--- a/benchmarks/unistd_benchmark.cpp
+++ b/benchmarks/unistd_benchmark.cpp
@@ -16,6 +16,7 @@
 
 #include "benchmark.h"
 
+#include <sys/syscall.h>
 #include <unistd.h>
 
 static void BM_unistd_getpid(int iters) {
@@ -39,3 +40,14 @@
   StopBenchmarkTiming();
 }
 BENCHMARK(BM_unistd_gettid);
+
+static void BM_unistd_gettid_syscall(int iters) {
+  StartBenchmarkTiming();
+
+  for (int i = 0; i < iters; ++i) {
+    syscall(__NR_gettid);
+  }
+
+  StopBenchmarkTiming();
+}
+BENCHMARK(BM_unistd_gettid_syscall);
diff --git a/libc/Android.mk b/libc/Android.mk
index 3512771..cd5cb02 100644
--- a/libc/Android.mk
+++ b/libc/Android.mk
@@ -54,7 +54,6 @@
     bionic/initgroups.c \
     bionic/ioctl.c \
     bionic/isatty.c \
-    bionic/md5.c \
     bionic/memmem.c \
     bionic/pathconf.c \
     bionic/ptsname.c \
@@ -271,7 +270,6 @@
     upstream-netbsd/lib/libc/gen/nice.c \
     upstream-netbsd/lib/libc/gen/popen.c \
     upstream-netbsd/lib/libc/gen/psignal.c \
-    upstream-netbsd/lib/libc/gen/setjmperr.c \
     upstream-netbsd/lib/libc/gen/utime.c \
     upstream-netbsd/lib/libc/gen/utmp.c \
     upstream-netbsd/lib/libc/isc/ev_streams.c \
diff --git a/libc/SYSCALLS.TXT b/libc/SYSCALLS.TXT
index b496357..9389c9c 100644
--- a/libc/SYSCALLS.TXT
+++ b/libc/SYSCALLS.TXT
@@ -128,12 +128,7 @@
 ssize_t     flistxattr(int, char*, size_t) all
 int         fremovexattr(int, const char*) all
 
-# mips64 doesn't have getdents64 until 3.10 kernels.
-# We need this special-case hack as long as we need to support mips64 on older kernels.
-# The currently-available Debian qemu image is on a 3.2 kernel.
-int getdents:getdents64(unsigned int, struct dirent*, unsigned int)   arm,arm64,mips,x86,x86_64
-int __getdents64:getdents64(unsigned int, struct dirent*, unsigned int)   mips64
-int __getdents:getdents(unsigned int, void*, unsigned int)   mips64
+int __getdents64:getdents64(unsigned int, struct dirent*, unsigned int)   arm,arm64,mips,mips64,x86,x86_64
 
 int __openat:openat(int, const char*, int, mode_t) all
 int faccessat(int, const char*, int, int)  all
diff --git a/libc/arch-arm/bionic/__bionic_clone.S b/libc/arch-arm/bionic/__bionic_clone.S
index 2643ae0..48f2f98 100644
--- a/libc/arch-arm/bionic/__bionic_clone.S
+++ b/libc/arch-arm/bionic/__bionic_clone.S
@@ -60,10 +60,10 @@
     b       __set_errno
 
 1:  # The child.
-    # Setting lr to 0 will make the unwinder stop at __bionic_clone_entry
+    # Setting lr to 0 will make the unwinder stop at __start_thread
     mov    lr, #0
     ldr    r0, [sp, #-4]
     ldr    r1, [sp, #-8]
-    b      __bionic_clone_entry
+    b      __start_thread
 END(__bionic_clone)
 .hidden __bionic_clone
diff --git a/libc/arch-arm/syscalls/getdents.S b/libc/arch-arm/syscalls/__getdents64.S
similarity index 86%
rename from libc/arch-arm/syscalls/getdents.S
rename to libc/arch-arm/syscalls/__getdents64.S
index 8f0e81a..c3d5e5b 100644
--- a/libc/arch-arm/syscalls/getdents.S
+++ b/libc/arch-arm/syscalls/__getdents64.S
@@ -2,7 +2,7 @@
 
 #include <private/bionic_asm.h>
 
-ENTRY(getdents)
+ENTRY(__getdents64)
     mov     ip, r7
     ldr     r7, =__NR_getdents64
     swi     #0
@@ -11,4 +11,4 @@
     bxls    lr
     neg     r0, r0
     b       __set_errno
-END(getdents)
+END(__getdents64)
diff --git a/libc/arch-arm64/bionic/__bionic_clone.S b/libc/arch-arm64/bionic/__bionic_clone.S
index d3c0374..74db4b5 100644
--- a/libc/arch-arm64/bionic/__bionic_clone.S
+++ b/libc/arch-arm64/bionic/__bionic_clone.S
@@ -31,12 +31,6 @@
 // pid_t __bionic_clone(int flags, void* child_stack, pid_t* parent_tid, void* tls, pid_t* child_tid, int (*fn)(void*), void* arg);
 
 ENTRY(__bionic_clone)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     # Copy 'fn' and 'arg' onto the child stack.
     stp     x5, x6, [x1, #-16]
 
@@ -47,11 +41,6 @@
     # Are we the child?
     cbz     x0, .L_bc_child
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     # Set errno if something went wrong.
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
@@ -62,10 +51,10 @@
 .L_bc_child:
     # We're in the child now. Set the end of the frame record chain...
     mov     x29, xzr
-    # Setting x30 to 0 will make the unwinder stop at __bionic_clone_entry
+    # Setting x30 to 0 will make the unwinder stop at __start_thread
     mov     x30, xzr
-    # ...and call __bionic_clone_entry with the 'fn' and 'arg' we stored on the child stack.
+    # ...and call __start_thread with the 'fn' and 'arg' we stored on the child stack.
     ldp     x0, x1, [sp, #-16]
-    b       __bionic_clone_entry
+    b       __start_thread
 END(__bionic_clone)
 .hidden __bionic_clone
diff --git a/libc/arch-arm64/bionic/syscall.S b/libc/arch-arm64/bionic/syscall.S
index 42e8883..658af78 100644
--- a/libc/arch-arm64/bionic/syscall.S
+++ b/libc/arch-arm64/bionic/syscall.S
@@ -29,13 +29,6 @@
 #include <private/bionic_asm.h>
 
 ENTRY(syscall)
-    /* create AAPCS frame pointer */
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     /* Move syscall No. from x0 to x8 */
     mov     x8, x0
     /* Move syscall parameters from x1 thru x6 to x0 thru x5 */
@@ -47,11 +40,6 @@
     mov     x5, x6
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     /* check if syscall returned successfully */
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
diff --git a/libc/arch-arm64/syscalls/__accept4.S b/libc/arch-arm64/syscalls/__accept4.S
index 34f2c52..1c2a674 100644
--- a/libc/arch-arm64/syscalls/__accept4.S
+++ b/libc/arch-arm64/syscalls/__accept4.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__accept4)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_accept4
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__brk.S b/libc/arch-arm64/syscalls/__brk.S
index fb63fb9..85ed767 100644
--- a/libc/arch-arm64/syscalls/__brk.S
+++ b/libc/arch-arm64/syscalls/__brk.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__brk)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_brk
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__connect.S b/libc/arch-arm64/syscalls/__connect.S
index e578ccc..0d664f0 100644
--- a/libc/arch-arm64/syscalls/__connect.S
+++ b/libc/arch-arm64/syscalls/__connect.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__connect)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_connect
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__epoll_pwait.S b/libc/arch-arm64/syscalls/__epoll_pwait.S
index 57b01c2..45275c0 100644
--- a/libc/arch-arm64/syscalls/__epoll_pwait.S
+++ b/libc/arch-arm64/syscalls/__epoll_pwait.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__epoll_pwait)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_epoll_pwait
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__exit.S b/libc/arch-arm64/syscalls/__exit.S
index 8600b13..e358513 100644
--- a/libc/arch-arm64/syscalls/__exit.S
+++ b/libc/arch-arm64/syscalls/__exit.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__exit)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_exit
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__getcpu.S b/libc/arch-arm64/syscalls/__getcpu.S
index e81ba23..5e4368f 100644
--- a/libc/arch-arm64/syscalls/__getcpu.S
+++ b/libc/arch-arm64/syscalls/__getcpu.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__getcpu)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getcpu
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__getcwd.S b/libc/arch-arm64/syscalls/__getcwd.S
index fc48f80..bd4fbaa 100644
--- a/libc/arch-arm64/syscalls/__getcwd.S
+++ b/libc/arch-arm64/syscalls/__getcwd.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__getcwd)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getcwd
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__getdents64.S b/libc/arch-arm64/syscalls/__getdents64.S
new file mode 100644
index 0000000..bf0f9a4
--- /dev/null
+++ b/libc/arch-arm64/syscalls/__getdents64.S
@@ -0,0 +1,15 @@
+/* Generated by gensyscalls.py. Do not edit. */
+
+#include <private/bionic_asm.h>
+
+ENTRY(__getdents64)
+    mov     x8, __NR_getdents64
+    svc     #0
+
+    cmn     x0, #(MAX_ERRNO + 1)
+    cneg    x0, x0, hi
+    b.hi    __set_errno
+
+    ret
+END(__getdents64)
+.hidden __getdents64
diff --git a/libc/arch-arm64/syscalls/__getpriority.S b/libc/arch-arm64/syscalls/__getpriority.S
index 486ea8f..57ceabf 100644
--- a/libc/arch-arm64/syscalls/__getpriority.S
+++ b/libc/arch-arm64/syscalls/__getpriority.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__getpriority)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getpriority
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__ioctl.S b/libc/arch-arm64/syscalls/__ioctl.S
index 30ff73c..f632555 100644
--- a/libc/arch-arm64/syscalls/__ioctl.S
+++ b/libc/arch-arm64/syscalls/__ioctl.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__ioctl)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_ioctl
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__openat.S b/libc/arch-arm64/syscalls/__openat.S
index 22e2f6a..e1b0da3 100644
--- a/libc/arch-arm64/syscalls/__openat.S
+++ b/libc/arch-arm64/syscalls/__openat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__openat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_openat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__ppoll.S b/libc/arch-arm64/syscalls/__ppoll.S
index 1739dea..31e5578 100644
--- a/libc/arch-arm64/syscalls/__ppoll.S
+++ b/libc/arch-arm64/syscalls/__ppoll.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__ppoll)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_ppoll
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__pselect6.S b/libc/arch-arm64/syscalls/__pselect6.S
index 2770164..b0e4770 100644
--- a/libc/arch-arm64/syscalls/__pselect6.S
+++ b/libc/arch-arm64/syscalls/__pselect6.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__pselect6)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_pselect6
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__ptrace.S b/libc/arch-arm64/syscalls/__ptrace.S
index 3746530..054bb6f 100644
--- a/libc/arch-arm64/syscalls/__ptrace.S
+++ b/libc/arch-arm64/syscalls/__ptrace.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__ptrace)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_ptrace
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__reboot.S b/libc/arch-arm64/syscalls/__reboot.S
index b1ea418..e24553c 100644
--- a/libc/arch-arm64/syscalls/__reboot.S
+++ b/libc/arch-arm64/syscalls/__reboot.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__reboot)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_reboot
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__rt_sigaction.S b/libc/arch-arm64/syscalls/__rt_sigaction.S
index 33e07cb..3d84544 100644
--- a/libc/arch-arm64/syscalls/__rt_sigaction.S
+++ b/libc/arch-arm64/syscalls/__rt_sigaction.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__rt_sigaction)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_rt_sigaction
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__rt_sigpending.S b/libc/arch-arm64/syscalls/__rt_sigpending.S
index fa6812e..60f0a10 100644
--- a/libc/arch-arm64/syscalls/__rt_sigpending.S
+++ b/libc/arch-arm64/syscalls/__rt_sigpending.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__rt_sigpending)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_rt_sigpending
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__rt_sigprocmask.S b/libc/arch-arm64/syscalls/__rt_sigprocmask.S
index 537f8bd..7f5b3ac 100644
--- a/libc/arch-arm64/syscalls/__rt_sigprocmask.S
+++ b/libc/arch-arm64/syscalls/__rt_sigprocmask.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__rt_sigprocmask)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_rt_sigprocmask
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__rt_sigsuspend.S b/libc/arch-arm64/syscalls/__rt_sigsuspend.S
index b8a99c6..08b1197 100644
--- a/libc/arch-arm64/syscalls/__rt_sigsuspend.S
+++ b/libc/arch-arm64/syscalls/__rt_sigsuspend.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__rt_sigsuspend)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_rt_sigsuspend
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__rt_sigtimedwait.S b/libc/arch-arm64/syscalls/__rt_sigtimedwait.S
index 869442c..8bc9a7a 100644
--- a/libc/arch-arm64/syscalls/__rt_sigtimedwait.S
+++ b/libc/arch-arm64/syscalls/__rt_sigtimedwait.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__rt_sigtimedwait)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_rt_sigtimedwait
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__sched_getaffinity.S b/libc/arch-arm64/syscalls/__sched_getaffinity.S
index 8ca23d4..c0d392c 100644
--- a/libc/arch-arm64/syscalls/__sched_getaffinity.S
+++ b/libc/arch-arm64/syscalls/__sched_getaffinity.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__sched_getaffinity)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_getaffinity
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__set_tid_address.S b/libc/arch-arm64/syscalls/__set_tid_address.S
index 5514aed..296c907 100644
--- a/libc/arch-arm64/syscalls/__set_tid_address.S
+++ b/libc/arch-arm64/syscalls/__set_tid_address.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__set_tid_address)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_set_tid_address
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__signalfd4.S b/libc/arch-arm64/syscalls/__signalfd4.S
index ea49fc5..3932003 100644
--- a/libc/arch-arm64/syscalls/__signalfd4.S
+++ b/libc/arch-arm64/syscalls/__signalfd4.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__signalfd4)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_signalfd4
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__socket.S b/libc/arch-arm64/syscalls/__socket.S
index f96a1ab..db7f2aa 100644
--- a/libc/arch-arm64/syscalls/__socket.S
+++ b/libc/arch-arm64/syscalls/__socket.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__socket)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_socket
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__timer_create.S b/libc/arch-arm64/syscalls/__timer_create.S
index 87183b4..a5e69e3 100644
--- a/libc/arch-arm64/syscalls/__timer_create.S
+++ b/libc/arch-arm64/syscalls/__timer_create.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__timer_create)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_timer_create
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__timer_delete.S b/libc/arch-arm64/syscalls/__timer_delete.S
index c21ec4f..44a7481 100644
--- a/libc/arch-arm64/syscalls/__timer_delete.S
+++ b/libc/arch-arm64/syscalls/__timer_delete.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__timer_delete)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_timer_delete
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__timer_getoverrun.S b/libc/arch-arm64/syscalls/__timer_getoverrun.S
index 47f1ef9..e1d959a 100644
--- a/libc/arch-arm64/syscalls/__timer_getoverrun.S
+++ b/libc/arch-arm64/syscalls/__timer_getoverrun.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__timer_getoverrun)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_timer_getoverrun
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__timer_gettime.S b/libc/arch-arm64/syscalls/__timer_gettime.S
index 4eaa655..7632290 100644
--- a/libc/arch-arm64/syscalls/__timer_gettime.S
+++ b/libc/arch-arm64/syscalls/__timer_gettime.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__timer_gettime)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_timer_gettime
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__timer_settime.S b/libc/arch-arm64/syscalls/__timer_settime.S
index aef0cc4..92e4a76 100644
--- a/libc/arch-arm64/syscalls/__timer_settime.S
+++ b/libc/arch-arm64/syscalls/__timer_settime.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__timer_settime)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_timer_settime
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/__waitid.S b/libc/arch-arm64/syscalls/__waitid.S
index 6d9e940..9267239 100644
--- a/libc/arch-arm64/syscalls/__waitid.S
+++ b/libc/arch-arm64/syscalls/__waitid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(__waitid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_waitid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/_exit.S b/libc/arch-arm64/syscalls/_exit.S
index 37d1499..38b073b 100644
--- a/libc/arch-arm64/syscalls/_exit.S
+++ b/libc/arch-arm64/syscalls/_exit.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(_exit)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_exit_group
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/acct.S b/libc/arch-arm64/syscalls/acct.S
index f391cd8..15e3086 100644
--- a/libc/arch-arm64/syscalls/acct.S
+++ b/libc/arch-arm64/syscalls/acct.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(acct)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_acct
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/bind.S b/libc/arch-arm64/syscalls/bind.S
index 10dd01f..b3925db 100644
--- a/libc/arch-arm64/syscalls/bind.S
+++ b/libc/arch-arm64/syscalls/bind.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(bind)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_bind
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/capget.S b/libc/arch-arm64/syscalls/capget.S
index d01dc47..b897e5d 100644
--- a/libc/arch-arm64/syscalls/capget.S
+++ b/libc/arch-arm64/syscalls/capget.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(capget)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_capget
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/capset.S b/libc/arch-arm64/syscalls/capset.S
index c4ed92e..1d94aa3 100644
--- a/libc/arch-arm64/syscalls/capset.S
+++ b/libc/arch-arm64/syscalls/capset.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(capset)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_capset
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/chdir.S b/libc/arch-arm64/syscalls/chdir.S
index 6f1baf0..a7bf6c2 100644
--- a/libc/arch-arm64/syscalls/chdir.S
+++ b/libc/arch-arm64/syscalls/chdir.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(chdir)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_chdir
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/chroot.S b/libc/arch-arm64/syscalls/chroot.S
index b15f04a..98bd5d1 100644
--- a/libc/arch-arm64/syscalls/chroot.S
+++ b/libc/arch-arm64/syscalls/chroot.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(chroot)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_chroot
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/clock_getres.S b/libc/arch-arm64/syscalls/clock_getres.S
index b18c10b..b6e7e56 100644
--- a/libc/arch-arm64/syscalls/clock_getres.S
+++ b/libc/arch-arm64/syscalls/clock_getres.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(clock_getres)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_clock_getres
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/clock_gettime.S b/libc/arch-arm64/syscalls/clock_gettime.S
index b3518c1..ffdde57 100644
--- a/libc/arch-arm64/syscalls/clock_gettime.S
+++ b/libc/arch-arm64/syscalls/clock_gettime.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(clock_gettime)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_clock_gettime
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/clock_nanosleep.S b/libc/arch-arm64/syscalls/clock_nanosleep.S
index eddf6f1..b64ff68 100644
--- a/libc/arch-arm64/syscalls/clock_nanosleep.S
+++ b/libc/arch-arm64/syscalls/clock_nanosleep.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(clock_nanosleep)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_clock_nanosleep
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/clock_settime.S b/libc/arch-arm64/syscalls/clock_settime.S
index c6ba5c0..adc1680 100644
--- a/libc/arch-arm64/syscalls/clock_settime.S
+++ b/libc/arch-arm64/syscalls/clock_settime.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(clock_settime)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_clock_settime
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/close.S b/libc/arch-arm64/syscalls/close.S
index a623895..b4b72d9 100644
--- a/libc/arch-arm64/syscalls/close.S
+++ b/libc/arch-arm64/syscalls/close.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(close)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_close
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/delete_module.S b/libc/arch-arm64/syscalls/delete_module.S
index a57517d..ed51847 100644
--- a/libc/arch-arm64/syscalls/delete_module.S
+++ b/libc/arch-arm64/syscalls/delete_module.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(delete_module)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_delete_module
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/dup.S b/libc/arch-arm64/syscalls/dup.S
index b7e04ed..9584c51 100644
--- a/libc/arch-arm64/syscalls/dup.S
+++ b/libc/arch-arm64/syscalls/dup.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(dup)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_dup
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/dup3.S b/libc/arch-arm64/syscalls/dup3.S
index fada63d..e303fba 100644
--- a/libc/arch-arm64/syscalls/dup3.S
+++ b/libc/arch-arm64/syscalls/dup3.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(dup3)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_dup3
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/epoll_create1.S b/libc/arch-arm64/syscalls/epoll_create1.S
index 94990bf..4ca8bfa 100644
--- a/libc/arch-arm64/syscalls/epoll_create1.S
+++ b/libc/arch-arm64/syscalls/epoll_create1.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(epoll_create1)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_epoll_create1
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/epoll_ctl.S b/libc/arch-arm64/syscalls/epoll_ctl.S
index ea6f735..c1c0dba 100644
--- a/libc/arch-arm64/syscalls/epoll_ctl.S
+++ b/libc/arch-arm64/syscalls/epoll_ctl.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(epoll_ctl)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_epoll_ctl
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/eventfd.S b/libc/arch-arm64/syscalls/eventfd.S
index afa88b3..ace608e 100644
--- a/libc/arch-arm64/syscalls/eventfd.S
+++ b/libc/arch-arm64/syscalls/eventfd.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(eventfd)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_eventfd2
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/execve.S b/libc/arch-arm64/syscalls/execve.S
index 031b6d4..ab0cb57 100644
--- a/libc/arch-arm64/syscalls/execve.S
+++ b/libc/arch-arm64/syscalls/execve.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(execve)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_execve
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/faccessat.S b/libc/arch-arm64/syscalls/faccessat.S
index cebbf18..30a3852 100644
--- a/libc/arch-arm64/syscalls/faccessat.S
+++ b/libc/arch-arm64/syscalls/faccessat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(faccessat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_faccessat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fallocate.S b/libc/arch-arm64/syscalls/fallocate.S
index 94832aa..3092b34 100644
--- a/libc/arch-arm64/syscalls/fallocate.S
+++ b/libc/arch-arm64/syscalls/fallocate.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fallocate)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fallocate
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fchdir.S b/libc/arch-arm64/syscalls/fchdir.S
index afba3c1..f7687f8 100644
--- a/libc/arch-arm64/syscalls/fchdir.S
+++ b/libc/arch-arm64/syscalls/fchdir.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fchdir)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fchdir
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fchmod.S b/libc/arch-arm64/syscalls/fchmod.S
index 35f9dec..acc6718 100644
--- a/libc/arch-arm64/syscalls/fchmod.S
+++ b/libc/arch-arm64/syscalls/fchmod.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fchmod)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fchmod
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fchmodat.S b/libc/arch-arm64/syscalls/fchmodat.S
index 59bfb8a..23c2fd5 100644
--- a/libc/arch-arm64/syscalls/fchmodat.S
+++ b/libc/arch-arm64/syscalls/fchmodat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fchmodat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fchmodat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fchown.S b/libc/arch-arm64/syscalls/fchown.S
index 2294187..8e9db62 100644
--- a/libc/arch-arm64/syscalls/fchown.S
+++ b/libc/arch-arm64/syscalls/fchown.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fchown)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fchown
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fchownat.S b/libc/arch-arm64/syscalls/fchownat.S
index ff24187..3cf2c3d 100644
--- a/libc/arch-arm64/syscalls/fchownat.S
+++ b/libc/arch-arm64/syscalls/fchownat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fchownat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fchownat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fcntl.S b/libc/arch-arm64/syscalls/fcntl.S
index a9d6976..45eff74 100644
--- a/libc/arch-arm64/syscalls/fcntl.S
+++ b/libc/arch-arm64/syscalls/fcntl.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fcntl)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fcntl
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fdatasync.S b/libc/arch-arm64/syscalls/fdatasync.S
index 4cf4de3..77b76c4 100644
--- a/libc/arch-arm64/syscalls/fdatasync.S
+++ b/libc/arch-arm64/syscalls/fdatasync.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fdatasync)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fdatasync
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fgetxattr.S b/libc/arch-arm64/syscalls/fgetxattr.S
index 914ea7f..1f8edb6 100644
--- a/libc/arch-arm64/syscalls/fgetxattr.S
+++ b/libc/arch-arm64/syscalls/fgetxattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fgetxattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fgetxattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/flistxattr.S b/libc/arch-arm64/syscalls/flistxattr.S
index 2a64381..997529e 100644
--- a/libc/arch-arm64/syscalls/flistxattr.S
+++ b/libc/arch-arm64/syscalls/flistxattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(flistxattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_flistxattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/flock.S b/libc/arch-arm64/syscalls/flock.S
index 0d87233..0e1c3f5 100644
--- a/libc/arch-arm64/syscalls/flock.S
+++ b/libc/arch-arm64/syscalls/flock.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(flock)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_flock
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fremovexattr.S b/libc/arch-arm64/syscalls/fremovexattr.S
index e2ef649..d43430f 100644
--- a/libc/arch-arm64/syscalls/fremovexattr.S
+++ b/libc/arch-arm64/syscalls/fremovexattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fremovexattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fremovexattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fsetxattr.S b/libc/arch-arm64/syscalls/fsetxattr.S
index eb41951..f40f875 100644
--- a/libc/arch-arm64/syscalls/fsetxattr.S
+++ b/libc/arch-arm64/syscalls/fsetxattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fsetxattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fsetxattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fstat64.S b/libc/arch-arm64/syscalls/fstat64.S
index ee0d9e7..9afe95b 100644
--- a/libc/arch-arm64/syscalls/fstat64.S
+++ b/libc/arch-arm64/syscalls/fstat64.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fstat64)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fstat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fstatat64.S b/libc/arch-arm64/syscalls/fstatat64.S
index 4ff3039..30efd3b 100644
--- a/libc/arch-arm64/syscalls/fstatat64.S
+++ b/libc/arch-arm64/syscalls/fstatat64.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fstatat64)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_newfstatat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fstatfs64.S b/libc/arch-arm64/syscalls/fstatfs64.S
index b908b57..67ae67e 100644
--- a/libc/arch-arm64/syscalls/fstatfs64.S
+++ b/libc/arch-arm64/syscalls/fstatfs64.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fstatfs64)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fstatfs
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/fsync.S b/libc/arch-arm64/syscalls/fsync.S
index bac2e8b..e22589e 100644
--- a/libc/arch-arm64/syscalls/fsync.S
+++ b/libc/arch-arm64/syscalls/fsync.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(fsync)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_fsync
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/ftruncate.S b/libc/arch-arm64/syscalls/ftruncate.S
index ca4315a..b45a170 100644
--- a/libc/arch-arm64/syscalls/ftruncate.S
+++ b/libc/arch-arm64/syscalls/ftruncate.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(ftruncate)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_ftruncate
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getdents.S b/libc/arch-arm64/syscalls/getdents.S
deleted file mode 100644
index 8cd3ca7..0000000
--- a/libc/arch-arm64/syscalls/getdents.S
+++ /dev/null
@@ -1,25 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(getdents)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
-    mov     x8, __NR_getdents64
-    svc     #0
-
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
-    cmn     x0, #(MAX_ERRNO + 1)
-    cneg    x0, x0, hi
-    b.hi    __set_errno
-
-    ret
-END(getdents)
diff --git a/libc/arch-arm64/syscalls/getegid.S b/libc/arch-arm64/syscalls/getegid.S
index 593f51d..675731c 100644
--- a/libc/arch-arm64/syscalls/getegid.S
+++ b/libc/arch-arm64/syscalls/getegid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getegid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getegid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/geteuid.S b/libc/arch-arm64/syscalls/geteuid.S
index 845acbc..8d9461e 100644
--- a/libc/arch-arm64/syscalls/geteuid.S
+++ b/libc/arch-arm64/syscalls/geteuid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(geteuid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_geteuid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getgid.S b/libc/arch-arm64/syscalls/getgid.S
index 5f34355..4653fd8 100644
--- a/libc/arch-arm64/syscalls/getgid.S
+++ b/libc/arch-arm64/syscalls/getgid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getgid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getgid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getgroups.S b/libc/arch-arm64/syscalls/getgroups.S
index d0e2540..f22f1e9 100644
--- a/libc/arch-arm64/syscalls/getgroups.S
+++ b/libc/arch-arm64/syscalls/getgroups.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getgroups)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getgroups
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getitimer.S b/libc/arch-arm64/syscalls/getitimer.S
index 2d4d541..25d0b38 100644
--- a/libc/arch-arm64/syscalls/getitimer.S
+++ b/libc/arch-arm64/syscalls/getitimer.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getitimer)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getitimer
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getpeername.S b/libc/arch-arm64/syscalls/getpeername.S
index 1f64130..aefd0c5 100644
--- a/libc/arch-arm64/syscalls/getpeername.S
+++ b/libc/arch-arm64/syscalls/getpeername.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getpeername)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getpeername
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getpgid.S b/libc/arch-arm64/syscalls/getpgid.S
index 01d876f..4c750fb 100644
--- a/libc/arch-arm64/syscalls/getpgid.S
+++ b/libc/arch-arm64/syscalls/getpgid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getpgid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getpgid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getpid.S b/libc/arch-arm64/syscalls/getpid.S
index 94b823c..1802ce8 100644
--- a/libc/arch-arm64/syscalls/getpid.S
+++ b/libc/arch-arm64/syscalls/getpid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getpid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getpid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getppid.S b/libc/arch-arm64/syscalls/getppid.S
index 0a46878..540ecc4 100644
--- a/libc/arch-arm64/syscalls/getppid.S
+++ b/libc/arch-arm64/syscalls/getppid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getppid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getppid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getresgid.S b/libc/arch-arm64/syscalls/getresgid.S
index bc121fc..3ce5799 100644
--- a/libc/arch-arm64/syscalls/getresgid.S
+++ b/libc/arch-arm64/syscalls/getresgid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getresgid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getresgid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getresuid.S b/libc/arch-arm64/syscalls/getresuid.S
index 28cd9a4..56851cc 100644
--- a/libc/arch-arm64/syscalls/getresuid.S
+++ b/libc/arch-arm64/syscalls/getresuid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getresuid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getresuid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getrlimit.S b/libc/arch-arm64/syscalls/getrlimit.S
index aa966ca..1f74773 100644
--- a/libc/arch-arm64/syscalls/getrlimit.S
+++ b/libc/arch-arm64/syscalls/getrlimit.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getrlimit)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getrlimit
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getrusage.S b/libc/arch-arm64/syscalls/getrusage.S
index aaaf3a2..8154e4a 100644
--- a/libc/arch-arm64/syscalls/getrusage.S
+++ b/libc/arch-arm64/syscalls/getrusage.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getrusage)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getrusage
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getsid.S b/libc/arch-arm64/syscalls/getsid.S
index e75b7b4..f99623f 100644
--- a/libc/arch-arm64/syscalls/getsid.S
+++ b/libc/arch-arm64/syscalls/getsid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getsid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getsid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getsockname.S b/libc/arch-arm64/syscalls/getsockname.S
index 61e4b4b..e8bc006 100644
--- a/libc/arch-arm64/syscalls/getsockname.S
+++ b/libc/arch-arm64/syscalls/getsockname.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getsockname)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getsockname
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getsockopt.S b/libc/arch-arm64/syscalls/getsockopt.S
index 3740df9..4559d1d 100644
--- a/libc/arch-arm64/syscalls/getsockopt.S
+++ b/libc/arch-arm64/syscalls/getsockopt.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getsockopt)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getsockopt
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/gettimeofday.S b/libc/arch-arm64/syscalls/gettimeofday.S
index a72ac91..3b6104b 100644
--- a/libc/arch-arm64/syscalls/gettimeofday.S
+++ b/libc/arch-arm64/syscalls/gettimeofday.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(gettimeofday)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_gettimeofday
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getuid.S b/libc/arch-arm64/syscalls/getuid.S
index d749cc3..4e37d47 100644
--- a/libc/arch-arm64/syscalls/getuid.S
+++ b/libc/arch-arm64/syscalls/getuid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getuid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getuid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/getxattr.S b/libc/arch-arm64/syscalls/getxattr.S
index 451eef5..3f69956 100644
--- a/libc/arch-arm64/syscalls/getxattr.S
+++ b/libc/arch-arm64/syscalls/getxattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(getxattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_getxattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/init_module.S b/libc/arch-arm64/syscalls/init_module.S
index 42ec765..cc1a0da 100644
--- a/libc/arch-arm64/syscalls/init_module.S
+++ b/libc/arch-arm64/syscalls/init_module.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(init_module)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_init_module
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/inotify_add_watch.S b/libc/arch-arm64/syscalls/inotify_add_watch.S
index 066816c..fbc8dd4 100644
--- a/libc/arch-arm64/syscalls/inotify_add_watch.S
+++ b/libc/arch-arm64/syscalls/inotify_add_watch.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(inotify_add_watch)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_inotify_add_watch
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/inotify_init1.S b/libc/arch-arm64/syscalls/inotify_init1.S
index d6bee8c..5726d0c 100644
--- a/libc/arch-arm64/syscalls/inotify_init1.S
+++ b/libc/arch-arm64/syscalls/inotify_init1.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(inotify_init1)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_inotify_init1
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/inotify_rm_watch.S b/libc/arch-arm64/syscalls/inotify_rm_watch.S
index ee9c70f..37eabcf 100644
--- a/libc/arch-arm64/syscalls/inotify_rm_watch.S
+++ b/libc/arch-arm64/syscalls/inotify_rm_watch.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(inotify_rm_watch)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_inotify_rm_watch
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/ioprio_get.S b/libc/arch-arm64/syscalls/ioprio_get.S
index 4a4a749..7e394c6 100644
--- a/libc/arch-arm64/syscalls/ioprio_get.S
+++ b/libc/arch-arm64/syscalls/ioprio_get.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(ioprio_get)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_ioprio_get
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/ioprio_set.S b/libc/arch-arm64/syscalls/ioprio_set.S
index 8b48f12..ca43ed6 100644
--- a/libc/arch-arm64/syscalls/ioprio_set.S
+++ b/libc/arch-arm64/syscalls/ioprio_set.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(ioprio_set)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_ioprio_set
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/kill.S b/libc/arch-arm64/syscalls/kill.S
index 15c399b..7fc2c5a 100644
--- a/libc/arch-arm64/syscalls/kill.S
+++ b/libc/arch-arm64/syscalls/kill.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(kill)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_kill
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/klogctl.S b/libc/arch-arm64/syscalls/klogctl.S
index 1d161ec..abbee55 100644
--- a/libc/arch-arm64/syscalls/klogctl.S
+++ b/libc/arch-arm64/syscalls/klogctl.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(klogctl)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_syslog
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/lgetxattr.S b/libc/arch-arm64/syscalls/lgetxattr.S
index 2799285..e1a760c 100644
--- a/libc/arch-arm64/syscalls/lgetxattr.S
+++ b/libc/arch-arm64/syscalls/lgetxattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(lgetxattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_lgetxattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/linkat.S b/libc/arch-arm64/syscalls/linkat.S
index e65aa3f..c3e2cd8 100644
--- a/libc/arch-arm64/syscalls/linkat.S
+++ b/libc/arch-arm64/syscalls/linkat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(linkat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_linkat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/listen.S b/libc/arch-arm64/syscalls/listen.S
index 44ae288..9b7be28 100644
--- a/libc/arch-arm64/syscalls/listen.S
+++ b/libc/arch-arm64/syscalls/listen.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(listen)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_listen
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/listxattr.S b/libc/arch-arm64/syscalls/listxattr.S
index b31d22c..a5e55c7 100644
--- a/libc/arch-arm64/syscalls/listxattr.S
+++ b/libc/arch-arm64/syscalls/listxattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(listxattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_listxattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/llistxattr.S b/libc/arch-arm64/syscalls/llistxattr.S
index fdcafde..447e208 100644
--- a/libc/arch-arm64/syscalls/llistxattr.S
+++ b/libc/arch-arm64/syscalls/llistxattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(llistxattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_llistxattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/lremovexattr.S b/libc/arch-arm64/syscalls/lremovexattr.S
index 741fa86..1f620db 100644
--- a/libc/arch-arm64/syscalls/lremovexattr.S
+++ b/libc/arch-arm64/syscalls/lremovexattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(lremovexattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_lremovexattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/lseek.S b/libc/arch-arm64/syscalls/lseek.S
index 3d16e75..1b858b2 100644
--- a/libc/arch-arm64/syscalls/lseek.S
+++ b/libc/arch-arm64/syscalls/lseek.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(lseek)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_lseek
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/lsetxattr.S b/libc/arch-arm64/syscalls/lsetxattr.S
index a7fe1df..8315bba 100644
--- a/libc/arch-arm64/syscalls/lsetxattr.S
+++ b/libc/arch-arm64/syscalls/lsetxattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(lsetxattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_lsetxattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/madvise.S b/libc/arch-arm64/syscalls/madvise.S
index 8eed274..17282c0 100644
--- a/libc/arch-arm64/syscalls/madvise.S
+++ b/libc/arch-arm64/syscalls/madvise.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(madvise)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_madvise
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/mincore.S b/libc/arch-arm64/syscalls/mincore.S
index 21dbe14..abdcf6c 100644
--- a/libc/arch-arm64/syscalls/mincore.S
+++ b/libc/arch-arm64/syscalls/mincore.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(mincore)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_mincore
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/mkdirat.S b/libc/arch-arm64/syscalls/mkdirat.S
index efd9786..d6bafca 100644
--- a/libc/arch-arm64/syscalls/mkdirat.S
+++ b/libc/arch-arm64/syscalls/mkdirat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(mkdirat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_mkdirat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/mknodat.S b/libc/arch-arm64/syscalls/mknodat.S
index 1bf42d0..598e789 100644
--- a/libc/arch-arm64/syscalls/mknodat.S
+++ b/libc/arch-arm64/syscalls/mknodat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(mknodat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_mknodat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/mlock.S b/libc/arch-arm64/syscalls/mlock.S
index e09e7fc..631ce02 100644
--- a/libc/arch-arm64/syscalls/mlock.S
+++ b/libc/arch-arm64/syscalls/mlock.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(mlock)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_mlock
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/mlockall.S b/libc/arch-arm64/syscalls/mlockall.S
index bfb2b60..42dac9e 100644
--- a/libc/arch-arm64/syscalls/mlockall.S
+++ b/libc/arch-arm64/syscalls/mlockall.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(mlockall)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_mlockall
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/mmap.S b/libc/arch-arm64/syscalls/mmap.S
index 437698a..da18e10 100644
--- a/libc/arch-arm64/syscalls/mmap.S
+++ b/libc/arch-arm64/syscalls/mmap.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(mmap)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_mmap
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/mount.S b/libc/arch-arm64/syscalls/mount.S
index 34170d8..c43a71f 100644
--- a/libc/arch-arm64/syscalls/mount.S
+++ b/libc/arch-arm64/syscalls/mount.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(mount)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_mount
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/mprotect.S b/libc/arch-arm64/syscalls/mprotect.S
index cdb4bc8..a7d26dd 100644
--- a/libc/arch-arm64/syscalls/mprotect.S
+++ b/libc/arch-arm64/syscalls/mprotect.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(mprotect)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_mprotect
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/mremap.S b/libc/arch-arm64/syscalls/mremap.S
index 605b39d..337bbae 100644
--- a/libc/arch-arm64/syscalls/mremap.S
+++ b/libc/arch-arm64/syscalls/mremap.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(mremap)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_mremap
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/msync.S b/libc/arch-arm64/syscalls/msync.S
index e511e86..c54797e 100644
--- a/libc/arch-arm64/syscalls/msync.S
+++ b/libc/arch-arm64/syscalls/msync.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(msync)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_msync
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/munlock.S b/libc/arch-arm64/syscalls/munlock.S
index f837c9c..b1ec016 100644
--- a/libc/arch-arm64/syscalls/munlock.S
+++ b/libc/arch-arm64/syscalls/munlock.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(munlock)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_munlock
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/munlockall.S b/libc/arch-arm64/syscalls/munlockall.S
index 93e9121..f9162a8 100644
--- a/libc/arch-arm64/syscalls/munlockall.S
+++ b/libc/arch-arm64/syscalls/munlockall.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(munlockall)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_munlockall
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/munmap.S b/libc/arch-arm64/syscalls/munmap.S
index f2b22bd..6bd5afe 100644
--- a/libc/arch-arm64/syscalls/munmap.S
+++ b/libc/arch-arm64/syscalls/munmap.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(munmap)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_munmap
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/nanosleep.S b/libc/arch-arm64/syscalls/nanosleep.S
index e33311a..c84accc 100644
--- a/libc/arch-arm64/syscalls/nanosleep.S
+++ b/libc/arch-arm64/syscalls/nanosleep.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(nanosleep)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_nanosleep
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/personality.S b/libc/arch-arm64/syscalls/personality.S
index c37cae2..02bcf9b 100644
--- a/libc/arch-arm64/syscalls/personality.S
+++ b/libc/arch-arm64/syscalls/personality.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(personality)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_personality
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/pipe2.S b/libc/arch-arm64/syscalls/pipe2.S
index ab2e259..f4da37d 100644
--- a/libc/arch-arm64/syscalls/pipe2.S
+++ b/libc/arch-arm64/syscalls/pipe2.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(pipe2)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_pipe2
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/prctl.S b/libc/arch-arm64/syscalls/prctl.S
index dd46fd4..2e6dca7 100644
--- a/libc/arch-arm64/syscalls/prctl.S
+++ b/libc/arch-arm64/syscalls/prctl.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(prctl)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_prctl
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/pread64.S b/libc/arch-arm64/syscalls/pread64.S
index ddc6c12..2aba596 100644
--- a/libc/arch-arm64/syscalls/pread64.S
+++ b/libc/arch-arm64/syscalls/pread64.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(pread64)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_pread64
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/prlimit64.S b/libc/arch-arm64/syscalls/prlimit64.S
index 39d31b0..a2173d9 100644
--- a/libc/arch-arm64/syscalls/prlimit64.S
+++ b/libc/arch-arm64/syscalls/prlimit64.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(prlimit64)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_prlimit64
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/pwrite64.S b/libc/arch-arm64/syscalls/pwrite64.S
index 81e2cf7..5674a7c 100644
--- a/libc/arch-arm64/syscalls/pwrite64.S
+++ b/libc/arch-arm64/syscalls/pwrite64.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(pwrite64)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_pwrite64
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/read.S b/libc/arch-arm64/syscalls/read.S
index c529576..906fb98 100644
--- a/libc/arch-arm64/syscalls/read.S
+++ b/libc/arch-arm64/syscalls/read.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(read)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_read
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/readahead.S b/libc/arch-arm64/syscalls/readahead.S
index e8394cc..2994b83 100644
--- a/libc/arch-arm64/syscalls/readahead.S
+++ b/libc/arch-arm64/syscalls/readahead.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(readahead)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_readahead
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/readlinkat.S b/libc/arch-arm64/syscalls/readlinkat.S
index d7cadcc..1782c94 100644
--- a/libc/arch-arm64/syscalls/readlinkat.S
+++ b/libc/arch-arm64/syscalls/readlinkat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(readlinkat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_readlinkat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/readv.S b/libc/arch-arm64/syscalls/readv.S
index 98d0742..bc988d4 100644
--- a/libc/arch-arm64/syscalls/readv.S
+++ b/libc/arch-arm64/syscalls/readv.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(readv)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_readv
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/recvfrom.S b/libc/arch-arm64/syscalls/recvfrom.S
index 63181f1..16f97d5 100644
--- a/libc/arch-arm64/syscalls/recvfrom.S
+++ b/libc/arch-arm64/syscalls/recvfrom.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(recvfrom)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_recvfrom
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/recvmmsg.S b/libc/arch-arm64/syscalls/recvmmsg.S
index cb1fbfc..bd1495a 100644
--- a/libc/arch-arm64/syscalls/recvmmsg.S
+++ b/libc/arch-arm64/syscalls/recvmmsg.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(recvmmsg)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_recvmmsg
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/recvmsg.S b/libc/arch-arm64/syscalls/recvmsg.S
index 8a91a5f..c9b78c4 100644
--- a/libc/arch-arm64/syscalls/recvmsg.S
+++ b/libc/arch-arm64/syscalls/recvmsg.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(recvmsg)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_recvmsg
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/removexattr.S b/libc/arch-arm64/syscalls/removexattr.S
index 6fb557a..c12cc84 100644
--- a/libc/arch-arm64/syscalls/removexattr.S
+++ b/libc/arch-arm64/syscalls/removexattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(removexattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_removexattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/renameat.S b/libc/arch-arm64/syscalls/renameat.S
index e4efeb8..cf79472 100644
--- a/libc/arch-arm64/syscalls/renameat.S
+++ b/libc/arch-arm64/syscalls/renameat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(renameat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_renameat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sched_get_priority_max.S b/libc/arch-arm64/syscalls/sched_get_priority_max.S
index 74f919b..672d0ea 100644
--- a/libc/arch-arm64/syscalls/sched_get_priority_max.S
+++ b/libc/arch-arm64/syscalls/sched_get_priority_max.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sched_get_priority_max)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_get_priority_max
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sched_get_priority_min.S b/libc/arch-arm64/syscalls/sched_get_priority_min.S
index d043b3b..f5cf1f3 100644
--- a/libc/arch-arm64/syscalls/sched_get_priority_min.S
+++ b/libc/arch-arm64/syscalls/sched_get_priority_min.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sched_get_priority_min)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_get_priority_min
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sched_getparam.S b/libc/arch-arm64/syscalls/sched_getparam.S
index fedcec8..7ffe8fb 100644
--- a/libc/arch-arm64/syscalls/sched_getparam.S
+++ b/libc/arch-arm64/syscalls/sched_getparam.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sched_getparam)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_getparam
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sched_getscheduler.S b/libc/arch-arm64/syscalls/sched_getscheduler.S
index 1225601..b69b8c0 100644
--- a/libc/arch-arm64/syscalls/sched_getscheduler.S
+++ b/libc/arch-arm64/syscalls/sched_getscheduler.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sched_getscheduler)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_getscheduler
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sched_rr_get_interval.S b/libc/arch-arm64/syscalls/sched_rr_get_interval.S
index 796edda..0be14ba 100644
--- a/libc/arch-arm64/syscalls/sched_rr_get_interval.S
+++ b/libc/arch-arm64/syscalls/sched_rr_get_interval.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sched_rr_get_interval)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_rr_get_interval
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sched_setaffinity.S b/libc/arch-arm64/syscalls/sched_setaffinity.S
index 2a7022d..f5cbc77 100644
--- a/libc/arch-arm64/syscalls/sched_setaffinity.S
+++ b/libc/arch-arm64/syscalls/sched_setaffinity.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sched_setaffinity)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_setaffinity
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sched_setparam.S b/libc/arch-arm64/syscalls/sched_setparam.S
index dd82a10..cff64f5 100644
--- a/libc/arch-arm64/syscalls/sched_setparam.S
+++ b/libc/arch-arm64/syscalls/sched_setparam.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sched_setparam)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_setparam
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sched_setscheduler.S b/libc/arch-arm64/syscalls/sched_setscheduler.S
index 25e1e36..31600a0 100644
--- a/libc/arch-arm64/syscalls/sched_setscheduler.S
+++ b/libc/arch-arm64/syscalls/sched_setscheduler.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sched_setscheduler)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_setscheduler
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sched_yield.S b/libc/arch-arm64/syscalls/sched_yield.S
index cbee020..21ad601 100644
--- a/libc/arch-arm64/syscalls/sched_yield.S
+++ b/libc/arch-arm64/syscalls/sched_yield.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sched_yield)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sched_yield
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sendfile.S b/libc/arch-arm64/syscalls/sendfile.S
index 1705d3c..db90caa 100644
--- a/libc/arch-arm64/syscalls/sendfile.S
+++ b/libc/arch-arm64/syscalls/sendfile.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sendfile)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sendfile
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sendmmsg.S b/libc/arch-arm64/syscalls/sendmmsg.S
index 2277110..e85798a 100644
--- a/libc/arch-arm64/syscalls/sendmmsg.S
+++ b/libc/arch-arm64/syscalls/sendmmsg.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sendmmsg)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sendmmsg
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sendmsg.S b/libc/arch-arm64/syscalls/sendmsg.S
index 96fcb9a..25eff84 100644
--- a/libc/arch-arm64/syscalls/sendmsg.S
+++ b/libc/arch-arm64/syscalls/sendmsg.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sendmsg)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sendmsg
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sendto.S b/libc/arch-arm64/syscalls/sendto.S
index 67589ba..39e4e4e 100644
--- a/libc/arch-arm64/syscalls/sendto.S
+++ b/libc/arch-arm64/syscalls/sendto.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sendto)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sendto
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setgid.S b/libc/arch-arm64/syscalls/setgid.S
index fbaa785..a9789f7 100644
--- a/libc/arch-arm64/syscalls/setgid.S
+++ b/libc/arch-arm64/syscalls/setgid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setgid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setgid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setgroups.S b/libc/arch-arm64/syscalls/setgroups.S
index 48035b6..ce9bf01 100644
--- a/libc/arch-arm64/syscalls/setgroups.S
+++ b/libc/arch-arm64/syscalls/setgroups.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setgroups)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setgroups
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setitimer.S b/libc/arch-arm64/syscalls/setitimer.S
index 42af94b..d8e3d7e 100644
--- a/libc/arch-arm64/syscalls/setitimer.S
+++ b/libc/arch-arm64/syscalls/setitimer.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setitimer)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setitimer
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setns.S b/libc/arch-arm64/syscalls/setns.S
index f695597..615f888 100644
--- a/libc/arch-arm64/syscalls/setns.S
+++ b/libc/arch-arm64/syscalls/setns.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setns)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setns
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setpgid.S b/libc/arch-arm64/syscalls/setpgid.S
index 5653256..6015264 100644
--- a/libc/arch-arm64/syscalls/setpgid.S
+++ b/libc/arch-arm64/syscalls/setpgid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setpgid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setpgid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setpriority.S b/libc/arch-arm64/syscalls/setpriority.S
index 121bcaa..d2f517e 100644
--- a/libc/arch-arm64/syscalls/setpriority.S
+++ b/libc/arch-arm64/syscalls/setpriority.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setpriority)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setpriority
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setregid.S b/libc/arch-arm64/syscalls/setregid.S
index 6389551..7b333bf 100644
--- a/libc/arch-arm64/syscalls/setregid.S
+++ b/libc/arch-arm64/syscalls/setregid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setregid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setregid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setresgid.S b/libc/arch-arm64/syscalls/setresgid.S
index bf78249..39504bd 100644
--- a/libc/arch-arm64/syscalls/setresgid.S
+++ b/libc/arch-arm64/syscalls/setresgid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setresgid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setresgid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setresuid.S b/libc/arch-arm64/syscalls/setresuid.S
index 83200da..5acbffd 100644
--- a/libc/arch-arm64/syscalls/setresuid.S
+++ b/libc/arch-arm64/syscalls/setresuid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setresuid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setresuid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setreuid.S b/libc/arch-arm64/syscalls/setreuid.S
index 2253eec..63630d6 100644
--- a/libc/arch-arm64/syscalls/setreuid.S
+++ b/libc/arch-arm64/syscalls/setreuid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setreuid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setreuid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setrlimit.S b/libc/arch-arm64/syscalls/setrlimit.S
index 034ae36..f9f56a6 100644
--- a/libc/arch-arm64/syscalls/setrlimit.S
+++ b/libc/arch-arm64/syscalls/setrlimit.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setrlimit)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setrlimit
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setsid.S b/libc/arch-arm64/syscalls/setsid.S
index 64123df..04c28e3 100644
--- a/libc/arch-arm64/syscalls/setsid.S
+++ b/libc/arch-arm64/syscalls/setsid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setsid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setsid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setsockopt.S b/libc/arch-arm64/syscalls/setsockopt.S
index fe8da22..0ebc6d0 100644
--- a/libc/arch-arm64/syscalls/setsockopt.S
+++ b/libc/arch-arm64/syscalls/setsockopt.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setsockopt)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setsockopt
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/settimeofday.S b/libc/arch-arm64/syscalls/settimeofday.S
index 50debf9..474e40d 100644
--- a/libc/arch-arm64/syscalls/settimeofday.S
+++ b/libc/arch-arm64/syscalls/settimeofday.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(settimeofday)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_settimeofday
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setuid.S b/libc/arch-arm64/syscalls/setuid.S
index 0a9adbe..fe52921 100644
--- a/libc/arch-arm64/syscalls/setuid.S
+++ b/libc/arch-arm64/syscalls/setuid.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setuid)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setuid
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/setxattr.S b/libc/arch-arm64/syscalls/setxattr.S
index ebfd607..8d0b415 100644
--- a/libc/arch-arm64/syscalls/setxattr.S
+++ b/libc/arch-arm64/syscalls/setxattr.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(setxattr)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_setxattr
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/shutdown.S b/libc/arch-arm64/syscalls/shutdown.S
index 6e878d6..e35cdea 100644
--- a/libc/arch-arm64/syscalls/shutdown.S
+++ b/libc/arch-arm64/syscalls/shutdown.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(shutdown)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_shutdown
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sigaltstack.S b/libc/arch-arm64/syscalls/sigaltstack.S
index 46794d4..6a38203 100644
--- a/libc/arch-arm64/syscalls/sigaltstack.S
+++ b/libc/arch-arm64/syscalls/sigaltstack.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sigaltstack)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sigaltstack
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/socketpair.S b/libc/arch-arm64/syscalls/socketpair.S
index c42ff24..dcd7223 100644
--- a/libc/arch-arm64/syscalls/socketpair.S
+++ b/libc/arch-arm64/syscalls/socketpair.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(socketpair)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_socketpair
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/statfs64.S b/libc/arch-arm64/syscalls/statfs64.S
index 66662ee..55633c1 100644
--- a/libc/arch-arm64/syscalls/statfs64.S
+++ b/libc/arch-arm64/syscalls/statfs64.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(statfs64)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_statfs
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/swapoff.S b/libc/arch-arm64/syscalls/swapoff.S
index 1d465b0..dcef4af 100644
--- a/libc/arch-arm64/syscalls/swapoff.S
+++ b/libc/arch-arm64/syscalls/swapoff.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(swapoff)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_swapoff
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/swapon.S b/libc/arch-arm64/syscalls/swapon.S
index 7e5f850..aef7627 100644
--- a/libc/arch-arm64/syscalls/swapon.S
+++ b/libc/arch-arm64/syscalls/swapon.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(swapon)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_swapon
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/symlinkat.S b/libc/arch-arm64/syscalls/symlinkat.S
index 0081cf2..9830865 100644
--- a/libc/arch-arm64/syscalls/symlinkat.S
+++ b/libc/arch-arm64/syscalls/symlinkat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(symlinkat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_symlinkat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sync.S b/libc/arch-arm64/syscalls/sync.S
index 67bc554..3ef0460 100644
--- a/libc/arch-arm64/syscalls/sync.S
+++ b/libc/arch-arm64/syscalls/sync.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sync)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sync
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/sysinfo.S b/libc/arch-arm64/syscalls/sysinfo.S
index 0797a39..7dbe152 100644
--- a/libc/arch-arm64/syscalls/sysinfo.S
+++ b/libc/arch-arm64/syscalls/sysinfo.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(sysinfo)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_sysinfo
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/tgkill.S b/libc/arch-arm64/syscalls/tgkill.S
index 9366c70..477c477 100644
--- a/libc/arch-arm64/syscalls/tgkill.S
+++ b/libc/arch-arm64/syscalls/tgkill.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(tgkill)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_tgkill
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/timerfd_create.S b/libc/arch-arm64/syscalls/timerfd_create.S
index 1e9d2e3..83b5910 100644
--- a/libc/arch-arm64/syscalls/timerfd_create.S
+++ b/libc/arch-arm64/syscalls/timerfd_create.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(timerfd_create)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_timerfd_create
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/timerfd_gettime.S b/libc/arch-arm64/syscalls/timerfd_gettime.S
index 56d7f96..253cb79 100644
--- a/libc/arch-arm64/syscalls/timerfd_gettime.S
+++ b/libc/arch-arm64/syscalls/timerfd_gettime.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(timerfd_gettime)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_timerfd_gettime
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/timerfd_settime.S b/libc/arch-arm64/syscalls/timerfd_settime.S
index 29af0f1..8872481 100644
--- a/libc/arch-arm64/syscalls/timerfd_settime.S
+++ b/libc/arch-arm64/syscalls/timerfd_settime.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(timerfd_settime)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_timerfd_settime
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/times.S b/libc/arch-arm64/syscalls/times.S
index 9487186..33c7d55 100644
--- a/libc/arch-arm64/syscalls/times.S
+++ b/libc/arch-arm64/syscalls/times.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(times)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_times
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/truncate.S b/libc/arch-arm64/syscalls/truncate.S
index 3bbe356..f15253b 100644
--- a/libc/arch-arm64/syscalls/truncate.S
+++ b/libc/arch-arm64/syscalls/truncate.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(truncate)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_truncate
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/umask.S b/libc/arch-arm64/syscalls/umask.S
index ca72092..8b907b4 100644
--- a/libc/arch-arm64/syscalls/umask.S
+++ b/libc/arch-arm64/syscalls/umask.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(umask)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_umask
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/umount2.S b/libc/arch-arm64/syscalls/umount2.S
index a959625..5646dba 100644
--- a/libc/arch-arm64/syscalls/umount2.S
+++ b/libc/arch-arm64/syscalls/umount2.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(umount2)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_umount2
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/uname.S b/libc/arch-arm64/syscalls/uname.S
index 2f87563..09ec096 100644
--- a/libc/arch-arm64/syscalls/uname.S
+++ b/libc/arch-arm64/syscalls/uname.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(uname)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_uname
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/unlinkat.S b/libc/arch-arm64/syscalls/unlinkat.S
index 0025726..992f675 100644
--- a/libc/arch-arm64/syscalls/unlinkat.S
+++ b/libc/arch-arm64/syscalls/unlinkat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(unlinkat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_unlinkat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/unshare.S b/libc/arch-arm64/syscalls/unshare.S
index 55462b4..1062dcd 100644
--- a/libc/arch-arm64/syscalls/unshare.S
+++ b/libc/arch-arm64/syscalls/unshare.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(unshare)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_unshare
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/utimensat.S b/libc/arch-arm64/syscalls/utimensat.S
index aa5cfbf..8a25ed6 100644
--- a/libc/arch-arm64/syscalls/utimensat.S
+++ b/libc/arch-arm64/syscalls/utimensat.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(utimensat)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_utimensat
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/wait4.S b/libc/arch-arm64/syscalls/wait4.S
index 93183e5..a0d5d62 100644
--- a/libc/arch-arm64/syscalls/wait4.S
+++ b/libc/arch-arm64/syscalls/wait4.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(wait4)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_wait4
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/write.S b/libc/arch-arm64/syscalls/write.S
index b7288d1..d64552e 100644
--- a/libc/arch-arm64/syscalls/write.S
+++ b/libc/arch-arm64/syscalls/write.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(write)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_write
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-arm64/syscalls/writev.S b/libc/arch-arm64/syscalls/writev.S
index 13af454..45d5c8d 100644
--- a/libc/arch-arm64/syscalls/writev.S
+++ b/libc/arch-arm64/syscalls/writev.S
@@ -3,20 +3,9 @@
 #include <private/bionic_asm.h>
 
 ENTRY(writev)
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, __NR_writev
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/arch-mips/bionic/__bionic_clone.S b/libc/arch-mips/bionic/__bionic_clone.S
index 7b138ae..4b4498d 100644
--- a/libc/arch-mips/bionic/__bionic_clone.S
+++ b/libc/arch-mips/bionic/__bionic_clone.S
@@ -60,8 +60,8 @@
         lw	a0,0(sp)	#  fn
         lw	a1,4(sp)	#  arg
 
-	# void __bionic_clone_entry(int (*func)(void*), void *arg)
-        la	t9,__bionic_clone_entry
+	# void __start_thread(int (*func)(void*), void *arg)
+        la	t9,__start_thread
         j	t9
 
 .L__error_bc:
diff --git a/libc/arch-mips/syscalls/getdents.S b/libc/arch-mips/syscalls/__getdents64.S
similarity index 87%
rename from libc/arch-mips/syscalls/getdents.S
rename to libc/arch-mips/syscalls/__getdents64.S
index ce92886..136b408 100644
--- a/libc/arch-mips/syscalls/getdents.S
+++ b/libc/arch-mips/syscalls/__getdents64.S
@@ -2,7 +2,7 @@
 
 #include <private/bionic_asm.h>
 
-ENTRY(getdents)
+ENTRY(__getdents64)
     .set noreorder
     .cpload t9
     li v0, __NR_getdents64
@@ -16,4 +16,4 @@
     j t9
     nop
     .set reorder
-END(getdents)
+END(__getdents64)
diff --git a/libc/arch-mips64/bionic/__bionic_clone.S b/libc/arch-mips64/bionic/__bionic_clone.S
index 8687906..4f053f9 100644
--- a/libc/arch-mips64/bionic/__bionic_clone.S
+++ b/libc/arch-mips64/bionic/__bionic_clone.S
@@ -78,10 +78,10 @@
 	# Clear return address in child so we don't unwind further.
 	li	ra,0
 
-	# void __bionic_clone_entry(int (*func)(void*), void *arg)
+	# void __start_thread(int (*func)(void*), void *arg)
 	PTR_L	a0,FRAME_FN(sp)		#  fn
 	PTR_L	a1,FRAME_ARG(sp)	#  arg
-	LA	t9,__bionic_clone_entry
+	LA	t9,__start_thread
 	RESTORE_GP64
 	/*
 	 * For O32 etc the child stack must have space for a0..a3 to be stored
diff --git a/libc/arch-mips64/bionic/getdents.cpp b/libc/arch-mips64/bionic/getdents.cpp
deleted file mode 100644
index 66a61ec..0000000
--- a/libc/arch-mips64/bionic/getdents.cpp
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Copyright (C) 2014 The Android Open Source Project
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *  * Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- *  * Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in
- *    the documentation and/or other materials provided with the
- *    distribution.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
- * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
- * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
- * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
- * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
- * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/*
- * The MIPS64 getdents64() system call is only present in 3.10+ kernels.
- * If the getdents64() system call is not available fall back to using
- * getdents() and modify the result to be compatible with getdents64().
- */
-
-#include <dirent.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-
-/* The mips_getdents type is 64bit clean */
-struct mips_dirent {
-        uint64_t d_ino;     /* Inode number */
-        uint64_t d_off;     /* Offset to next mips_dirent */
-        uint16_t d_reclen;  /* Length of this mips_dirent */
-        char     d_name[];  /* Filename (null-terminated) */
-                            /* length is actually (d_reclen - 2 -
-                               offsetof(struct mips_dirent, d_name) */
-        // char  pad;       /* Zero padding byte */
-        // char  d_type;    /* File type (only since Linux 2.6.4; offset is (d_reclen - 1)) */
-};
-
-extern "C" int __getdents64(unsigned int fd, struct dirent *dirp, unsigned int count);
-extern "C" int __getdents(unsigned int fd, struct mips_dirent *dirp, unsigned int count);
-int getdents(unsigned int fd, struct dirent *dirp, unsigned int count)
-{
-        int r;
-        int oerrno = errno;
-
-        /* Use getdents64() if it is available */
-        r = __getdents64(fd, dirp, count);
-        if (r >= 0 || errno != ENOSYS)
-                return r;
-
-        /* Fallback to getdents() */
-        errno = oerrno;
-        r = __getdents(fd, (struct mips_dirent *)dirp, count);
-        if (r > 0) {
-                char *p;
-                char type;
-                union dirents {
-                        struct mips_dirent m;
-                        struct dirent d;
-                } *u;
-
-                p = (char *)dirp;
-                do {
-                        u = (union dirents *)p;
-
-                        /* This should not happen, but just in case... */
-                        if (p + u->m.d_reclen > (char *)dirp + r)
-                                break;
-
-                        /* shuffle the dirent */
-                        type = *(p + u->m.d_reclen - 1);
-                        memmove(u->d.d_name, u->m.d_name,
-                                u->m.d_reclen - 2 - offsetof(struct mips_dirent, d_name) + 1);
-                        u->d.d_type = type;
-
-                        p += u->m.d_reclen;
-                } while (p < (char *)dirp + r);
-        }
-        return r;
-}
diff --git a/libc/arch-mips64/mips64.mk b/libc/arch-mips64/mips64.mk
index 799eb6d..fce957b 100644
--- a/libc/arch-mips64/mips64.mk
+++ b/libc/arch-mips64/mips64.mk
@@ -42,7 +42,6 @@
     arch-mips64/bionic/__bionic_clone.S \
     arch-mips64/bionic/_exit_with_stack_teardown.S \
     arch-mips64/bionic/__get_sp.S \
-    arch-mips64/bionic/getdents.cpp \
     arch-mips64/bionic/memcmp16.S \
     arch-mips64/bionic/_setjmp.S \
     arch-mips64/bionic/setjmp.S \
diff --git a/libc/arch-mips64/syscalls/__getdents.S b/libc/arch-mips64/syscalls/__getdents.S
deleted file mode 100644
index 0a70a72..0000000
--- a/libc/arch-mips64/syscalls/__getdents.S
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Generated by gensyscalls.py. Do not edit. */
-
-#include <private/bionic_asm.h>
-
-ENTRY(__getdents)
-    .set push
-    .set noreorder
-    li v0, __NR_getdents
-    syscall
-    bnez a3, 1f
-    move a0, v0
-    j ra
-    nop
-1:
-    move t0, ra
-    bal     2f
-    nop
-2:
-    .cpsetup ra, t1, 2b
-    LA t9,__set_errno
-    .cpreturn
-    j t9
-    move ra, t0
-    .set pop
-END(__getdents)
-.hidden __getdents
diff --git a/libc/arch-x86/bionic/__bionic_clone.S b/libc/arch-x86/bionic/__bionic_clone.S
index 0c0feff..917dc68 100644
--- a/libc/arch-x86/bionic/__bionic_clone.S
+++ b/libc/arch-x86/bionic/__bionic_clone.S
@@ -39,7 +39,7 @@
 .L_bc_child:
         # We don't want anyone to unwind past this point.
         .cfi_undefined %eip
-        call    __bionic_clone_entry
+        call    __start_thread
         hlt
 
 .L_bc_parent:
diff --git a/libc/arch-x86/syscalls/getdents.S b/libc/arch-x86/syscalls/__getdents64.S
similarity index 93%
rename from libc/arch-x86/syscalls/getdents.S
rename to libc/arch-x86/syscalls/__getdents64.S
index 0627532..3fc8719 100644
--- a/libc/arch-x86/syscalls/getdents.S
+++ b/libc/arch-x86/syscalls/__getdents64.S
@@ -2,7 +2,7 @@
 
 #include <private/bionic_asm.h>
 
-ENTRY(getdents)
+ENTRY(__getdents64)
     pushl   %ebx
     .cfi_def_cfa_offset 8
     .cfi_rel_offset ebx, 0
@@ -28,4 +28,4 @@
     popl    %ecx
     popl    %ebx
     ret
-END(getdents)
+END(__getdents64)
diff --git a/libc/arch-x86_64/bionic/__bionic_clone.S b/libc/arch-x86_64/bionic/__bionic_clone.S
index 173ab5c..e0ce5a6 100644
--- a/libc/arch-x86_64/bionic/__bionic_clone.S
+++ b/libc/arch-x86_64/bionic/__bionic_clone.S
@@ -62,12 +62,12 @@
         .cfi_undefined %rip
         .cfi_undefined %rbp
 
-        # We're in the child now, so call __bionic_clone_entry
+        # We're in the child now, so call __start_thread
         # with the arguments from the child stack moved into
         # the appropriate registers.
         popq    %rdi  # fn
         popq    %rsi  # arg
-        call    __bionic_clone_entry
+        call    __start_thread
         hlt
 
 .L_bc_parent:
diff --git a/libc/arch-x86_64/syscalls/getdents.S b/libc/arch-x86_64/syscalls/__getdents64.S
similarity index 80%
rename from libc/arch-x86_64/syscalls/getdents.S
rename to libc/arch-x86_64/syscalls/__getdents64.S
index 15e0f7e..64f82fd 100644
--- a/libc/arch-x86_64/syscalls/getdents.S
+++ b/libc/arch-x86_64/syscalls/__getdents64.S
@@ -2,7 +2,7 @@
 
 #include <private/bionic_asm.h>
 
-ENTRY(getdents)
+ENTRY(__getdents64)
     movl    $__NR_getdents64, %eax
     syscall
     cmpq    $-MAX_ERRNO, %rax
@@ -12,4 +12,5 @@
     call    __set_errno
 1:
     ret
-END(getdents)
+END(__getdents64)
+.hidden __getdents64
diff --git a/libc/bionic/assert.cpp b/libc/bionic/assert.cpp
index ba67143..985fc38 100644
--- a/libc/bionic/assert.cpp
+++ b/libc/bionic/assert.cpp
@@ -34,10 +34,12 @@
 
 void __assert(const char* file, int line, const char* failed_expression) {
   __libc_fatal("%s:%d: assertion \"%s\" failed", file, line, failed_expression);
-  /* NOTREACHED */
 }
 
 void __assert2(const char* file, int line, const char* function, const char* failed_expression) {
   __libc_fatal("%s:%d: %s: assertion \"%s\" failed", file, line, function, failed_expression);
-  /* NOTREACHED */
+}
+
+extern "C" __LIBC_HIDDEN__ void longjmperror() {
+  __libc_fatal("longjmp botch");
 }
diff --git a/libc/bionic/clone.cpp b/libc/bionic/clone.cpp
index d38a422..001e245 100644
--- a/libc/bionic/clone.cpp
+++ b/libc/bionic/clone.cpp
@@ -35,7 +35,7 @@
 extern "C" __noreturn void __exit(int status);
 
 // Called from the __bionic_clone assembler to call the thread function then exit.
-extern "C" __LIBC_HIDDEN__ void __bionic_clone_entry(int (*fn)(void*), void* arg) {
+extern "C" __LIBC_HIDDEN__ void __start_thread(int (*fn)(void*), void* arg) {
   int status = (*fn)(arg);
   __exit(status);
 }
diff --git a/libc/bionic/dirent.cpp b/libc/bionic/dirent.cpp
index 0f9b26a..7abc7f3 100644
--- a/libc/bionic/dirent.cpp
+++ b/libc/bionic/dirent.cpp
@@ -37,6 +37,8 @@
 #include "private/ErrnoRestorer.h"
 #include "private/ScopedPthreadMutexLocker.h"
 
+extern "C" int __getdents64(unsigned int, dirent*, unsigned int);
+
 struct DIR {
   int fd_;
   size_t available_bytes_;
@@ -81,7 +83,7 @@
 }
 
 static bool __fill_DIR(DIR* d) {
-  int rc = TEMP_FAILURE_RETRY(getdents(d->fd_, d->buff_, sizeof(d->buff_)));
+  int rc = TEMP_FAILURE_RETRY(__getdents64(d->fd_, d->buff_, sizeof(d->buff_)));
   if (rc <= 0) {
     return false;
   }
diff --git a/libc/bionic/dlmalloc.h b/libc/bionic/dlmalloc.h
index 482fe0e..e065687 100644
--- a/libc/bionic/dlmalloc.h
+++ b/libc/bionic/dlmalloc.h
@@ -32,15 +32,10 @@
 #define USE_SPIN_LOCKS 0
 #define DEFAULT_MMAP_THRESHOLD (64U * 1024U)
 
-__BEGIN_DECLS
-
 /* Export two symbols used by the VM. */
+__BEGIN_DECLS
 int dlmalloc_trim(size_t) __LIBC_ABI_PUBLIC__;
 void dlmalloc_inspect_all(void (*handler)(void*, void*, size_t, void*), void*) __LIBC_ABI_PUBLIC__;
-
-/* NVIDIA's libglcore.so has a reference to dlmalloc_usable_size. TODO: remove this. */
-size_t dlmalloc_usable_size(const void*) __LIBC_ABI_PUBLIC__;
-
 __END_DECLS
 
 /* Include the proper definitions. */
diff --git a/libc/bionic/md5.c b/libc/bionic/md5.c
deleted file mode 100644
index ba4aaed..0000000
--- a/libc/bionic/md5.c
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 
- * 3. Neither the name of the Institute nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-
-__RCSID("$Heimdal: md5.c,v 1.15 2001/01/29 04:33:44 assar Exp $"
-        "$NetBSD: md5.c,v 1.1.1.4 2002/09/12 12:41:42 joda Exp $");
-#endif
-
-#include <endian.h>
-#include "md5.h"
-#include "hash.h"
-
-#define A m->counter[0]
-#define B m->counter[1]
-#define C m->counter[2]
-#define D m->counter[3]
-#define X data
-
-void
-MD5_Init (struct md5 *m)
-{
-  m->sz[0] = 0;
-  m->sz[1] = 0;
-  D = 0x10325476;
-  C = 0x98badcfe;
-  B = 0xefcdab89;
-  A = 0x67452301;
-}
-
-#define F(x,y,z) CRAYFIX((x & y) | (~x & z))
-#define G(x,y,z) CRAYFIX((x & z) | (y & ~z))
-#define H(x,y,z) (x ^ y ^ z)
-#define I(x,y,z) CRAYFIX(y ^ (x | ~z))
-
-#define DOIT(a,b,c,d,k,s,i,OP) \
-a = b + cshift(a + OP(b,c,d) + X[k] + (i), s)
-
-#define DO1(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,F)
-#define DO2(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,G)
-#define DO3(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,H)
-#define DO4(a,b,c,d,k,s,i) DOIT(a,b,c,d,k,s,i,I)
-
-static inline void
-calc (struct md5 *m, u_int32_t *data)
-{
-  u_int32_t AA, BB, CC, DD;
-
-  AA = A;
-  BB = B;
-  CC = C;
-  DD = D;
-
-  /* Round 1 */
-
-  DO1(A,B,C,D,0,7,0xd76aa478);
-  DO1(D,A,B,C,1,12,0xe8c7b756);
-  DO1(C,D,A,B,2,17,0x242070db);
-  DO1(B,C,D,A,3,22,0xc1bdceee);
-
-  DO1(A,B,C,D,4,7,0xf57c0faf);
-  DO1(D,A,B,C,5,12,0x4787c62a);
-  DO1(C,D,A,B,6,17,0xa8304613);
-  DO1(B,C,D,A,7,22,0xfd469501);
-
-  DO1(A,B,C,D,8,7,0x698098d8);
-  DO1(D,A,B,C,9,12,0x8b44f7af);
-  DO1(C,D,A,B,10,17,0xffff5bb1);
-  DO1(B,C,D,A,11,22,0x895cd7be);
-
-  DO1(A,B,C,D,12,7,0x6b901122);
-  DO1(D,A,B,C,13,12,0xfd987193);
-  DO1(C,D,A,B,14,17,0xa679438e);
-  DO1(B,C,D,A,15,22,0x49b40821);
-
-  /* Round 2 */
-
-  DO2(A,B,C,D,1,5,0xf61e2562);
-  DO2(D,A,B,C,6,9,0xc040b340);
-  DO2(C,D,A,B,11,14,0x265e5a51);
-  DO2(B,C,D,A,0,20,0xe9b6c7aa);
-
-  DO2(A,B,C,D,5,5,0xd62f105d);
-  DO2(D,A,B,C,10,9,0x2441453);
-  DO2(C,D,A,B,15,14,0xd8a1e681);
-  DO2(B,C,D,A,4,20,0xe7d3fbc8);
-
-  DO2(A,B,C,D,9,5,0x21e1cde6);
-  DO2(D,A,B,C,14,9,0xc33707d6);
-  DO2(C,D,A,B,3,14,0xf4d50d87);
-  DO2(B,C,D,A,8,20,0x455a14ed);
-
-  DO2(A,B,C,D,13,5,0xa9e3e905);
-  DO2(D,A,B,C,2,9,0xfcefa3f8);
-  DO2(C,D,A,B,7,14,0x676f02d9);
-  DO2(B,C,D,A,12,20,0x8d2a4c8a);
-
-  /* Round 3 */
-
-  DO3(A,B,C,D,5,4,0xfffa3942);
-  DO3(D,A,B,C,8,11,0x8771f681);
-  DO3(C,D,A,B,11,16,0x6d9d6122);
-  DO3(B,C,D,A,14,23,0xfde5380c);
-
-  DO3(A,B,C,D,1,4,0xa4beea44);
-  DO3(D,A,B,C,4,11,0x4bdecfa9);
-  DO3(C,D,A,B,7,16,0xf6bb4b60);
-  DO3(B,C,D,A,10,23,0xbebfbc70);
-
-  DO3(A,B,C,D,13,4,0x289b7ec6);
-  DO3(D,A,B,C,0,11,0xeaa127fa);
-  DO3(C,D,A,B,3,16,0xd4ef3085);
-  DO3(B,C,D,A,6,23,0x4881d05);
-
-  DO3(A,B,C,D,9,4,0xd9d4d039);
-  DO3(D,A,B,C,12,11,0xe6db99e5);
-  DO3(C,D,A,B,15,16,0x1fa27cf8);
-  DO3(B,C,D,A,2,23,0xc4ac5665);
-
-  /* Round 4 */
-
-  DO4(A,B,C,D,0,6,0xf4292244);
-  DO4(D,A,B,C,7,10,0x432aff97);
-  DO4(C,D,A,B,14,15,0xab9423a7);
-  DO4(B,C,D,A,5,21,0xfc93a039);
-
-  DO4(A,B,C,D,12,6,0x655b59c3);
-  DO4(D,A,B,C,3,10,0x8f0ccc92);
-  DO4(C,D,A,B,10,15,0xffeff47d);
-  DO4(B,C,D,A,1,21,0x85845dd1);
-
-  DO4(A,B,C,D,8,6,0x6fa87e4f);
-  DO4(D,A,B,C,15,10,0xfe2ce6e0);
-  DO4(C,D,A,B,6,15,0xa3014314);
-  DO4(B,C,D,A,13,21,0x4e0811a1);
-
-  DO4(A,B,C,D,4,6,0xf7537e82);
-  DO4(D,A,B,C,11,10,0xbd3af235);
-  DO4(C,D,A,B,2,15,0x2ad7d2bb);
-  DO4(B,C,D,A,9,21,0xeb86d391);
-
-  A += AA;
-  B += BB;
-  C += CC;
-  D += DD;
-}
-
-/*
- * From `Performance analysis of MD5' by Joseph D. Touch <touch@isi.edu>
- */
-#if !defined(__BYTE_ORDER) || !defined (__BIG_ENDIAN)
-#error __BYTE_ORDER macros not defined
-#endif
-
-#if __BYTE_ORDER == __BIG_ENDIAN
-static inline u_int32_t
-swap_u_int32_t (u_int32_t t)
-{
-  u_int32_t temp1, temp2;
-
-  temp1   = cshift(t, 16);
-  temp2   = temp1 >> 8;
-  temp1  &= 0x00ff00ff;
-  temp2  &= 0x00ff00ff;
-  temp1 <<= 8;
-  return temp1 | temp2;
-}
-#endif
-
-struct x32{
-  unsigned int a:32;
-  unsigned int b:32;
-};
-
-void
-MD5_Update (struct md5 *m, const void *v, size_t len)
-{
-  const unsigned char *p = v;
-  size_t old_sz = m->sz[0];
-  size_t offset;
-
-  m->sz[0] += len * 8;
-  if (m->sz[0] < old_sz)
-      ++m->sz[1];
-  offset = (old_sz / 8)  % 64;
-  while(len > 0){
-    size_t l = min(len, 64 - offset);
-    memcpy(m->save + offset, p, l);
-    offset += l;
-    p += l;
-    len -= l;
-    if(offset == 64){
-#if __BYTE_ORDER == __BIG_ENDIAN
-      int i;
-      u_int32_t current[16];
-      struct x32 *u = (struct x32*)m->save;
-      for(i = 0; i < 8; i++){
-	current[2*i+0] = swap_u_int32_t(u[i].a);
-	current[2*i+1] = swap_u_int32_t(u[i].b);
-      }
-      calc(m, current);
-#else
-      calc(m, (u_int32_t*)m->save);
-#endif
-      offset = 0;
-    }
-  }
-}
-
-void
-MD5_Final (void *res, struct md5 *m)
-{
-  unsigned char zeros[72];
-  unsigned offset = (m->sz[0] / 8) % 64;
-  unsigned int dstart = (120 - offset - 1) % 64 + 1;
-
-  *zeros = 0x80;
-  memset (zeros + 1, 0, sizeof(zeros) - 1);
-  zeros[dstart+0] = (m->sz[0] >> 0) & 0xff;
-  zeros[dstart+1] = (m->sz[0] >> 8) & 0xff;
-  zeros[dstart+2] = (m->sz[0] >> 16) & 0xff;
-  zeros[dstart+3] = (m->sz[0] >> 24) & 0xff;
-  zeros[dstart+4] = (m->sz[1] >> 0) & 0xff;
-  zeros[dstart+5] = (m->sz[1] >> 8) & 0xff;
-  zeros[dstart+6] = (m->sz[1] >> 16) & 0xff;
-  zeros[dstart+7] = (m->sz[1] >> 24) & 0xff;
-  MD5_Update (m, zeros, dstart + 8);
-  {
-      int i;
-      unsigned char *r = (unsigned char *)res;
-
-      for (i = 0; i < 4; ++i) {
-	  r[4*i]   = m->counter[i] & 0xFF;
-	  r[4*i+1] = (m->counter[i] >> 8) & 0xFF;
-	  r[4*i+2] = (m->counter[i] >> 16) & 0xFF;
-	  r[4*i+3] = (m->counter[i] >> 24) & 0xFF;
-      }
-  }
-#if 0
-  {
-    int i;
-    u_int32_t *r = (u_int32_t *)res;
-
-    for (i = 0; i < 4; ++i)
-      r[i] = swap_u_int32_t (m->counter[i]);
-  }
-#endif
-}
diff --git a/libc/bionic/md5.h b/libc/bionic/md5.h
deleted file mode 100644
index a381994..0000000
--- a/libc/bionic/md5.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 1995 - 2001 Kungliga Tekniska Högskolan
- * (Royal Institute of Technology, Stockholm, Sweden).
- * All rights reserved.
- * 
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 
- * 3. Neither the name of the Institute nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE INSTITUTE AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE INSTITUTE OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-/* $Heimdal: md5.h,v 1.8 2001/01/29 02:08:57 assar Exp $
-   $NetBSD: md5.h,v 1.1.1.4 2002/09/12 12:41:42 joda Exp $ */
-
-#include <stdlib.h>
-#include <sys/types.h>
-
-struct md5 {
-  unsigned int sz[2];
-  u_int32_t counter[4];
-  unsigned char save[64];
-};
-
-typedef struct md5 MD5_CTX;
-
-void MD5_Init (struct md5 *m);
-void MD5_Update (struct md5 *m, const void *p, size_t len);
-void MD5_Final (void *res, struct md5 *m); /* u_int32_t res[4] */
diff --git a/libc/bionic/ndk_cruft.cpp b/libc/bionic/ndk_cruft.cpp
index cb9c9c9..15a3206 100644
--- a/libc/bionic/ndk_cruft.cpp
+++ b/libc/bionic/ndk_cruft.cpp
@@ -30,6 +30,7 @@
 #if !defined(__LP64__)
 
 #include <ctype.h>
+#include <dirent.h>
 #include <inttypes.h>
 #include <pthread.h>
 #include <signal.h>
@@ -238,4 +239,15 @@
   return _signal(signum, handler, SA_RESETHAND);
 }
 
+// This is a system call that was never in POSIX. Use readdir(3) instead.
+extern "C" int __getdents64(unsigned int, dirent*, unsigned int);
+extern "C" int getdents(unsigned int fd, dirent* dirp, unsigned int count) {
+  return __getdents64(fd, dirp, count);
+}
+
+// This is a BSDism that we never implemented correctly. Used by Firefox.
+extern "C" int issetugid() {
+  return 0;
+}
+
 #endif
diff --git a/libc/include/dirent.h b/libc/include/dirent.h
index 71eb2e7..a849a61 100644
--- a/libc/include/dirent.h
+++ b/libc/include/dirent.h
@@ -75,7 +75,6 @@
 extern int alphasort64(const struct dirent64**, const struct dirent64**);
 extern int scandir(const char*, struct dirent***, int (*)(const struct dirent*), int (*)(const struct dirent**, const struct dirent**));
 extern int scandir64(const char*, struct dirent64***, int (*)(const struct dirent64*), int (*)(const struct dirent64**, const struct dirent64**));
-extern int getdents(unsigned int, struct dirent*, unsigned int);
 
 __END_DECLS
 
diff --git a/libc/include/limits.h b/libc/include/limits.h
index dc45902..fb09657 100644
--- a/libc/include/limits.h
+++ b/libc/include/limits.h
@@ -112,7 +112,7 @@
 
 #define SSIZE_MAX LONG_MAX
 
-#define MB_LEN_MAX 6
+#define MB_LEN_MAX 4
 
 /* New code should use sysconf(_SC_PAGE_SIZE) instead. */
 #ifndef PAGE_SIZE
diff --git a/libc/include/setjmp.h b/libc/include/setjmp.h
index 68fdcef..02b06f5 100644
--- a/libc/include/setjmp.h
+++ b/libc/include/setjmp.h
@@ -50,7 +50,6 @@
 
 int     _setjmp(jmp_buf);
 void    _longjmp(jmp_buf, int);
-void    longjmperror(void);
 
 int     setjmp(jmp_buf);
 void    longjmp(jmp_buf, int);
diff --git a/libc/include/stdlib.h b/libc/include/stdlib.h
index 834dcda..483aaf0 100644
--- a/libc/include/stdlib.h
+++ b/libc/include/stdlib.h
@@ -167,7 +167,7 @@
 extern int	wctomb(char *, wchar_t);
 extern size_t	wcstombs(char *, const wchar_t *, size_t);
 
-#define MB_CUR_MAX 1
+#define MB_CUR_MAX 4U
 
 #if 0 /* MISSING FROM BIONIC */
 extern int on_exit(void (*)(int, void *), void *);
diff --git a/libc/include/syslog.h b/libc/include/syslog.h
index 4677c14..a52e811 100644
--- a/libc/include/syslog.h
+++ b/libc/include/syslog.h
@@ -25,6 +25,7 @@
  * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  */
+
 #ifndef _SYSLOG_H
 #define _SYSLOG_H
 
@@ -34,7 +35,6 @@
 
 __BEGIN_DECLS
 
-/* Alert levels */
 #define LOG_EMERG	0
 #define LOG_ALERT	1
 #define LOG_CRIT	2
@@ -47,8 +47,6 @@
 #define LOG_PRIMASK	7
 #define LOG_PRI(x)	((x) & LOG_PRIMASK)
 
-
-/* Facilities; not actually used */
 #define LOG_KERN	0000
 #define LOG_USER	0010
 #define LOG_MAIL	0020
@@ -73,30 +71,15 @@
 #define LOG_FACMASK	01770
 #define LOG_FAC(x)	(((x) >> 3) & (LOG_FACMASK >> 3))
 
-#define	LOG_MASK(pri)	(1 << (pri))		/* mask for one priority */
-#define	LOG_UPTO(pri)	((1 << ((pri)+1)) - 1)	/* all priorities through pri */
+#define LOG_MASK(pri) (1 << (pri))
+#define LOG_UPTO(pri) ((1 << ((pri)+1)) - 1)
 
-/* openlog() flags; only LOG_PID and LOG_PERROR supported */
-#define        LOG_PID         0x01    /* include pid with message */
-#define        LOG_CONS        0x02    /* write to console on logger error */
-#define        LOG_ODELAY      0x04    /* delay connection until syslog() */
-#define        LOG_NDELAY      0x08    /* open connection immediately */
-#define        LOG_NOWAIT      0x10    /* wait for child processes (unused on linux) */
-#define        LOG_PERROR      0x20    /* additional logging to stderr */
-
-/* BIONIC: the following definitions are from OpenBSD's sys/syslog.h
- */
-struct syslog_data {
-	int	log_file;
-        int	connected;
-        int	opened;
-        int	log_stat;
-        const char 	*log_tag;
-        int 	log_fac;
-        int 	log_mask;
-};
-
-#define SYSLOG_DATA_INIT {-1, 0, 0, 0, (const char *)0, LOG_USER, 0xff}
+#define LOG_PID    0x01    /* include pid with message */
+#define LOG_CONS   0x02    /* write to console on logger error */
+#define LOG_ODELAY 0x04    /* delay connection until syslog() */
+#define LOG_NDELAY 0x08    /* open connection immediately */
+#define LOG_NOWAIT 0x10    /* wait for child processes (unused on linux) */
+#define LOG_PERROR 0x20    /* additional logging to stderr */
 
 #define _PATH_LOG  "/dev/syslog"
 
@@ -105,11 +88,6 @@
 extern int	setlogmask(int);
 extern void	syslog(int, const char *, ...) __printflike(2, 3);
 extern void	vsyslog(int, const char *, va_list) __printflike(2, 0);
-extern void	closelog_r(struct syslog_data *);
-extern void	openlog_r(const char *, int, int, struct syslog_data *);
-extern int	setlogmask_r(int, struct syslog_data *);
-extern void	syslog_r(int, struct syslog_data *, const char *, ...) __printflike(3, 4);
-extern void	vsyslog_r(int, struct syslog_data *, const char *, va_list) __printflike(3, 0);
 
 __END_DECLS
 
diff --git a/libc/kernel/README.TXT b/libc/kernel/README.TXT
index e4c11a1..0edbcc6 100644
--- a/libc/kernel/README.TXT
+++ b/libc/kernel/README.TXT
@@ -1,93 +1,47 @@
-Bionic comes with a set of 'clean' Linux kernel headers that can safely be
-included by userland applications and libraries without fear of hideous
-conflicts. for more information why this is needed, see the "RATIONALE"
-section at the end of this document.
+Bionic comes with a processed set of all of the uapi Linux kernel headers that
+can safely be included by userland applications and libraries.
 
-these clean headers are automatically generated by several scripts located
-in the 'bionic/kernel/tools' directory, which process a set of original
-and unmodified kernel headers in order to get rid of many annoying
+These clean headers are automatically generated by several scripts located
+in the 'bionic/kernel/tools' directory. The tools process the original
+unmodified kernel headers in order to get rid of many annoying
 declarations and constructs that usually result in compilation failure.
 
-the 'clean headers' only contain type and macro definitions, with the
+The 'clean headers' only contain type and macro definitions, with the
 exception of a couple static inline functions used for performance
-reason (e.g. optimized CPU-specific byte-swapping routines)
+reason (e.g. optimized CPU-specific byte-swapping routines).
 
-they can be included from C++, or when compiling code in strict ANSI mode.
-they can be also included before or after any Bionic C library header.
+They can be included from C++, or when compiling code in strict ANSI mode.
+They can be also included before or after any Bionic C library header.
 
-the generation process works as follows:
+Description of the directories involved in generating the parsed kernel headers:
 
   * 'external/kernel-headers/original/'
-    contains a set of kernel headers as normally found in the 'include'
-    directory of a normal Linux kernel source tree. note that this should
-    only contain the files that are really needed by Android (use
-    'find_headers.py' to find these automatically).
+    Contains the uapi kernel headers found in the android kernel. Note this
+    also includes the header files that are generated by building the kernel
+    sources.
 
-  * 'bionic/libc/kernel/common'
-    contains the non-arch-specific clean headers and directories
-    (e.g. linux, asm-generic and mtd)
+  * 'bionic/libc/kernel/uapi'
+    Contains the cleaned kernel headers and mirrors the directory structure
+    in 'external/kernel-headers/original/uapi/'.
 
-  * 'bionic/libc/kernel/arch-arm/'
-    contains the ARM-specific directory tree of clean headers.
+  * 'bionic/libc/kernel/tools'
+    Contains various Python and shell scripts used to get and re-generate
+    the headers.
 
-  * 'bionic/libc/kernel/arch-arm/asm'
-    contains the real ARM-specific headers
+The tools to get/parse the headers:
 
-  * 'bionic/libc/kernel/arch-x86'
-    'bionic/libc/kernel/arch-x86/asm'
-    similarly contains all headers and symlinks to be used on x86
-
-  * 'bionic/libc/kernel/tools' contains various Python and shell scripts used
-    to manage and re-generate the headers
-
-the tools you can use are:
-
-  * tools/find_users.py
-    scans a list of source files or directories and prints which ones do
-    include Linux headers.
-
-  * tools/find_headers.py
-    scans a list of source files or directories and recursively finds all
-    the original kernel headers they need.
+  * tools/generate_uapi_headers.sh
+    Checks out the android kernel and generates all uapi header files.
+    copies all the changed files into external/kernel-headers.
 
   * tools/clean_header.py
-    prints the clean version of a given kernel header. with the -u option,
+    Prints the clean version of a given kernel header. With the -u option,
     this will also update the corresponding clean header file if its
-    content has changed. you can also process more than one file with -u
+    content has changed. You can also process more than one file with -u.
 
   * tools/update_all.py
-    automatically update all clean headers from the content of 
-    'external/kernel-headers/original'. this is the script you're likely going to
-    run whenever you update the original headers.
-
-
-HOW TO BUILD BIONIC AND OTHER PROGRAMS WITH THE CLEAN HEADERS:
-==============================================================
-
-add bionic/kernel/common and bionic/kernel/arch-<yourarch> to your C
-include path. that should be enough. Note that Bionic will not compile properly 
-if you don't.
-
-
-HOW TO SUPPORT ANOTHER ARCHITECTURE:
-====================================
-
-see the content of tools/defaults.py, you will need to make a few updates
-here:
-
-  - add a new item to the 'kernel_archs' list of supported architectures
-
-  - add a proper definition for 'kernel_known_<arch>_statics' with
-    relevant definitions.
-
-  - update 'kernel_known_statics' to map "<arch>" to
-    'kernel_known_<arch>_statics'
-
-then, add the new architecture-specific headers to original/asm-<arch>.
-(please ensure that these are really needed, e.g. with tools/find_headers.py)
-
-finally, run tools/update_all.py
-
+    Automatically update all clean headers from the content of
+    'external/kernel-headers/original'.
 
 
 HOW TO UPDATE THE HEADERS WHEN NEEDED:
@@ -99,81 +53,13 @@
   NOT BREAK THE KERNEL <-> USER ABI, FOR EXAMPLE BY CHANGING THE SIZE
   OF A GIVEN TYPE. THIS TASK CANNOT BE EASILY AUTOMATED AT THE MOMENT
 
-copy any updated kernel header into the corresponding location under
-'bionic/kernel/original'.
+Grab the latest headers from the android kernel by running this command:
 
-for any new kernel header you want to add, first run tools/find_headers.py to be
-sure that it is really needed by the Android sources. then add it to
-'bionic/kernel/original'
+  bionic/kernel/tools/generate_uapi_headers.sh --download-kernel
 
-then, run tools/update_all.py to re-run the auto-cleaning
+Next, run this command to copy the parsed files to bionic/libc/kernel/uapi:
 
+  bionic/kernel/tools/update_all.py
 
-
-HOW THE CLEANUP PROCESS WORKS:
-==============================
-
-this section describes the action performed by the cleanup program(s) when they
-process the original kernel headers into clean ones:
-
-1. Optimize well-known macros (e.g. __KERNEL__, __KERNEL_STRICT_NAMES)
-
-    this pass gets rid of everything that is guarded by a well-known macro
-    definition. this means that a block like
-
-       #ifdef __KERNEL__
-       ....
-       #endif
-
-    will be totally omitted from the output. the optimizer is smart enough to
-    handle all complex C-preprocessor conditional expression appropriately.
-    this means that, for example:
-
-       #if defined(__KERNEL__) || defined(FOO)
-       ...
-       #endif
-
-    will be transformed into:
-
-       #ifdef FOO
-       ...
-       #endif
-
-    see tools/defaults.py for the list of well-known macros used in this pass,
-    in case you need to update it in the future.
-
-    note that this also remove any reference to a kernel-specific configuration
-    macro like CONFIG_FOO from the clean headers.
-
-
-2. remove variable and function declarations:
-
-  this pass scans non-directive text and only keeps things that look like a
-  typedef/struct/union/enum declaration. this allows to get rid of any variable
-  or function declaration that should only be used within the kernel anyway
-  (and which normally *should* be guarded in a #ifdef __KERNEL__ ... #endif
-  block, if the kernel writers were not so messy)
-
-  there are however a few exceptions: it is seldom useful to keep the definition
-  of some static inline functions performing very simple operations. a good
-  example is the optimized 32-bit byte-swap function found in
-  arch-arm/asm/byteorder.h
-
-  the list of exceptions is in tools/defaults.py in case you need to update it
-  in the future.
-
-  note that we do *not* remove macro definitions, including these macro that
-  perform a call to one of these kernel-header functions, or even define other
-  functions. we consider it safe since userland applications have no business
-  using them anyway.
-
-
-3. whitespace cleanup:
-
-  the final pass remove any comments and empty lines from the final headers.
-
-
-4. add a standard disclaimer:
-
-  prepended to each generated header, contains a message like
-  "do not edit directly - file was auto-generated by ...."
+After this, you will need to build/test the tree to make sure that these
+changes do not introduce any errors.
diff --git a/libc/kernel/tools/clean_header.py b/libc/kernel/tools/clean_header.py
index 238087b..6601817 100755
--- a/libc/kernel/tools/clean_header.py
+++ b/libc/kernel/tools/clean_header.py
@@ -1,5 +1,78 @@
 #!/usr/bin/env python
+
+#------------------------------------------------------------------------------
+# Description of the header clean process
+#------------------------------------------------------------------------------
+# Here is the list of actions performed by this script to clean the original
+# kernel headers.
 #
+# 1. Optimize well-known macros (e.g. __KERNEL__, __KERNEL_STRICT_NAMES)
+#
+#     This pass gets rid of everything that is guarded by a well-known macro
+#     definition. This means that a block like:
+#
+#        #ifdef __KERNEL__
+#        ....
+#        #endif
+#
+#     Will be totally omitted from the output. The optimizer is smart enough to
+#     handle all complex C-preprocessor conditional expression appropriately.
+#     This means that, for example:
+#
+#        #if defined(__KERNEL__) || defined(FOO)
+#        ...
+#        #endif
+#
+#     Will be transformed into:
+#
+#        #ifdef FOO
+#        ...
+#        #endif
+#
+#     See tools/defaults.py for the list of well-known macros used in this pass,
+#     in case you need to update it in the future.
+#
+#     Note that this also removes any reference to a kernel-specific
+#     configuration macro like CONFIG_FOO from the clean headers.
+#
+#
+# 2. Remove variable and function declarations:
+#
+#   This pass scans non-directive text and only keeps things that look like a
+#   typedef/struct/union/enum declaration. This allows us to get rid of any
+#   variables or function declarations that should only be used within the
+#   kernel anyway (and which normally *should* be guarded by an #ifdef
+#   __KERNEL__ ...  #endif block, if the kernel writers were not so messy).
+#
+#   There are, however, a few exceptions: it is seldom useful to keep the
+#   definition of some static inline functions performing very simple
+#   operations. A good example is the optimized 32-bit byte-swap function
+#   found in:
+#
+#     arch-arm/asm/byteorder.h
+#
+#   The list of exceptions is in tools/defaults.py in case you need to update
+#   it in the future.
+#
+#   Note that we do *not* remove macro definitions, including these macro that
+#   perform a call to one of these kernel-header functions, or even define other
+#   functions. We consider it safe since userland applications have no business
+#   using them anyway.
+#
+#
+# 3. Whitespace cleanup:
+#
+#   The final pass removes any comments and empty lines from the final headers.
+#
+#
+# 4. Add a standard disclaimer:
+#
+#   The message:
+#
+#   /* WARNING: DO NOT EDIT, AUTO-GENERATED CODE - SEE TOP FOR INSTRUCTIONS */
+#
+#   Is prepended to each generated header.
+#------------------------------------------------------------------------------
 
 import sys, cpp, kernel, glob, os, re, getopt
 from defaults import *
diff --git a/libc/kernel/tools/find_headers.py b/libc/kernel/tools/find_headers.py
deleted file mode 100755
index 9b3572a..0000000
--- a/libc/kernel/tools/find_headers.py
+++ /dev/null
@@ -1,170 +0,0 @@
-#!/usr/bin/env python
-#
-# this program is used to find source code that includes linux kernel headers directly
-# (e.g. with #include <linux/...> or #include <asm/...>)
-#
-# then it lists them on the standard output.
-
-import sys, cpp, glob, os, re, getopt, kernel
-from utils import *
-from defaults import *
-
-program_dir = find_program_dir()
-
-wanted_archs   = kernel_archs
-wanted_config  = None
-
-def usage():
-    print """\
-  usage:  find_headers.py [options] <kernel-root> (file|directory|@listfile)+
-
-     options:
-        -c <file>          specify .config file (none by default)
-
-        -a <archs>         used to specify an alternative list
-                           of architectures to support
-                           ('%s' by default)
-
-        -v                 enable verbose mode
-
-    this program is used to find all the kernel headers that are used
-    by a set of source files or directories containing them. the search
-    is recursive to find *all* required files.
-
-""" % ( string.join(kernel_archs,",") )
-    sys.exit(1)
-
-
-try:
-    optlist, args = getopt.getopt( sys.argv[1:], 'vc:d:a:k:' )
-except:
-    # unrecognized option
-    print "error: unrecognized option"
-    usage()
-
-for opt, arg in optlist:
-    if opt == '-a':
-        wanted_archs = string.split(arg,',')
-    elif opt == '-c':
-        wanted_config = arg
-    elif opt == '-v':
-        kernel.verboseSearch = 1
-        kernel.verboseFind   = 1
-        verbose = 1
-    else:
-        usage()
-
-if len(args) < 2:
-    usage()
-
-kernel_root = args[0]
-if not os.path.exists(kernel_root):
-    sys.stderr.write( "error: directory '%s' does not exist\n" % kernel_root )
-    sys.exit(1)
-
-if not os.path.isdir(kernel_root):
-    sys.stderr.write( "error: '%s' is not a directory\n" % kernel_root )
-    sys.exit(1)
-
-if not os.path.isdir(kernel_root+"/include/linux"):
-    sys.stderr.write( "error: '%s' does not have an 'include/linux' directory\n" % kernel_root )
-    sys.exit(1)
-
-if wanted_config:
-    if not os.path.exists(wanted_config):
-        sys.stderr.write( "error: file '%s' does not exist\n" % wanted_config )
-        sys.exit(1)
-
-    if not os.path.isfile(wanted_config):
-        sys.stderr.write( "error: '%s' is not a file\n" % wanted_config )
-        sys.exit(1)
-
-# find all architectures in the kernel tree
-archs   = []
-for archdir in os.listdir(kernel_root+"/arch"):
-    if os.path.exists("%s/arch/%s/include/asm" % (kernel_root, archdir)):
-        if verbose:
-            print "Found arch '%s'" % archdir
-        archs.append(archdir)
-
-# if we're using the 'kernel_headers' directory, there is only asm/
-# and no other asm-<arch> directories
-#
-in_kernel_headers = False
-if len(archs) == 0:
-    # this can happen when we're using the 'kernel_headers' directory
-    if os.path.isdir(kernel_root+"/asm"):
-        in_kernel_headers = True
-        archs = [ "arm", "mips"]
-
-# if the user has specified some architectures with -a <archs> ensure that
-# all those he wants are available from the kernel include tree
-if wanted_archs != None:
-    if in_kernel_headers and wanted_archs != [ "arm", "mips" ]:
-        sys.stderr.write( "error: when parsing kernel_headers, only 'arm' and 'mips' architectures are supported at the moment\n" )
-        sys.exit(1)
-    missing = []
-    for arch in wanted_archs:
-        if arch not in archs:
-            missing.append(arch)
-    if len(missing) > 0:
-        sys.stderr.write( "error: the following requested architectures are not in the kernel tree: " )
-        for a in missing:
-            sys.stderr.write( " %s" % a )
-        sys.stderr.write( "\n" )
-        sys.exit(1)
-
-    archs = wanted_archs
-
-# helper function used to walk the user files
-def parse_file(path, parser):
-    #print "parse %s" % path
-    parser.parseFile(path)
-
-
-# remove previous destination directory
-#destdir = "/tmp/bionic-kernel-headers/"
-#cleanup_dir(destdir)
-
-# try to read the config file
-try:
-    cparser = kernel.ConfigParser()
-    if wanted_config:
-        cparser.parseFile( wanted_config )
-except:
-    sys.stderr.write( "error: can't parse '%s'" % wanted_config )
-    sys.exit(1)
-
-kernel_config = cparser.getDefinitions()
-
-# first, obtain the list of kernel files used by our clients
-fparser = kernel.HeaderScanner()
-dir_excludes=[".repo","external/kernel-headers","ndk","out","prebuilt","bionic/libc/kernel","development/ndk","external/qemu/distrib"]
-walk_source_files( args[1:], parse_file, fparser, excludes=["./"+f for f in dir_excludes] )
-headers = fparser.getHeaders()
-files   = fparser.getFiles()
-
-# now recursively scan the kernel headers for additionnal sub-included headers
-hparser = kernel.KernelHeaderFinder(headers,archs,kernel_root,kernel_config)
-headers = hparser.scanForAllArchs()
-
-if 0:    # just for debugging
-    dumpHeaderUsers = False
-
-    print "the following %d headers:" % len(headers)
-    for h in sorted(headers):
-        if dumpHeaderUsers:
-            print "  %s (%s)" % (h, repr(hparser.getHeaderUsers(h)))
-        else:
-            print "  %s" % h
-
-    print "are used by the following %d files:" % len(files)
-    for f in sorted(files):
-        print "  %s" % f
-
-    sys.exit(0)
-
-for h in sorted(headers):
-    print "%s" % h
-
-sys.exit(0)
diff --git a/libc/kernel/tools/find_users.py b/libc/kernel/tools/find_users.py
deleted file mode 100755
index 5ee308c..0000000
--- a/libc/kernel/tools/find_users.py
+++ /dev/null
@@ -1,63 +0,0 @@
-#!/usr/bin/env python
-#
-# this program is used to find source code that includes linux kernel headers directly
-# (e.g. with #include <linux/...> or #include <asm/...>)
-#
-# then it lists
-
-import sys, cpp, glob, os, re, getopt
-import kernel
-from utils import *
-from defaults import *
-
-
-def usage():
-    print """\
-  usage:  find_users.py [-v] (file|directory|@listfile)+
-
-    this program is used to scan a list of files or directories for
-    sources that include kernel headers directly. the program prints
-    the list of said source files when it's done.
-
-    when scanning directories, only files matching the following
-    extension will be searched: .c .cpp .S .h
-
-    use -v to enable verbose output
-"""
-    sys.exit(1)
-
-
-try:
-    optlist, args = getopt.getopt( sys.argv[1:], 'v' )
-except:
-    # unrecognized option
-    print "error: unrecognized option"
-    usage()
-
-for opt, arg in optlist:
-    if opt == '-v':
-        kernel.verboseSearch = 1
-        kernel.verboseFind   = 1
-    else:
-        usage()
-
-if len(args) < 1:
-    usage()
-
-# helper function used to walk the user files
-def parse_file(path, parser):
-    parser.parseFile(path)
-
-
-# first, obtain the list of kernel files used by our clients
-# avoid parsing the 'kernel_headers' directory itself since we
-# use this program with the Android source tree by default.
-#
-fparser = kernel.HeaderScanner()
-walk_source_files( args, parse_file, fparser, excludes=["kernel_headers","original"] )
-files   = fparser.getFiles()
-
-for f in sorted(files):
-    print f
-
-sys.exit(0)
diff --git a/libc/tools/check-symbols-glibc.py b/libc/tools/check-symbols-glibc.py
index 913b20b..d0e00f3 100755
--- a/libc/tools/check-symbols-glibc.py
+++ b/libc/tools/check-symbols-glibc.py
@@ -96,7 +96,11 @@
 ])
 # Some standard stuff isn't yet in the versions of glibc we're using.
 std_stuff = set([
-  'at_quick_exit'
+  'at_quick_exit',
+  'c16rtomb',
+  'c32rtomb',
+  'mbrtoc16',
+  'mbrtoc32',
 ])
 # These have mangled names in glibc, with a macro taking the "obvious" name.
 weird_stuff = set([
diff --git a/libc/tools/gensyscalls.py b/libc/tools/gensyscalls.py
index a34b763..96583d6 100755
--- a/libc/tools/gensyscalls.py
+++ b/libc/tools/gensyscalls.py
@@ -95,20 +95,9 @@
 #
 
 arm64_call = syscall_stub_header + """\
-    stp     x29, x30, [sp, #-16]!
-    .cfi_def_cfa_offset 16
-    .cfi_rel_offset x29, 0
-    .cfi_rel_offset x30, 8
-    mov     x29,  sp
-
     mov     x8, %(__NR_name)s
     svc     #0
 
-    ldp     x29, x30, [sp], #16
-    .cfi_def_cfa_offset 0
-    .cfi_restore x29
-    .cfi_restore x30
-
     cmn     x0, #(MAX_ERRNO + 1)
     cneg    x0, x0, hi
     b.hi    __set_errno
diff --git a/libc/unistd/syslog.c b/libc/unistd/syslog.c
index 7878475..339df68 100644
--- a/libc/unistd/syslog.c
+++ b/libc/unistd/syslog.c
@@ -44,6 +44,18 @@
 #include <unistd.h>
 #include <stdarg.h>
 
+struct syslog_data {
+  int log_file;
+  int connected;
+  int opened;
+  int log_stat;
+  const char* log_tag;
+  int log_fac;
+  int log_mask;
+};
+
+#define SYSLOG_DATA_INIT {-1, 0, 0, 0, (const char *)0, LOG_USER, 0xff}
+
 static struct syslog_data sdata = SYSLOG_DATA_INIT;
 
 extern const char	*__progname;		/* Program name, from crt0. */
@@ -51,6 +63,18 @@
 static void	disconnectlog_r(struct syslog_data *);	/* disconnect from syslogd */
 static void	connectlog_r(struct syslog_data *);	/* (re)connect to syslogd */
 
+#if defined(__LP64__)
+#define SYSLOG_R_VISIBILITY static
+#else
+#define SYSLOG_R_VISIBILITY extern
+#endif
+
+SYSLOG_R_VISIBILITY void closelog_r(struct syslog_data*);
+SYSLOG_R_VISIBILITY void openlog_r(const char*, int, int, struct syslog_data*);
+SYSLOG_R_VISIBILITY int setlogmask_r(int, struct syslog_data*);
+SYSLOG_R_VISIBILITY void syslog_r(int, struct syslog_data*, const char*, ...) __printflike(3, 4);
+SYSLOG_R_VISIBILITY void vsyslog_r(int, struct syslog_data*, const char*, va_list) __printflike(3, 0);
+
 /*
  * syslog, vsyslog --
  *	print message on log file; output is intended for syslogd(8).
@@ -157,7 +181,7 @@
 	prlen = snprintf(p, tbuf_left, "<%d>", pri);
 	DEC();
 
-	/* 
+	/*
 	 * syslogd will expand time automagically for reentrant case, and
 	 * for normal case, just do like before
 	 */
@@ -196,10 +220,10 @@
 			++fmt;
 			if (data == &sdata) {
 				prlen = snprintf(t, fmt_left, "%s",
-				    strerror(saved_errno)); 
+				    strerror(saved_errno));
 			} else {
 				prlen = snprintf(t, fmt_left, "Error %d",
-				    saved_errno); 
+				    saved_errno);
 			}
 			if (prlen < 0)
 				prlen = 0;
@@ -269,7 +293,7 @@
 	if (error == -1 && (data->log_stat & LOG_CONS) &&
 	    (fd = open(_PATH_CONSOLE, O_WRONLY|O_NONBLOCK, 0)) >= 0) {
 		struct iovec iov[2];
-		
+
 		p = strchr(tbuf, '>') + 1;
 		iov[0].iov_base = p;
 		iov[0].iov_len = cnt - (p - tbuf);
diff --git a/libc/upstream-netbsd/android/include/rand48.h b/libc/upstream-netbsd/android/include/rand48.h
index 1ad8b0d..1279906 100644
--- a/libc/upstream-netbsd/android/include/rand48.h
+++ b/libc/upstream-netbsd/android/include/rand48.h
@@ -18,10 +18,10 @@
 
 #include <stdlib.h>
 
-extern void		__dorand48(unsigned short[3]);
-extern unsigned short	__rand48_seed[3];
-extern unsigned short	__rand48_mult[3];
-extern unsigned short	__rand48_add;
+__LIBC_HIDDEN__ void		__dorand48(unsigned short[3]);
+__LIBC_HIDDEN__ unsigned short	__rand48_seed[3];
+__LIBC_HIDDEN__ unsigned short	__rand48_mult[3];
+__LIBC_HIDDEN__ unsigned short	__rand48_add;
 
 #define	RAND48_SEED_0	(0x330e)
 #define	RAND48_SEED_1	(0xabcd)
diff --git a/libc/upstream-netbsd/lib/libc/gen/setjmperr.c b/libc/upstream-netbsd/lib/libc/gen/setjmperr.c
deleted file mode 100644
index 5b1432e..0000000
--- a/libc/upstream-netbsd/lib/libc/gen/setjmperr.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/*	$NetBSD: setjmperr.c,v 1.8 2012/06/24 15:26:03 christos Exp $	*/
-
-/*
- * Copyright (c) 1980, 1993
- *	The Regents of the University of California.  All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the University nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <sys/cdefs.h>
-#if defined(LIBC_SCCS) && !defined(lint)
-#if 0
-static char sccsid[] = "@(#)setjmperr.c	8.1 (Berkeley) 6/4/93";
-#else
-__RCSID("$NetBSD: setjmperr.c,v 1.8 2012/06/24 15:26:03 christos Exp $");
-#endif
-#endif /* LIBC_SCCS and not lint */
-
-/*
- * This routine is called from longjmp() when an error occurs.
- * Programs that wish to exit gracefully from this error may
- * write their own versions.
- * If this routine returns, the program is aborted.
- */
-
-#include <setjmp.h>
-#include <unistd.h>
-
-void
-longjmperror(void)
-{
-#define	ERRMSG	"longjmp botch.\n"
-	(void)write(STDERR_FILENO, ERRMSG, sizeof(ERRMSG) - 1);
-}
diff --git a/libm/amd64/fenv.c b/libm/amd64/fenv.c
index b058de2..4b24ff9 100755
--- a/libm/amd64/fenv.c
+++ b/libm/amd64/fenv.c
@@ -30,6 +30,15 @@
 #include <fenv.h>
 #include <machine/fpu.h>
 
+#define SSE_MASK_SHIFT 7
+
+/*
+ * The following symbol is simply the bitwise-inclusive OR of all floating-point
+ * rounding direction constants defined above.
+ */
+#define X87_ROUND_MASK  (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)
+#define SSE_ROUND_SHIFT 3
+
 /*
  * The following constant represents the default floating-point environment
  * (that is, the one installed at program startup) and has type pointer to
@@ -203,7 +212,7 @@
    */
   __asm__ __volatile__ ("fnstcw %0" : "=m" (control));
 
-  return (control & _X87_ROUND_MASK);
+  return (control & X87_ROUND_MASK);
 }
 
 /*
@@ -218,14 +227,14 @@
   unsigned int mxcsr;
 
   /* Check whether requested rounding direction is supported */
-  if (round & ~_X87_ROUND_MASK)
+  if (round & ~X87_ROUND_MASK)
     return (-1);
 
   /* Store the current x87 control word register */
   __asm__ __volatile__ ("fnstcw %0" : "=m" (control));
 
   /* Set the rounding direction */
-  control &= ~_X87_ROUND_MASK;
+  control &= ~X87_ROUND_MASK;
   control |= round;
 
   /* Load the x87 control word register */
@@ -233,8 +242,8 @@
 
   /* Same for the SSE environment */
   __asm__ __volatile__ ("stmxcsr %0" : "=m" (mxcsr));
-  mxcsr &= ~(_X87_ROUND_MASK << _SSE_ROUND_SHIFT);
-  mxcsr |= round << _SSE_ROUND_SHIFT;
+  mxcsr &= ~(X87_ROUND_MASK << SSE_ROUND_SHIFT);
+  mxcsr |= round << SSE_ROUND_SHIFT;
   __asm__ __volatile__ ("ldmxcsr %0" : : "m" (mxcsr));
 
   return (0);
@@ -291,7 +300,7 @@
   mxcsr &= ~FE_ALL_EXCEPT;
 
   /* Mask all exceptions */
-  mxcsr |= FE_ALL_EXCEPT << _SSE_MASK_SHIFT;
+  mxcsr |= FE_ALL_EXCEPT << SSE_MASK_SHIFT;
 
   /* Store the MXCSR register */
   __asm__ __volatile__ ("ldmxcsr %0" : : "m" (mxcsr));
@@ -362,11 +371,11 @@
   __asm__ __volatile__ ("fnstcw %0" : "=m" (control));
   __asm__ __volatile__ ("stmxcsr %0" : "=m" (mxcsr));
 
-  omask = ~(control | (mxcsr >> _SSE_MASK_SHIFT)) & FE_ALL_EXCEPT;
+  omask = ~(control | (mxcsr >> SSE_MASK_SHIFT)) & FE_ALL_EXCEPT;
   control &= ~mask;
   __asm__ __volatile__ ("fldcw %0" : : "m" (control));
 
-  mxcsr &= ~(mask << _SSE_MASK_SHIFT);
+  mxcsr &= ~(mask << SSE_MASK_SHIFT);
   __asm__ __volatile__ ("ldmxcsr %0" : : "m" (mxcsr));
 
   return (omask);
@@ -383,11 +392,11 @@
   __asm__ __volatile__ ("fnstcw %0" : "=m" (control));
   __asm__ __volatile__ ("stmxcsr %0" : "=m" (mxcsr));
 
-  omask = ~(control | (mxcsr >> _SSE_MASK_SHIFT)) & FE_ALL_EXCEPT;
+  omask = ~(control | (mxcsr >> SSE_MASK_SHIFT)) & FE_ALL_EXCEPT;
   control |= mask;
   __asm__ __volatile__ ("fldcw %0" : : "m" (control));
 
-  mxcsr |= mask << _SSE_MASK_SHIFT;
+  mxcsr |= mask << SSE_MASK_SHIFT;
   __asm__ __volatile__ ("ldmxcsr %0" : : "m" (mxcsr));
 
   return (omask);
diff --git a/libm/arm/fenv.c b/libm/arm/fenv.c
index a0108e8..2124730 100644
--- a/libm/arm/fenv.c
+++ b/libm/arm/fenv.c
@@ -28,10 +28,11 @@
 
 #include <fenv.h>
 
-/*
- * Hopefully the system ID byte is immutable, so it's valid to use
- * this as a default environment.
- */
+#define FPSCR_ENABLE_SHIFT 8
+#define FPSCR_ENABLE_MASK  (FE_ALL_EXCEPT << FPSCR_ENABLE_SHIFT)
+
+#define FPSCR_RMODE_SHIFT 22
+
 const fenv_t __fe_dfl_env = 0;
 
 int fegetenv(fenv_t* __envp) {
@@ -86,14 +87,14 @@
 int fegetround(void) {
   fenv_t _fpscr;
   fegetenv(&_fpscr);
-  return ((_fpscr >> _FPSCR_RMODE_SHIFT) & 0x3);
+  return ((_fpscr >> FPSCR_RMODE_SHIFT) & 0x3);
 }
 
 int fesetround(int __round) {
   fenv_t _fpscr;
   fegetenv(&_fpscr);
-  _fpscr &= ~(0x3 << _FPSCR_RMODE_SHIFT);
-  _fpscr |= (__round << _FPSCR_RMODE_SHIFT);
+  _fpscr &= ~(0x3 << FPSCR_RMODE_SHIFT);
+  _fpscr |= (__round << FPSCR_RMODE_SHIFT);
   fesetenv(&_fpscr);
   return 0;
 }
@@ -102,7 +103,7 @@
   fenv_t __env;
   fegetenv(&__env);
   *__envp = __env;
-  __env &= ~(FE_ALL_EXCEPT | _FPSCR_ENABLE_MASK);
+  __env &= ~(FE_ALL_EXCEPT | FPSCR_ENABLE_MASK);
   fesetenv(&__env);
   return 0;
 }
@@ -118,21 +119,21 @@
 int feenableexcept(int __mask) {
   fenv_t __old_fpscr, __new_fpscr;
   fegetenv(&__old_fpscr);
-  __new_fpscr = __old_fpscr | (__mask & FE_ALL_EXCEPT) << _FPSCR_ENABLE_SHIFT;
+  __new_fpscr = __old_fpscr | (__mask & FE_ALL_EXCEPT) << FPSCR_ENABLE_SHIFT;
   fesetenv(&__new_fpscr);
-  return ((__old_fpscr >> _FPSCR_ENABLE_SHIFT) & FE_ALL_EXCEPT);
+  return ((__old_fpscr >> FPSCR_ENABLE_SHIFT) & FE_ALL_EXCEPT);
 }
 
 int fedisableexcept(int __mask) {
   fenv_t __old_fpscr, __new_fpscr;
   fegetenv(&__old_fpscr);
-  __new_fpscr = __old_fpscr & ~((__mask & FE_ALL_EXCEPT) << _FPSCR_ENABLE_SHIFT);
+  __new_fpscr = __old_fpscr & ~((__mask & FE_ALL_EXCEPT) << FPSCR_ENABLE_SHIFT);
   fesetenv(&__new_fpscr);
-  return ((__old_fpscr >> _FPSCR_ENABLE_SHIFT) & FE_ALL_EXCEPT);
+  return ((__old_fpscr >> FPSCR_ENABLE_SHIFT) & FE_ALL_EXCEPT);
 }
 
 int fegetexcept(void) {
   fenv_t __fpscr;
   fegetenv(&__fpscr);
-  return ((__fpscr & _FPSCR_ENABLE_MASK) >> _FPSCR_ENABLE_SHIFT);
+  return ((__fpscr & FPSCR_ENABLE_MASK) >> FPSCR_ENABLE_SHIFT);
 }
diff --git a/libm/arm64/fenv.c b/libm/arm64/fenv.c
index 9db21ef..ce560a7 100644
--- a/libm/arm64/fenv.c
+++ b/libm/arm64/fenv.c
@@ -28,114 +28,168 @@
 
 #include <fenv.h>
 
-/*
- * Hopefully the system ID byte is immutable, so it's valid to use
- * this as a default environment.
- */
-const fenv_t __fe_dfl_env = 0;
+#define FPCR_EXCEPT_SHIFT 8
+#define FPCR_EXCEPT_MASK  (FE_ALL_EXCEPT << FPCR_EXCEPT_SHIFT)
 
-int fegetenv(fenv_t* __envp) {
-  fenv_t _fpcr, _fpsr;
-  __asm__ __volatile__("mrs %0,fpcr" : "=r" (_fpcr));
-  __asm__ __volatile__("mrs %0,fpsr" : "=r" (_fpsr));
-  *__envp = (_fpcr | _fpsr);
+#define FPCR_RMODE_SHIFT 22
+
+const fenv_t __fe_dfl_env = { 0 /* control */, 0 /* status */};
+
+typedef __uint32_t fpu_control_t;   // FPCR, Floating-point Control Register.
+typedef __uint32_t fpu_status_t;    // FPSR, Floating-point Status Register.
+
+#define __get_fpcr(__fpcr) __asm__ __volatile__("mrs %0,fpcr" : "=r" (__fpcr))
+#define __get_fpsr(__fpsr) __asm__ __volatile__("mrs %0,fpsr" : "=r" (__fpsr))
+#define __set_fpcr(__fpcr) __asm__ __volatile__("msr fpcr,%0" : :"ri" (__fpcr))
+#define __set_fpsr(__fpsr) __asm__ __volatile__("msr fpsr,%0" : :"ri" (__fpsr))
+
+int fegetenv(fenv_t* envp) {
+  __get_fpcr(envp->__control);
+  __get_fpsr(envp->__status);
   return 0;
 }
 
-int fesetenv(const fenv_t* __envp) {
-  fenv_t _fpcr = (*__envp & FPCR_MASK);
-  fenv_t _fpsr = (*__envp & FPSR_MASK);
-  __asm__ __volatile__("msr fpcr,%0" : :"ri" (_fpcr));
-  __asm__ __volatile__("msr fpsr,%0" : :"ri" (_fpsr));
+int fesetenv(const fenv_t* envp) {
+  fpu_control_t fpcr;
+
+  __get_fpcr(fpcr);
+  if (envp->__control != fpcr) {
+    __set_fpcr(envp->__control);
+  }
+  __set_fpsr(envp->__status);
   return 0;
 }
 
-int feclearexcept(int __excepts) {
-  fexcept_t __fpscr;
-  fegetenv(&__fpscr);
-  __fpscr &= ~__excepts;
-  fesetenv(&__fpscr);
+int feclearexcept(int excepts) {
+  fpu_status_t fpsr;
+
+  excepts &= FE_ALL_EXCEPT;
+  __get_fpsr(fpsr);
+  fpsr &= ~excepts;
+  __set_fpsr(fpsr);
   return 0;
 }
 
-int fegetexceptflag(fexcept_t* __flagp, int __excepts) {
-  fexcept_t __fpscr;
-  fegetenv(&__fpscr);
-  *__flagp = __fpscr & __excepts;
+int fegetexceptflag(fexcept_t* flagp, int excepts) {
+  fpu_status_t fpsr;
+
+  excepts &= FE_ALL_EXCEPT;
+  __get_fpsr(fpsr);
+  *flagp = fpsr & excepts;
   return 0;
 }
 
-int fesetexceptflag(const fexcept_t* __flagp, int __excepts) {
-  fexcept_t __fpscr;
-  fegetenv(&__fpscr);
-  __fpscr &= ~__excepts;
-  __fpscr |= *__flagp & __excepts;
-  fesetenv(&__fpscr);
+int fesetexceptflag(const fexcept_t* flagp, int excepts) {
+  fpu_status_t fpsr;
+
+  excepts &= FE_ALL_EXCEPT;
+  __get_fpsr(fpsr);
+  fpsr &= ~excepts;
+  fpsr |= *flagp & excepts;
+  __set_fpsr(fpsr);
   return 0;
 }
 
-int feraiseexcept(int __excepts) {
-  fexcept_t __ex = __excepts;
-  fesetexceptflag(&__ex, __excepts);
+int feraiseexcept(int excepts) {
+  fexcept_t ex = excepts;
+
+  fesetexceptflag(&ex, excepts);
   return 0;
 }
 
-int fetestexcept(int __excepts) {
-  fexcept_t __fpscr;
-  fegetenv(&__fpscr);
-  return (__fpscr & __excepts);
+int fetestexcept(int excepts) {
+  fpu_status_t fpsr;
+
+  excepts &= FE_ALL_EXCEPT;
+  __get_fpsr(fpsr);
+  return (fpsr & excepts);
 }
 
 int fegetround(void) {
-  fenv_t _fpscr;
-  fegetenv(&_fpscr);
-  return ((_fpscr >> _FPSCR_RMODE_SHIFT) & 0x3);
+  fpu_control_t fpcr;
+
+  __get_fpcr(fpcr);
+  return ((fpcr >> FPCR_RMODE_SHIFT) & FE_TOWARDZERO);
 }
 
-int fesetround(int __round) {
-  fenv_t _fpscr;
-  fegetenv(&_fpscr);
-  _fpscr &= ~(0x3 << _FPSCR_RMODE_SHIFT);
-  _fpscr |= (__round << _FPSCR_RMODE_SHIFT);
-  fesetenv(&_fpscr);
+int fesetround(int round) {
+  fpu_control_t fpcr, new_fpcr;
+
+  round &= FE_TOWARDZERO;
+  __get_fpcr(fpcr);
+  new_fpcr = fpcr & ~(FE_TOWARDZERO << FPCR_RMODE_SHIFT);
+  new_fpcr |= (round << FPCR_RMODE_SHIFT);
+  if (new_fpcr != fpcr) {
+    __set_fpcr(new_fpcr);
+  }
   return 0;
 }
 
-int feholdexcept(fenv_t* __envp) {
-  fenv_t __env;
-  fegetenv(&__env);
-  *__envp = __env;
-  __env &= ~(FE_ALL_EXCEPT | _FPSCR_ENABLE_MASK);
-  fesetenv(&__env);
+int feholdexcept(fenv_t* envp) {
+  fenv_t env;
+  fpu_status_t fpsr;
+  fpu_control_t fpcr, new_fpcr;
+
+  __get_fpsr(fpsr);
+  __get_fpcr(fpcr);
+  env.__status = fpsr;
+  env.__control = fpcr;
+  *envp = env;
+
+  // Set exceptions to untrapped.
+  new_fpcr = fpcr & ~(FE_ALL_EXCEPT << FPCR_EXCEPT_SHIFT);
+  if (new_fpcr != fpcr) {
+    __set_fpcr(new_fpcr);
+  }
+
+  // Clear all exceptions.
+  fpsr &= ~FE_ALL_EXCEPT;
+  __set_fpsr(fpsr);
   return 0;
 }
 
-int feupdateenv(const fenv_t* __envp) {
-  fexcept_t __fpscr;
-  fegetenv(&__fpscr);
-  fesetenv(__envp);
-  feraiseexcept(__fpscr & FE_ALL_EXCEPT);
+int feupdateenv(const fenv_t* envp) {
+  fpu_status_t fpsr;
+  fpu_control_t fpcr;
+
+  // Set FPU Control register.
+  __get_fpcr(fpcr);
+  if (envp->__control != fpcr) {
+    __set_fpcr(envp->__control);
+  }
+
+  // Set FPU Status register to status | currently raised exceptions.
+  __get_fpsr(fpsr);
+  fpsr = envp->__status | (fpsr & FE_ALL_EXCEPT);
+  __set_fpsr(fpsr);
   return 0;
 }
 
-int feenableexcept(int __mask) {
-  fenv_t __old_fpscr, __new_fpscr;
-  fegetenv(&__old_fpscr);
-  __new_fpscr = __old_fpscr | (__mask & FE_ALL_EXCEPT) << _FPSCR_ENABLE_SHIFT;
-  fesetenv(&__new_fpscr);
-  return ((__old_fpscr >> _FPSCR_ENABLE_SHIFT) & FE_ALL_EXCEPT);
+int feenableexcept(int mask) {
+  fpu_control_t old_fpcr, new_fpcr;
+
+  __get_fpcr(old_fpcr);
+  new_fpcr = old_fpcr | ((mask & FE_ALL_EXCEPT) << FPCR_EXCEPT_SHIFT);
+  if (new_fpcr != old_fpcr) {
+    __set_fpcr(new_fpcr);
+  }
+  return ((old_fpcr >> FPCR_EXCEPT_SHIFT) & FE_ALL_EXCEPT);
 }
 
-int fedisableexcept(int __mask) {
-  fenv_t __old_fpscr, __new_fpscr;
-  fegetenv(&__old_fpscr);
-  __new_fpscr = __old_fpscr & ~((__mask & FE_ALL_EXCEPT) << _FPSCR_ENABLE_SHIFT);
-  fesetenv(&__new_fpscr);
-  return ((__old_fpscr >> _FPSCR_ENABLE_SHIFT) & FE_ALL_EXCEPT);
+int fedisableexcept(int mask) {
+  fpu_control_t old_fpcr, new_fpcr;
+
+  __get_fpcr(old_fpcr);
+  new_fpcr = old_fpcr & ~((mask & FE_ALL_EXCEPT) << FPCR_EXCEPT_SHIFT);
+  if (new_fpcr != old_fpcr) {
+    __set_fpcr(new_fpcr);
+  }
+  return ((old_fpcr >> FPCR_EXCEPT_SHIFT) & FE_ALL_EXCEPT);
 }
 
 int fegetexcept(void) {
-  fenv_t __fpscr;
-  fegetenv(&__fpscr);
-  return ((__fpscr & _FPSCR_ENABLE_MASK) >> _FPSCR_ENABLE_SHIFT);
+  fpu_control_t fpcr;
+
+  __get_fpcr(fpcr);
+  return ((fpcr & FPCR_EXCEPT_MASK) >> FPCR_EXCEPT_SHIFT);
 }
diff --git a/libm/i387/fenv.c b/libm/i387/fenv.c
index 3ab9c58..f64f8dc 100644
--- a/libm/i387/fenv.c
+++ b/libm/i387/fenv.c
@@ -31,6 +31,8 @@
 #include "npx.h"
 #include "fenv.h"
 
+#define ROUND_MASK   (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | FE_TOWARDZERO)
+
 /*
  * As compared to the x87 control word, the SSE unit's control word
  * has the rounding control bits offset by 3 and the exception mask
@@ -327,7 +329,7 @@
    * unit on an Opteron 244.
    */
   __fnstcw(&control);
-  return (control & _ROUND_MASK);
+  return (control & ROUND_MASK);
 }
 
 int
@@ -336,16 +338,16 @@
   __uint32_t mxcsr;
   __uint16_t control;
 
-  if (round & ~_ROUND_MASK) {
+  if (round & ~ROUND_MASK) {
     return (-1);
   } else {
     __fnstcw(&control);
-    control &= ~_ROUND_MASK;
+    control &= ~ROUND_MASK;
     control |= round;
     __fldcw(control);
     if (__HAS_SSE()) {
       __stmxcsr(&mxcsr);
-      mxcsr &= ~(_ROUND_MASK << _SSE_ROUND_SHIFT);
+      mxcsr &= ~(ROUND_MASK << _SSE_ROUND_SHIFT);
       mxcsr |= round << _SSE_ROUND_SHIFT;
       __ldmxcsr(mxcsr);
     }
diff --git a/libm/include/amd64/machine/fenv.h b/libm/include/amd64/machine/fenv.h
index 79a4120..c2b25ed 100644
--- a/libm/include/amd64/machine/fenv.h
+++ b/libm/include/amd64/machine/fenv.h
@@ -51,7 +51,6 @@
  */
 #define FE_ALL_EXCEPT   (FE_INVALID | FE_DENORMAL | FE_DIVBYZERO | \
                          FE_OVERFLOW | FE_UNDERFLOW | FE_INEXACT)
-#define _SSE_MASK_SHIFT 7
 
 /*
  * Each symbol representing the rounding direction, expands to an integer
@@ -65,14 +64,6 @@
 #define FE_TOWARDZERO 0xc00
 
 /*
- * The following symbol is simply the bitwise-inclusive OR of all floating-point
- * rounding direction constants defined above.
- */
-#define _X87_ROUND_MASK  (FE_TONEAREST | FE_DOWNWARD | FE_UPWARD | \
-                          FE_TOWARDZERO)
-#define _SSE_ROUND_SHIFT 3
-
-/*
  * fenv_t represents the entire floating-point environment.
  */
 typedef struct {
diff --git a/libm/include/arm/machine/fenv.h b/libm/include/arm/machine/fenv.h
index d8749dd..0e483e3 100644
--- a/libm/include/arm/machine/fenv.h
+++ b/libm/include/arm/machine/fenv.h
@@ -52,17 +52,12 @@
 #define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \
                        FE_OVERFLOW | FE_UNDERFLOW)
 
-#define _FPSCR_ENABLE_SHIFT 8
-#define _FPSCR_ENABLE_MASK  (FE_ALL_EXCEPT << _FPSCR_ENABLE_SHIFT)
-
 /* Rounding modes. */
 #define FE_TONEAREST  0x0
 #define FE_UPWARD     0x1
 #define FE_DOWNWARD   0x2
 #define FE_TOWARDZERO 0x3
 
-#define _FPSCR_RMODE_SHIFT 22
-
 __END_DECLS
 
 #endif /* !_ARM_FENV_H_ */
diff --git a/libm/include/arm64/machine/fenv.h b/libm/include/arm64/machine/fenv.h
index 2efeee3..a8568b8 100644
--- a/libm/include/arm64/machine/fenv.h
+++ b/libm/include/arm64/machine/fenv.h
@@ -27,15 +27,44 @@
  */
 
 /*
- * Rewritten for Android.
+ * In ARMv8, AArch64 state, floating-point operation is controlled by:
  *
- * The ARM FPSCR (Floating-point Status and Control Register) described here:
- * http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0344b/Chdfafia.html
- * has been split into the FPCR (Floating-point Control Register) and FPSR
- * (Floating-point Status Register) on the ARMv8. These are described briefly in
- * "Procedure Call Standard for the ARM 64-bit Architecture"
- * http://infocenter.arm.com/help/topic/com.arm.doc.ihi0055a/IHI0055A_aapcs64.pdf
- * section 5.1.2 SIMD and Floating-Point Registers
+ *  * FPCR - 32Bit Floating-Point Control Register:
+ *      * [31:27] - Reserved, Res0;
+ *      * [26]    - AHP, Alternative half-precision control bit;
+ *      * [25]    - DN, Default NaN mode control bit;
+ *      * [24]    - FZ, Flush-to-zero mode control bit;
+ *      * [23:22] - RMode, Rounding Mode control field:
+ *            * 00  - Round to Nearest (RN) mode;
+ *            * 01  - Round towards Plus Infinity (RP) mode;
+ *            * 10  - Round towards Minus Infinity (RM) mode;
+ *            * 11  - Round towards Zero (RZ) mode.
+ *      * [21:20] - Stride, ignored during AArch64 execution;
+ *      * [19]    - Reserved, Res0;
+ *      * [18:16] - Len, ignored during AArch64 execution;
+ *      * [15]    - IDE, Input Denormal exception trap;
+ *      * [14:13] - Reserved, Res0;
+ *      * [12]    - IXE, Inexact exception trap;
+ *      * [11]    - UFE, Underflow exception trap;
+ *      * [10]    - OFE, Overflow exception trap;
+ *      * [9]     - DZE, Division by Zero exception;
+ *      * [8]     - IOE, Invalid Operation exception;
+ *      * [7:0]   - Reserved, Res0.
+ *
+ *  * FPSR - 32Bit Floating-Point Status Register:
+ *      * [31]    - N, Negative condition flag for AArch32 (AArch64 sets PSTATE.N);
+ *      * [30]    - Z, Zero condition flag for AArch32 (AArch64 sets PSTATE.Z);
+ *      * [29]    - C, Carry conditon flag for AArch32 (AArch64 sets PSTATE.C);
+ *      * [28]    - V, Overflow conditon flag for AArch32 (AArch64 sets PSTATE.V);
+ *      * [27]    - QC, Cumulative saturation bit, Advanced SIMD only;
+ *      * [26:8]  - Reserved, Res0;
+ *      * [7]     - IDC, Input Denormal cumulative exception;
+ *      * [6:5]   - Reserved, Res0;
+ *      * [4]     - IXC, Inexact cumulative exception;
+ *      * [3]     - UFC, Underflow cumulative exception;
+ *      * [2]     - OFC, Overflow cumulative exception;
+ *      * [1]     - DZC, Division by Zero cumulative exception;
+ *      * [0]     - IOC, Invalid Operation cumulative exception.
  */
 
 #ifndef _ARM64_FENV_H_
@@ -45,7 +74,11 @@
 
 __BEGIN_DECLS
 
-typedef __uint32_t fenv_t;
+typedef struct {
+  __uint32_t __control;     /* FPCR, Floating-point Control Register */
+  __uint32_t __status;      /* FPSR, Floating-point Status Register */
+} fenv_t;
+
 typedef __uint32_t fexcept_t;
 
 /* Exception flags. */
@@ -54,11 +87,9 @@
 #define FE_OVERFLOW   0x04
 #define FE_UNDERFLOW  0x08
 #define FE_INEXACT    0x10
+#define FE_DENORMAL   0x80
 #define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | FE_INVALID | \
-                       FE_OVERFLOW | FE_UNDERFLOW)
-
-#define _FPSCR_ENABLE_SHIFT 8
-#define _FPSCR_ENABLE_MASK  (FE_ALL_EXCEPT << _FPSCR_ENABLE_SHIFT)
+                       FE_OVERFLOW | FE_UNDERFLOW | FE_DENORMAL)
 
 /* Rounding modes. */
 #define FE_TONEAREST  0x0
@@ -66,56 +97,6 @@
 #define FE_DOWNWARD   0x2
 #define FE_TOWARDZERO 0x3
 
-#define _FPSCR_RMODE_SHIFT 22
-
-#define FPCR_IOE    (1 << 8)
-#define FPCR_DZE    (1 << 9)
-#define FPCR_OFE    (1 << 10)
-#define FPCR_UFE    (1 << 11)
-#define FPCR_IXE    (1 << 12)
-#define FPCR_IDE    (1 << 15)
-#define FPCR_LEN    (7 << 16)
-#define FPCR_STRIDE (3 << 20)
-#define FPCR_RMODE  (3 << 22)
-#define FPCR_FZ     (1 << 24)
-#define FPCR_DN     (1 << 25)
-#define FPCR_AHP    (1 << 26)
-#define FPCR_MASK   (FPCR_IOE | \
-                     FPCR_DZE | \
-                     FPCR_OFE | \
-                     FPCR_UFE | \
-                     FPCR_IXE | \
-                     FPCR_IDE | \
-                     FPCR_LEN | \
-                     FPCR_STRIDE | \
-                     FPCR_RMODE | \
-                     FPCR_FZ | \
-                     FPCR_DN | \
-                     FPCR_AHP )
-
-#define FPSR_IOC    (1 << 0)
-#define FPSR_DZC    (1 << 1)
-#define FPSR_OFC    (1 << 2)
-#define FPSR_UFC    (1 << 3)
-#define FPSR_IXC    (1 << 4)
-#define FPSR_IDC    (1 << 7)
-#define FPSR_QC     (1 << 27)
-#define FPSR_V      (1 << 28)
-#define FPSR_C      (1 << 29)
-#define FPSR_Z      (1 << 30)
-#define FPSR_N      (1 << 31)
-#define FPSR_MASK   (FPSR_IOC | \
-                     FPSR_DZC | \
-                     FPSR_OFC | \
-                     FPSR_UFC | \
-                     FPSR_IXC | \
-                     FPSR_IDC | \
-                     FPSR_QC | \
-                     FPSR_V | \
-                     FPSR_C | \
-                     FPSR_Z | \
-                     FPSR_N )
-
 __END_DECLS
 
 #endif /* !_ARM64_FENV_H_ */
diff --git a/libm/include/i387/machine/fenv.h b/libm/include/i387/machine/fenv.h
index f3fabb6..de45add 100644
--- a/libm/include/i387/machine/fenv.h
+++ b/libm/include/i387/machine/fenv.h
@@ -63,8 +63,6 @@
 #define FE_DOWNWARD   0x0400
 #define FE_UPWARD     0x0800
 #define FE_TOWARDZERO 0x0c00
-#define _ROUND_MASK   (FE_TONEAREST | FE_DOWNWARD | \
-                       FE_UPWARD | FE_TOWARDZERO)
 
 __END_DECLS
 
diff --git a/libm/include/mips/machine/fenv.h b/libm/include/mips/machine/fenv.h
index 37f0f9c..689e1cb 100644
--- a/libm/include/mips/machine/fenv.h
+++ b/libm/include/mips/machine/fenv.h
@@ -87,19 +87,12 @@
 #define FE_ALL_EXCEPT (FE_DIVBYZERO | FE_INEXACT | \
                        FE_INVALID | FE_OVERFLOW | FE_UNDERFLOW)
 
-#define _FCSR_CAUSE_SHIFT 10
-#define _ENABLE_SHIFT     5
-#define _FCSR_ENABLE_MASK (FE_ALL_EXCEPT << _ENABLE_SHIFT)
-
 /* Rounding modes */
 #define FE_TONEAREST  0x0000
 #define FE_TOWARDZERO 0x0001
 #define FE_UPWARD     0x0002
 #define FE_DOWNWARD   0x0003
 
-#define _FCSR_RMODE_SHIFT 0
-#define _FCSR_RMASK       0x3
-
 __END_DECLS
 
 #endif /* !_MIPS_FENV_H_ */
diff --git a/libm/mips/fenv.c b/libm/mips/fenv.c
index 893bc30..aacd526 100644
--- a/libm/mips/fenv.c
+++ b/libm/mips/fenv.c
@@ -28,6 +28,12 @@
 
 #include <fenv.h>
 
+#define FCSR_CAUSE_SHIFT 10
+#define FCSR_ENABLE_SHIFT 5
+#define FCSR_ENABLE_MASK (FE_ALL_EXCEPT << FCSR_ENABLE_SHIFT)
+
+#define FCSR_RMASK       0x3
+
 /*
  * Hopefully the system ID byte is immutable, so it's valid to use
  * this as a default environment.
@@ -55,7 +61,7 @@
   fexcept_t __fcsr;
   fegetenv(&__fcsr);
   __excepts &= FE_ALL_EXCEPT;
-  __fcsr &= ~(__excepts | (__excepts << _FCSR_CAUSE_SHIFT));
+  __fcsr &= ~(__excepts | (__excepts << FCSR_CAUSE_SHIFT));
   fesetenv(&__fcsr);
   return 0;
 }
@@ -84,7 +90,7 @@
   /* Ensure that flags are all legal */
   __excepts &= FE_ALL_EXCEPT;
   /* Cause bit needs to be set as well for generating the exception*/
-  __fcsr |= __excepts | (__excepts << _FCSR_CAUSE_SHIFT);
+  __fcsr |= __excepts | (__excepts << FCSR_CAUSE_SHIFT);
   fesetenv(&__fcsr);
   return 0;
 }
@@ -98,14 +104,14 @@
 int fegetround(void) {
   fenv_t _fcsr;
   fegetenv(&_fcsr);
-  return (_fcsr & _FCSR_RMASK);
+  return (_fcsr & FCSR_RMASK);
 }
 
 int fesetround(int __round) {
   fenv_t _fcsr;
   fegetenv(&_fcsr);
-  _fcsr &= ~_FCSR_RMASK;
-  _fcsr |= (__round & _FCSR_RMASK ) ;
+  _fcsr &= ~FCSR_RMASK;
+  _fcsr |= (__round & FCSR_RMASK);
   fesetenv(&_fcsr);
   return 0;
 }
@@ -114,7 +120,7 @@
   fenv_t __env;
   fegetenv(&__env);
   *__envp = __env;
-  __env &= ~(FE_ALL_EXCEPT | _FCSR_ENABLE_MASK);
+  __env &= ~(FE_ALL_EXCEPT | FCSR_ENABLE_MASK);
   fesetenv(&__env);
   return 0;
 }
@@ -130,21 +136,21 @@
 int feenableexcept(int __mask) {
   fenv_t __old_fcsr, __new_fcsr;
   fegetenv(&__old_fcsr);
-  __new_fcsr = __old_fcsr | (__mask & FE_ALL_EXCEPT) << _ENABLE_SHIFT;
+  __new_fcsr = __old_fcsr | (__mask & FE_ALL_EXCEPT) << FCSR_ENABLE_SHIFT;
   fesetenv(&__new_fcsr);
-  return ((__old_fcsr >> _ENABLE_SHIFT) & FE_ALL_EXCEPT);
+  return ((__old_fcsr >> FCSR_ENABLE_SHIFT) & FE_ALL_EXCEPT);
 }
 
 int fedisableexcept(int __mask) {
   fenv_t __old_fcsr, __new_fcsr;
   fegetenv(&__old_fcsr);
-  __new_fcsr = __old_fcsr & ~((__mask & FE_ALL_EXCEPT) << _ENABLE_SHIFT);
+  __new_fcsr = __old_fcsr & ~((__mask & FE_ALL_EXCEPT) << FCSR_ENABLE_SHIFT);
   fesetenv(&__new_fcsr);
-  return ((__old_fcsr >> _ENABLE_SHIFT) & FE_ALL_EXCEPT);
+  return ((__old_fcsr >> FCSR_ENABLE_SHIFT) & FE_ALL_EXCEPT);
 }
 
 int fegetexcept(void) {
   fenv_t __fcsr;
   fegetenv(&__fcsr);
-  return ((__fcsr & _FCSR_ENABLE_MASK) >> _ENABLE_SHIFT);
+  return ((__fcsr & FCSR_ENABLE_MASK) >> FCSR_ENABLE_SHIFT);
 }
diff --git a/tests/Android.build.mk b/tests/Android.build.mk
index c1a0f16..e65ec16 100644
--- a/tests/Android.build.mk
+++ b/tests/Android.build.mk
@@ -18,11 +18,19 @@
 
 LOCAL_MODULE := $(module)
 LOCAL_MODULE_TAGS := $(module_tag)
+ifeq ($(build_type),host)
+# Always make host multilib
+LOCAL_MULTILIB := both
+else
 LOCAL_MULTILIB := $($(module)_multilib)
+endif
+
+ifneq ($(findstring LIBRARY, $(build_target)),LIBRARY)
 ifeq ($(LOCAL_MULTILIB),both)
     LOCAL_MODULE_STEM_32 := $(module)32
     LOCAL_MODULE_STEM_64 := $(module)64
 endif
+endif
 
 LOCAL_CLANG := $($(module)_clang_$(build_type))
 
diff --git a/tests/Android.mk b/tests/Android.mk
index 25f8b2b..c2e76b6 100644
--- a/tests/Android.mk
+++ b/tests/Android.mk
@@ -258,27 +258,13 @@
 # -----------------------------------------------------------------------------
 # create symlink to libdlext_test.so for symlink test
 # -----------------------------------------------------------------------------
-libdlext_origin := $(LOCAL_INSTALLED_MODULE)
-libdlext_sym := $(subst libdlext_test,libdlext_test_v2,$(libdlext_origin))
-$(libdlext_sym): $(libdlext_origin)
-	@echo "Symlink: $@ -> $(notdir $<)"
-	@mkdir -p $(dir $@)
-	$(hide) ln -sf $(notdir $<) $@
-
-ALL_MODULES := \
-  $(ALL_MODULES) $(libdlext_sym)
-
+# Use = instead of := to defer the evaluation of $@
+$(LOCAL_INSTALLED_MODULE): PRIVATE_POST_INSTALL_CMD = \
+    $(hide) cd $(dir $@) && ln -sf $(notdir $@) libdlext_test_v2.so
 ifneq ($(TARGET_2ND_ARCH),)
 # link 64 bit .so
-libdlext_origin := $(TARGET_OUT)/lib64/libdlext_test.so
-libdlext_sym := $(subst libdlext_test,libdlext_test_v2,$(libdlext_origin))
-$(libdlext_sym): $(libdlext_origin)
-	@echo "Symlink: $@ -> $(notdir $<)"
-	@mkdir -p $(dir $@)
-	$(hide) ln -sf $(notdir $<) $@
-
-ALL_MODULES := \
-  $(ALL_MODULES) $(libdlext_sym)
+$(TARGET_OUT)/lib64/libdlext_test.so: PRIVATE_POST_INSTALL_CMD = \
+    $(hide) cd $(dir $@) && ln -sf $(notdir $@) libdlext_test_v2.so
 endif
 
 libdlext_test_norelro_src_files := \
@@ -379,7 +365,7 @@
 #   cd bionic/tests; mm bionic-unit-tests-glibc-run
 # -----------------------------------------------------------------------------
 
-ifeq ($(HOST_OS)-$(HOST_ARCH),linux-x86)
+ifeq ($(HOST_OS)-$(HOST_ARCH),$(filter $(HOST_OS)-$(HOST_ARCH),linux-x86 linux-x86_64))
 
 bionic-unit-tests-glibc_src_files := \
     atexit_test.cpp \
diff --git a/tests/math_test.cpp b/tests/math_test.cpp
index b0d541a..b4f5b14 100644
--- a/tests/math_test.cpp
+++ b/tests/math_test.cpp
@@ -1295,3 +1295,18 @@
   float fr = frexpf(14.1f, &exp);
   ASSERT_FLOAT_EQ(14.1f, scalbnf(fr, exp));
 }
+
+TEST(math, exp2_STRICT_ALIGN_OpenBSD_bug) {
+  // OpenBSD/x86's libm had a bug here, but it was already fixed in FreeBSD:
+  // http://svnweb.FreeBSD.org/base/head/lib/msun/src/math_private.h?revision=240827&view=markup
+  ASSERT_DOUBLE_EQ(5.0, exp2(log2(5)));
+  ASSERT_FLOAT_EQ(5.0f, exp2f(log2f(5)));
+  ASSERT_DOUBLE_EQ(5.0L, exp2l(log2l(5)));
+}
+
+TEST(math, nextafterl_OpenBSD_bug) {
+  // OpenBSD/x86's libm had a bug here.
+  ASSERT_TRUE(nextafter(1.0, 0.0) - 1.0 < 0.0);
+  ASSERT_TRUE(nextafterf(1.0f, 0.0f) - 1.0f < 0.0f);
+  ASSERT_TRUE(nextafterl(1.0L, 0.0L) - 1.0L < 0.0L);
+}
diff --git a/tests/stdio_test.cpp b/tests/stdio_test.cpp
index 0ff85bf..e291f52 100644
--- a/tests/stdio_test.cpp
+++ b/tests/stdio_test.cpp
@@ -426,7 +426,26 @@
   EXPECT_STREQ("-0.000000", buf);
 }
 
+TEST(stdio, snprintf_utf8_15439554) {
+  // http://b/15439554
+  char buf[BUFSIZ];
+
+  // 1-byte character.
+  snprintf(buf, sizeof(buf), "%dx%d", 1, 2);
+  EXPECT_STREQ("1x2", buf);
+  // 2-byte character.
+  snprintf(buf, sizeof(buf), "%d\xc2\xa2%d", 1, 2);
+  EXPECT_STREQ("1¢2", buf);
+  // 3-byte character.
+  snprintf(buf, sizeof(buf), "%d\xe2\x82\xac%d", 1, 2);
+  EXPECT_STREQ("1€2", buf);
+  // 4-byte character.
+  snprintf(buf, sizeof(buf), "%d\xf0\xa4\xad\xa2%d", 1, 2);
+  EXPECT_STREQ("1𤭢2", buf);
+}
+
 TEST(stdio, fprintf_failures_7229520) {
+  // http://b/7229520
   FILE* fp;
 
   // Unbuffered case where the fprintf(3) itself fails.
diff --git a/tests/string_test.cpp b/tests/string_test.cpp
index c62f43b..67b3860 100644
--- a/tests/string_test.cpp
+++ b/tests/string_test.cpp
@@ -812,7 +812,7 @@
       int expected = (static_cast<unsigned short>(c1) - static_cast<unsigned short>(c2));
       int actual = __memcmp16(state.ptr1, state.ptr2, (size_t) state.MAX_LEN);
 
-      ASSERT_EQ(expected, actual);
+      ASSERT_EQ(signum(expected), signum(actual));
     }
   }
 #else // __BIONIC__
diff --git a/tests/wchar_test.cpp b/tests/wchar_test.cpp
index e76026f..a5f5f63 100644
--- a/tests/wchar_test.cpp
+++ b/tests/wchar_test.cpp
@@ -449,3 +449,32 @@
   wmemmove(wstr+5, wstr, sizeof(const_wstr)/sizeof(wchar_t) - 6);
   EXPECT_STREQ(L"This This is a test of something or other", wstr);
 }
+
+TEST(wchar, mbrtowc_15439554) {
+  // http://b/15439554
+  ASSERT_STREQ("C.UTF-8", setlocale(LC_CTYPE, "C.UTF-8"));
+  uselocale(LC_GLOBAL_LOCALE);
+
+  ASSERT_GE(static_cast<size_t>(MB_LEN_MAX), MB_CUR_MAX);
+  ASSERT_GE(MB_CUR_MAX, 4U);
+
+  wchar_t wc;
+  size_t n;
+
+  // 1-byte character.
+  n = mbrtowc(&wc, "x", MB_CUR_MAX, NULL);
+  EXPECT_EQ(1U, n);
+  EXPECT_EQ(L'x', wc);
+  // 2-byte character.
+  n = mbrtowc(&wc, "\xc2\xa2", MB_CUR_MAX, NULL);
+  EXPECT_EQ(2U, n);
+  EXPECT_EQ(L'¢', wc);
+  // 3-byte character.
+  n = mbrtowc(&wc, "\xe2\x82\xac", MB_CUR_MAX, NULL);
+  EXPECT_EQ(3U, n);
+  EXPECT_EQ(L'€', wc);
+  // 4-byte character.
+  n = mbrtowc(&wc, "\xf0\xa4\xad\xa2", MB_CUR_MAX, NULL);
+  EXPECT_EQ(4U, n);
+  EXPECT_EQ(L'𤭢', wc);
+}