aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Huber <jhuber6@vols.utk.edu>2023-04-25 13:25:45 -0500
committerJoseph Huber <jhuber6@vols.utk.edu>2023-04-25 13:25:45 -0500
commit16c2a906b854e31d8b3d05d8478bd0f60388e68c (patch)
treed18d263a23077a7fd7613b8e712a4dea07fb5994
parent86339ef088e9aac6cf52cf9022d7a5bd144d4c42 (diff)
downloadllvm-16c2a906b854e31d8b3d05d8478bd0f60388e68c.zip
llvm-16c2a906b854e31d8b3d05d8478bd0f60388e68c.tar.gz
llvm-16c2a906b854e31d8b3d05d8478bd0f60388e68c.tar.bz2
[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.
-rw-r--r--libc/config/gpu/entrypoints.txt3
-rw-r--r--libc/config/gpu/headers.txt1
-rw-r--r--libc/src/errno/libc_errno.cpp1
3 files changed, 5 insertions, 0 deletions
diff --git a/libc/config/gpu/entrypoints.txt b/libc/config/gpu/entrypoints.txt
index 69af9ff..5750fba 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 fd753a4..1b77c97 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 26bd9d9..8cf77a8 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 {