diff --git a/libc/arch-arm/bionic/_exit_with_stack_teardown.S b/libc/arch-arm/bionic/_exit_with_stack_teardown.S
index 1c1354045..c430edbe4 100644
--- a/libc/arch-arm/bionic/_exit_with_stack_teardown.S
+++ b/libc/arch-arm/bionic/_exit_with_stack_teardown.S
@@ -29,7 +29,7 @@
 #include <machine/asm.h>
 #include <asm/unistd.h>
 
-// void _exit_with_stack_teardown(void* stackBase, int stackSize, int status)
+// void _exit_with_stack_teardown(void* stackBase, size_t stackSize, int status)
 ENTRY(_exit_with_stack_teardown)
     mov     lr, r2
     ldr     r7, =__NR_munmap
diff --git a/libc/arch-mips/bionic/_exit_with_stack_teardown.S b/libc/arch-mips/bionic/_exit_with_stack_teardown.S
index e89000889..8351e2ead 100644
--- a/libc/arch-mips/bionic/_exit_with_stack_teardown.S
+++ b/libc/arch-mips/bionic/_exit_with_stack_teardown.S
@@ -30,7 +30,7 @@
 
 	.text
 
-// void _exit_with_stack_teardown(void * stackBase, int stackSize, int status)
+// void _exit_with_stack_teardown(void * stackBase, size_t stackSize, int status)
 
 	.type	_exit_with_stack_teardown, @function
 	.global	_exit_with_stack_teardown
diff --git a/libc/arch-x86/bionic/_exit_with_stack_teardown.S b/libc/arch-x86/bionic/_exit_with_stack_teardown.S
index d3b554120..1c6d48adc 100644
--- a/libc/arch-x86/bionic/_exit_with_stack_teardown.S
+++ b/libc/arch-x86/bionic/_exit_with_stack_teardown.S
@@ -1,7 +1,7 @@
 #include <asm/unistd.h>
 #include <machine/asm.h>
 
-// void _exit_with_stack_teardown(void* stackBase, int stackSize, int status)
+// void _exit_with_stack_teardown(void* stackBase, size_t stackSize, int status)
 ENTRY(_exit_with_stack_teardown)
     // We can trash %ebx here since this call should never return.
     // We can also take advantage of the fact that the linux syscall trap
diff --git a/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S b/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S
index 182e0ef3b..a09babe2e 100644
--- a/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S
+++ b/libc/arch-x86_64/bionic/_exit_with_stack_teardown.S
@@ -29,7 +29,7 @@
 #include <asm/unistd.h>
 #include <machine/asm.h>
 
-// void _exit_with_stack_teardown(void* stackBase, int stackSize, int status)
+// void _exit_with_stack_teardown(void* stackBase, size_t stackSize, int status)
 ENTRY(_exit_with_stack_teardown)
     // We take advantage of the fact that the linux syscall trap
     // handler saves all the registers, so we don't need to save
diff --git a/libc/bionic/libc_init_common.cpp b/libc/bionic/libc_init_common.cpp
index 479cadf34..f88a26d26 100644
--- a/libc/bionic/libc_init_common.cpp
+++ b/libc/bionic/libc_init_common.cpp
@@ -47,7 +47,7 @@
 #include "pthread_internal.h"
 
 extern "C" abort_msg_t** __abort_message_ptr;
-extern "C" unsigned __get_sp(void);
+extern "C" uintptr_t __get_sp(void);
 extern "C" int __system_properties_init(void);
 
 // Not public, but well-known in the BSDs.
diff --git a/libc/bionic/pthread.c b/libc/bionic/pthread.c
index 32812b4c9..7081445a8 100644
--- a/libc/bionic/pthread.c
+++ b/libc/bionic/pthread.c
@@ -45,7 +45,7 @@
 extern void pthread_debug_mutex_lock_check(pthread_mutex_t *mutex);
 extern void pthread_debug_mutex_unlock_check(pthread_mutex_t *mutex);
 
-extern void _exit_with_stack_teardown(void * stackBase, int stackSize, int status);
+extern void _exit_with_stack_teardown(void * stackBase, size_t stackSize, int status);
 extern void _exit_thread(int status);
 
 int  __futex_wake_ex(volatile void *ftx, int pshared, int val)
@@ -87,7 +87,7 @@ void pthread_exit(void * retval)
 {
     pthread_internal_t*  thread     = __get_thread();
     void*                stack_base = thread->attr.stack_base;
-    int                  stack_size = thread->attr.stack_size;
+    size_t               stack_size = thread->attr.stack_size;
     int                  user_stack = (thread->attr.flags & PTHREAD_ATTR_FLAG_USER_STACK) != 0;
     sigset_t mask;