diff --git a/libc/bionic/statvfs.cpp b/libc/bionic/statvfs.cpp
index 5d5828149..39c9332a0 100644
--- a/libc/bionic/statvfs.cpp
+++ b/libc/bionic/statvfs.cpp
@@ -18,8 +18,15 @@
 
 #include <sys/statfs.h>
 
-extern "C" int __statfs64(const char*, size_t, struct statfs*);
+// Paper over the fact that 32-bit kernels use fstatfs64/statfs64 with an extra argument,
+// but 64-bit kernels don't have the "64" bit suffix or the extra size_t argument.
+#if __LP64__
+#  define __fstatfs64(fd,size,buf) fstatfs(fd,buf)
+#  define __statfs64(path,size,buf) statfs(path,buf)
+#else
 extern "C" int __fstatfs64(int, size_t, struct statfs*);
+extern "C" int __statfs64(const char*, size_t, struct statfs*);
+#endif
 
 #define ST_VALID 0x0020
 
diff --git a/libc/private/bionic_tls.h b/libc/private/bionic_tls.h
index 9ea36474e..f7a90514e 100644
--- a/libc/private/bionic_tls.h
+++ b/libc/private/bionic_tls.h
@@ -106,6 +106,12 @@ extern int __set_tls(void* ptr);
     ({ register void* __val; \
        asm ("movl %%gs:0, %0" : "=r"(__val)); \
        (volatile void*) __val; })
+
+#elif defined(__x86_64__)
+# define __get_tls() \
+    ({ register void* __val; \
+       asm ("mov %%fs:0, %0" : "=r"(__val)); \
+       (volatile void*) __val; })
 #else
 #error unsupported architecture
 #endif