AArch64: Fix uses of stack size for 32/64bit libc builds
This patch fixes stack size uses to size_t.
Change-Id: I0671c85ddb1c1aceaf9440a7c73c21fe528653fa
Signed-off-by: Serban Constantinescu <serban.constantinescu@arm.com>
diff --git a/libc/arch-arm/bionic/_exit_with_stack_teardown.S b/libc/arch-arm/bionic/_exit_with_stack_teardown.S
index 1c13540..c430edb 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 e890008..8351e2e 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 d3b5541..1c6d48a 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 182e0ef..a09babe 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 479cadf..f88a26d 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 32812b4..7081445 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 @@
{
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;