[libc-commits] [libc] 16c2a90 - [libc][fix] Add missing 'errno' header for the GPU libc

Joseph Huber via libc-commits libc-commits at lists.llvm.org
Tue Apr 25 11:27:44 PDT 2023


Author: Joseph Huber
Date: 2023-04-25T13:25:45-05:00
New Revision: 16c2a906b854e31d8b3d05d8478bd0f60388e68c

URL: https://github.com/llvm/llvm-project/commit/16c2a906b854e31d8b3d05d8478bd0f60388e68c
DIFF: https://github.com/llvm/llvm-project/commit/16c2a906b854e31d8b3d05d8478bd0f60388e68c.diff

LOG: [libc][fix] Add missing 'errno' header for the GPU libc

Summary:
The previous GPU `libc` patch added support for `atoi`. However, it
didn't also enable generating the errno header. This caused including it
to use the system's header which invariably will cause compiler
problems.

Added: 
    

Modified: 
    libc/config/gpu/entrypoints.txt
    libc/config/gpu/headers.txt
    libc/src/errno/libc_errno.cpp

Removed: 
    


################################################################################
diff  --git a/libc/config/gpu/entrypoints.txt b/libc/config/gpu/entrypoints.txt
index 69af9fffb0a4..5750fba31d6b 100644
--- a/libc/config/gpu/entrypoints.txt
+++ b/libc/config/gpu/entrypoints.txt
@@ -56,6 +56,9 @@ set(TARGET_LIBC_ENTRYPOINTS
 
     # stdlib.h entrypoints
     libc.src.stdlib.atoi
+
+    # errno.h entrypoints
+    libc.src.errno.errno
 )
 
 set(TARGET_LLVMLIBC_ENTRYPOINTS

diff  --git a/libc/config/gpu/headers.txt b/libc/config/gpu/headers.txt
index fd753a4b75bf..1b77c97b00d8 100644
--- a/libc/config/gpu/headers.txt
+++ b/libc/config/gpu/headers.txt
@@ -1,5 +1,6 @@
 set(TARGET_PUBLIC_HEADERS
     libc.include.ctype
     libc.include.string
+    libc.include.errno
     libc.include.stdlib
 )

diff  --git a/libc/src/errno/libc_errno.cpp b/libc/src/errno/libc_errno.cpp
index 26bd9d9cc97e..8cf77a8f202c 100644
--- a/libc/src/errno/libc_errno.cpp
+++ b/libc/src/errno/libc_errno.cpp
@@ -7,6 +7,7 @@
 //===----------------------------------------------------------------------===//
 
 #include "src/__support/macros/properties/architectures.h"
+#include "libc_errno.h"
 
 namespace __llvm_libc {
 


        


More information about the libc-commits mailing list