[libc-commits] [PATCH] D152015: [libc] Implement 'errno' on the GPU as a global integer internally
Joseph Huber via Phabricator via libc-commits
libc-commits at lists.llvm.org
Fri Jun 2 12:16:48 PDT 2023
This revision was automatically updated to reflect the committed changes.
Closed by commit rGcfde5f2d8969: [libc] Implement 'errno' on the GPU as a global integer internally (authored by jhuber6).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152015/new/
https://reviews.llvm.org/D152015
Files:
libc/src/errno/libc_errno.cpp
libc/src/errno/libc_errno.h
Index: libc/src/errno/libc_errno.h
===================================================================
--- libc/src/errno/libc_errno.h
+++ libc/src/errno/libc_errno.h
@@ -39,13 +39,10 @@
#else
namespace __llvm_libc {
-#ifdef LIBC_TARGET_ARCH_IS_GPU
-extern "C" ErrnoConsumer __llvmlibc_internal_errno;
-#else // LIBC_TARGET_ARCH_IS_GPU
-extern "C" {
-extern LIBC_THREAD_LOCAL int __llvmlibc_internal_errno;
-} // extern "C"
-#endif
+// TODO: On the GPU build this will be mapped to a single global value. We need
+// to ensure that tests are not run with multiple threads that depend on errno
+// until we have true 'thread_local' support on the GPU.
+extern "C" LIBC_THREAD_LOCAL int __llvmlibc_internal_errno;
// TODO: After all of libc/src and libc/test are switched over to use
// libc_errno, this header file will be "shipped" via an add_entrypoint_object
Index: libc/src/errno/libc_errno.cpp
===================================================================
--- libc/src/errno/libc_errno.cpp
+++ libc/src/errno/libc_errno.cpp
@@ -33,11 +33,7 @@
LIBC_THREAD_LOCAL int __llvmlibc_errno;
#endif // LIBC_TARGET_ARCH_IS_GPU
#else
-#ifdef LIBC_TARGET_ARCH_IS_GPU
-ErrnoConsumer __llvmlibc_internal_errno;
-#else
LIBC_THREAD_LOCAL int __llvmlibc_internal_errno;
-#endif // LIBC_TARGET_ARCH_IS_GPU
#endif
} // extern "C"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D152015.527928.patch
Type: text/x-patch
Size: 1337 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libc-commits/attachments/20230602/490b7770/attachment.bin>
More information about the libc-commits
mailing list