diff --git a/libc/src/errno/libc_errno.h b/libc/src/errno/libc_errno.h --- a/libc/src/errno/libc_errno.h +++ b/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 diff --git a/libc/src/errno/libc_errno.cpp b/libc/src/errno/libc_errno.cpp --- a/libc/src/errno/libc_errno.cpp +++ b/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"