[libc] Enable a few entrypoints on aarch64 which are now available on x86_64.

This commit is contained in:
Siva Chandra 2022-08-23 12:23:13 -07:00
parent 2cb9e1ac42
commit 8856137ce7
3 changed files with 59 additions and 42 deletions

View File

@ -89,18 +89,26 @@ set(TARGET_LIBC_ENTRYPOINTS
libc.src.stdlib.malloc
libc.src.stdlib.calloc
libc.src.stdlib.realloc
libc.src.stdlib.aligned_alloc
libc.src.stdlib.free
# stdio.h entrypoints
libc.src.stdio.sprintf
libc.src.stdio.snprintf
# sys/mman.h entrypoints
libc.src.sys.mman.mmap
libc.src.sys.mman.munmap
# sys/stat.h entrypoints
libc.src.sys.stat.fchmod
libc.src.sys.stat.mkdir
libc.src.sys.stat.mkdirat
# unistd.h entrypoints
libc.src.unistd.chdir
libc.src.unistd.close
libc.src.unistd.fchdir
libc.src.unistd.fsync
libc.src.unistd.lseek
libc.src.unistd.read
@ -220,14 +228,46 @@ set(TARGET_LIBM_ENTRYPOINTS
libc.src.math.trunc
libc.src.math.truncf
libc.src.math.truncl
# sys/mman.h entrypoints
libc.src.sys.mman.mmap
libc.src.sys.mman.munmap
)
if(LLVM_LIBC_FULL_BUILD)
list(APPEND TARGET_LIBC_ENTRYPOINTS
# pthread.h entrypoints
libc.src.pthread.pthread_attr_destroy
libc.src.pthread.pthread_attr_init
libc.src.pthread.pthread_attr_getdetachstate
libc.src.pthread.pthread_attr_getguardsize
libc.src.pthread.pthread_attr_getstack
libc.src.pthread.pthread_attr_getstacksize
libc.src.pthread.pthread_attr_setdetachstate
libc.src.pthread.pthread_attr_setguardsize
libc.src.pthread.pthread_attr_setstack
libc.src.pthread.pthread_attr_setstacksize
libc.src.pthread.pthread_create
libc.src.pthread.pthread_detach
libc.src.pthread.pthread_equal
libc.src.pthread.pthread_exit
libc.src.pthread.pthread_getname_np
libc.src.pthread.pthread_getspecific
libc.src.pthread.pthread_join
libc.src.pthread.pthread_key_create
libc.src.pthread.pthread_key_delete
libc.src.pthread.pthread_self
libc.src.pthread.pthread_setname_np
libc.src.pthread.pthread_mutex_destroy
libc.src.pthread.pthread_mutex_init
libc.src.pthread.pthread_mutex_lock
libc.src.pthread.pthread_mutex_unlock
libc.src.pthread.pthread_mutexattr_destroy
libc.src.pthread.pthread_mutexattr_init
libc.src.pthread.pthread_mutexattr_getpshared
libc.src.pthread.pthread_mutexattr_getrobust
libc.src.pthread.pthread_mutexattr_gettype
libc.src.pthread.pthread_mutexattr_setpshared
libc.src.pthread.pthread_mutexattr_setrobust
libc.src.pthread.pthread_mutexattr_settype
libc.src.pthread.pthread_setspecific
# stdio.h entrypoints
libc.src.stdio.clearerr
libc.src.stdio.clearerr_unlocked
@ -272,36 +312,12 @@ if(LLVM_LIBC_FULL_BUILD)
libc.src.threads.thrd_current
libc.src.threads.thrd_detach
libc.src.threads.thrd_equal
libc.src.threads.thrd_exit
libc.src.threads.thrd_join
# pthread.h entrypoints
libc.src.pthread.pthread_attr_destroy
libc.src.pthread.pthread_attr_init
libc.src.pthread.pthread_attr_getdetachstate
libc.src.pthread.pthread_attr_getguardsize
libc.src.pthread.pthread_attr_getstack
libc.src.pthread.pthread_attr_getstacksize
libc.src.pthread.pthread_attr_setdetachstate
libc.src.pthread.pthread_attr_setguardsize
libc.src.pthread.pthread_attr_setstack
libc.src.pthread.pthread_attr_setstacksize
libc.src.pthread.pthread_create
libc.src.pthread.pthread_detach
libc.src.pthread.pthread_equal
libc.src.pthread.pthread_join
libc.src.pthread.pthread_self
libc.src.pthread.pthread_mutex_destroy
libc.src.pthread.pthread_mutex_init
libc.src.pthread.pthread_mutex_lock
libc.src.pthread.pthread_mutex_unlock
libc.src.pthread.pthread_mutexattr_destroy
libc.src.pthread.pthread_mutexattr_init
libc.src.pthread.pthread_mutexattr_getpshared
libc.src.pthread.pthread_mutexattr_getrobust
libc.src.pthread.pthread_mutexattr_gettype
libc.src.pthread.pthread_mutexattr_setpshared
libc.src.pthread.pthread_mutexattr_setrobust
libc.src.pthread.pthread_mutexattr_settype
libc.src.threads.tss_create
libc.src.threads.tss_delete
libc.src.threads.tss_get
libc.src.threads.tss_set
# time.h entrypoints
libc.src.time.asctime

View File

@ -256,7 +256,6 @@ if(LLVM_LIBC_FULL_BUILD)
libc.src.pthread.pthread_attr_setguardsize
libc.src.pthread.pthread_attr_setstack
libc.src.pthread.pthread_attr_setstacksize
libc.src.pthread.pthread_attr_init
libc.src.pthread.pthread_create
libc.src.pthread.pthread_detach
libc.src.pthread.pthread_equal
@ -264,10 +263,10 @@ if(LLVM_LIBC_FULL_BUILD)
libc.src.pthread.pthread_getname_np
libc.src.pthread.pthread_getspecific
libc.src.pthread.pthread_join
libc.src.pthread.pthread_self
libc.src.pthread.pthread_setname_np
libc.src.pthread.pthread_key_create
libc.src.pthread.pthread_key_delete
libc.src.pthread.pthread_self
libc.src.pthread.pthread_setname_np
libc.src.pthread.pthread_mutex_destroy
libc.src.pthread.pthread_mutex_init
libc.src.pthread.pthread_mutex_lock
@ -282,12 +281,6 @@ if(LLVM_LIBC_FULL_BUILD)
libc.src.pthread.pthread_mutexattr_settype
libc.src.pthread.pthread_setspecific
# stdlib.h entrypoints
libc.src.stdlib._Exit
libc.src.stdlib.atexit
libc.src.stdlib.exit
libc.src.stdlib.getenv
# stdio.h entrypoints
libc.src.stdio.clearerr
libc.src.stdio.clearerr_unlocked
@ -311,6 +304,12 @@ if(LLVM_LIBC_FULL_BUILD)
libc.src.stdio.stderr
libc.src.stdio.stdout
# stdlib.h entrypoints
libc.src.stdlib._Exit
libc.src.stdlib.atexit
libc.src.stdlib.exit
libc.src.stdlib.getenv
# signal.h entrypoints
# TODO: Enable signal.h entrypoints after fixing signal.h
# libc.src.signal.raise

View File

@ -186,6 +186,8 @@ __attribute__((noinline)) static void do_start() {
__llvm_libc::set_thread_ptr(tls.tp);
__llvm_libc::self.attrib = &__llvm_libc::main_thread_attrib;
__llvm_libc::main_thread_attrib.atexit_callback_mgr =
__llvm_libc::internal::get_thread_atexit_callback_mgr();
// We want the fini array callbacks to be run after other atexit
// callbacks are run. So, we register them before running the init