[libc-commits] [libc] 98fdabe - [libc] Enable a few stdlib and time functions on aarch64.

Siva Chandra via libc-commits libc-commits at lists.llvm.org
Thu Jul 14 14:38:24 PDT 2022


Author: Siva Chandra
Date: 2022-07-14T14:37:50-07:00
New Revision: 98fdabecf529f7d52eaf225e1f79baf09ac84c52

URL: https://github.com/llvm/llvm-project/commit/98fdabecf529f7d52eaf225e1f79baf09ac84c52
DIFF: https://github.com/llvm/llvm-project/commit/98fdabecf529f7d52eaf225e1f79baf09ac84c52.diff

LOG: [libc] Enable a few stdlib and time functions on aarch64.

Added: 
    

Modified: 
    libc/config/linux/aarch64/entrypoints.txt
    libc/config/linux/x86_64/entrypoints.txt
    libc/loader/linux/aarch64/start.cpp

Removed: 
    


################################################################################
diff  --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index 3913602d66085..377d306b2b86f 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -245,6 +245,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
+
     # threads.h entrypoints
     libc.src.threads.call_once
     libc.src.threads.cnd_broadcast
@@ -290,6 +296,13 @@ if(LLVM_LIBC_FULL_BUILD)
     libc.src.pthread.pthread_mutexattr_setpshared
     libc.src.pthread.pthread_mutexattr_setrobust
     libc.src.pthread.pthread_mutexattr_settype
+
+    # time.h entrypoints
+    libc.src.time.asctime
+    libc.src.time.asctime_r
+    libc.src.time.gmtime
+    libc.src.time.gmtime_r
+    libc.src.time.mktime
   )
 endif()
 

diff  --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index 93c76b305e1c9..4fd16ef0871ba 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -259,7 +259,6 @@ if(LLVM_LIBC_FULL_BUILD)
 
     # stdlib.h entrypoints
     libc.src.stdlib._Exit
-    # libc.src.stdlib.abort
     libc.src.stdlib.atexit
     libc.src.stdlib.exit
     libc.src.stdlib.getenv

diff  --git a/libc/loader/linux/aarch64/start.cpp b/libc/loader/linux/aarch64/start.cpp
index 6c977860a28bd..fa8c776dec635 100644
--- a/libc/loader/linux/aarch64/start.cpp
+++ b/libc/loader/linux/aarch64/start.cpp
@@ -118,6 +118,7 @@ extern "C" void _start() {
   // value. We step over it (the "+ 1" below) to get to the env values.
   uint64_t *env_ptr = app.args->argv + app.args->argc + 1;
   uint64_t *env_end_marker = env_ptr;
+  app.envPtr = env_ptr;
   while (*env_end_marker)
     ++env_end_marker;
 


        


More information about the libc-commits mailing list