[libc-commits] [libc] dd33f9c - [libc] Make the errno macro resolve to the thread local variable directly.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Fri Mar 4 09:30:06 PST 2022


Author: Siva Chandra Reddy
Date: 2022-03-04T17:29:49Z
New Revision: dd33f9cdef9f6209aa34713e1417f4a2e24e5ca6

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

LOG: [libc] Make the errno macro resolve to the thread local variable directly.

With modern architectures having a thread pointer and language supporting
thread locals, there is no reason to use a function intermediary to access
the thread local errno value.

The entrypoint corresponding to errno has been replaced with an object
library as there is no formal entrypoint for errno anymore.

Reviewed By: jeffbailey, michaelrj

Differential Revision: https://reviews.llvm.org/D120920

Added: 
    libc/src/errno/errno.cpp

Modified: 
    libc/config/linux/aarch64/entrypoints.txt
    libc/config/linux/api.td
    libc/config/linux/x86_64/entrypoints.txt
    libc/include/__llvm-libc-common.h
    libc/spec/llvm_libc_ext.td
    libc/src/__support/CMakeLists.txt
    libc/src/__support/FPUtil/CMakeLists.txt
    libc/src/__support/File/CMakeLists.txt
    libc/src/errno/CMakeLists.txt
    libc/src/errno/llvmlibc_errno.h
    libc/src/fcntl/linux/CMakeLists.txt
    libc/src/math/generic/CMakeLists.txt
    libc/src/signal/linux/CMakeLists.txt
    libc/src/sys/mman/linux/CMakeLists.txt
    libc/src/sys/stat/linux/CMakeLists.txt
    libc/src/threads/linux/CMakeLists.txt
    libc/src/time/CMakeLists.txt
    libc/src/unistd/linux/CMakeLists.txt
    libc/test/loader/linux/CMakeLists.txt
    libc/test/src/__support/File/CMakeLists.txt
    libc/test/src/errno/CMakeLists.txt
    libc/test/src/math/CMakeLists.txt
    libc/test/src/signal/CMakeLists.txt
    libc/test/src/sys/mman/linux/CMakeLists.txt
    libc/test/src/threads/CMakeLists.txt

Removed: 
    libc/src/errno/__errno_location.cpp
    libc/src/errno/__errno_location.h


################################################################################
diff  --git a/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index c80e6bee82b76..5bdbced557224 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -17,9 +17,6 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.ctype.tolower
     libc.src.ctype.toupper
     
-    # errno.h entrypoints
-    libc.src.errno.__errno_location
-
     # fcntl.h entrypoints
     libc.src.fcntl.creat
     libc.src.fcntl.open

diff  --git a/libc/config/linux/api.td b/libc/config/linux/api.td
index 3841e36b1ba98..fc208978b14a4 100644
--- a/libc/config/linux/api.td
+++ b/libc/config/linux/api.td
@@ -44,11 +44,8 @@ def NullMacro : MacroDef<"NULL"> {
 
 def ErrnoMacro : MacroDef<"errno"> {
   let Defn = [{
-    #ifdef __cplusplus
-    extern "C"
-    #endif
-    int *__errno_location();
-    #define errno (*__errno_location())
+    extern _Thread_local int __llvmlibc_errno;
+    #define errno __llvmlibc_errno
   }];
 }
 

diff  --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index 500e9cc3a43be..e08c8fd42c21a 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -17,9 +17,6 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.ctype.tolower
     libc.src.ctype.toupper
 
-    # errno.h entrypoints
-    libc.src.errno.__errno_location
-
     # fcntl.h entrypoints
     libc.src.fcntl.creat
     libc.src.fcntl.open

diff  --git a/libc/include/__llvm-libc-common.h b/libc/include/__llvm-libc-common.h
index a9e0f6936143e..ce289e55b13dc 100644
--- a/libc/include/__llvm-libc-common.h
+++ b/libc/include/__llvm-libc-common.h
@@ -29,6 +29,9 @@
 #undef _Alignof
 #define _Alignof alignof
 
+#undef _Thread_local
+#define _Thread_local thread_local
+
 #else // not __cplusplus
 
 #undef __BEGIN_C_DECLS

diff  --git a/libc/spec/llvm_libc_ext.td b/libc/spec/llvm_libc_ext.td
index d4a133a5c5575..ee624141e5f2d 100644
--- a/libc/spec/llvm_libc_ext.td
+++ b/libc/spec/llvm_libc_ext.td
@@ -33,24 +33,8 @@ def LLVMLibcExt : StandardSpec<"llvm_libc_ext"> {
       ]
   >;
 
-  HeaderSpec Errno = HeaderSpec<
-      "errno.h",
-      [], // Macros
-      [], // Types
-      [], // Enumerations
-      [
-          FunctionSpec<
-              "__errno_location",
-              RetValSpec<IntPtr>,
-              [ArgSpec<VoidType>]
-
-          >,
-      ]
-  >;
-
   let Headers = [
     String,
     Assert,
-    Errno,
   ];
 }

diff  --git a/libc/src/__support/CMakeLists.txt b/libc/src/__support/CMakeLists.txt
index f70803dcd7040..56d1b07ad0847 100644
--- a/libc/src/__support/CMakeLists.txt
+++ b/libc/src/__support/CMakeLists.txt
@@ -22,7 +22,7 @@ add_header_library(
   DEPENDS
     .ctype_utils
     libc.include.errno
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.__support.CPP.standalone_cpp
 )
 
@@ -43,7 +43,7 @@ add_header_library(
     .ctype_utils
     .high_precision_decimal
     libc.include.errno
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.__support.CPP.standalone_cpp
     libc.src.__support.FPUtil.fputil
 )

diff  --git a/libc/src/__support/FPUtil/CMakeLists.txt b/libc/src/__support/FPUtil/CMakeLists.txt
index d1a3cf1fb1a26..555a3f4eb224b 100644
--- a/libc/src/__support/FPUtil/CMakeLists.txt
+++ b/libc/src/__support/FPUtil/CMakeLists.txt
@@ -21,7 +21,7 @@ add_header_library(
     libc.include.fenv
     libc.src.__support.common
     libc.src.__support.CPP.standalone_cpp
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_header_library(

diff  --git a/libc/src/__support/File/CMakeLists.txt b/libc/src/__support/File/CMakeLists.txt
index ddc09b4d5e50d..d00ccc5ed7208 100644
--- a/libc/src/__support/File/CMakeLists.txt
+++ b/libc/src/__support/File/CMakeLists.txt
@@ -5,5 +5,6 @@ add_object_library(
   HDRS
     file.h
   DEPENDS
-    libc.src.errno.__errno_location
+    libc.include.errno
+    libc.src.errno.errno
 )

diff  --git a/libc/src/errno/CMakeLists.txt b/libc/src/errno/CMakeLists.txt
index eff1c73fa0c9d..e9ddb279e9ec3 100644
--- a/libc/src/errno/CMakeLists.txt
+++ b/libc/src/errno/CMakeLists.txt
@@ -1,15 +1,14 @@
 if (LLVM_LIBC_FULL_BUILD)
-add_entrypoint_object(
-  __errno_location
+add_object_library(
+  errno
   SRCS
-    __errno_location.cpp
+    errno.cpp
   HDRS
-    __errno_location.h
     llvmlibc_errno.h
 )
 else()
-add_entrypoint_object(
-  __errno_location
+add_object_library(
+  errno
   SRCS
     dummy_errno.cpp
   HDRS

diff  --git a/libc/src/errno/__errno_location.cpp b/libc/src/errno/__errno_location.cpp
deleted file mode 100644
index b4860ebe7b7f3..0000000000000
--- a/libc/src/errno/__errno_location.cpp
+++ /dev/null
@@ -1,22 +0,0 @@
-//===-- Implementation of __errno_location --------------------------------===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#include "src/errno/__errno_location.h"
-
-#include "src/__support/common.h"
-
-namespace __llvm_libc {
-
-static thread_local int errno = 0;
-
-// __errno_location is not really an entry point but we still want it to behave
-// like an entry point because the errno macro resolves to the C symbol
-// "__errno_location".
-LLVM_LIBC_FUNCTION(int *, __errno_location, ()) { return &errno; }
-
-} // namespace __llvm_libc

diff  --git a/libc/src/errno/__errno_location.h b/libc/src/errno/__errno_location.h
deleted file mode 100644
index 20be3fcf812ae..0000000000000
--- a/libc/src/errno/__errno_location.h
+++ /dev/null
@@ -1,18 +0,0 @@
-//===-- Implementation header for __errno_location --------------*- C++ -*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===----------------------------------------------------------------------===//
-
-#ifndef LLVM_LIBC_SRC_ERRNO_ERRNO_LOCATION_H
-#define LLVM_LIBC_SRC_ERRNO_ERRNO_LOCATION_H
-
-namespace __llvm_libc {
-
-int *__errno_location();
-
-} // namespace __llvm_libc
-
-#endif // LLVM_LIBC_SRC_ERRNO_ERRNO_LOCATION_H

diff  --git a/libc/src/errno/errno.cpp b/libc/src/errno/errno.cpp
new file mode 100644
index 0000000000000..84e111bb20930
--- /dev/null
+++ b/libc/src/errno/errno.cpp
@@ -0,0 +1,9 @@
+//===-- Implementation of __errno_location --------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+thread_local int __llvmlibc_errno = 0;

diff  --git a/libc/src/errno/llvmlibc_errno.h b/libc/src/errno/llvmlibc_errno.h
index d1032a42c472f..5e505add9b4eb 100644
--- a/libc/src/errno/llvmlibc_errno.h
+++ b/libc/src/errno/llvmlibc_errno.h
@@ -6,13 +6,12 @@
 //
 //===----------------------------------------------------------------------===//
 
-#include "src/errno/__errno_location.h"
-
 #ifndef LLVM_LIBC_SRC_ERRNO_LLVMLIBC_ERRNO_H
 #define LLVM_LIBC_SRC_ERRNO_LLVMLIBC_ERRNO_H
 
 // Internal code should use this and not use the errno macro from the
 // public header.
-#define llvmlibc_errno (*__llvm_libc::__errno_location())
+extern thread_local int __llvmlibc_errno;
+#define llvmlibc_errno __llvmlibc_errno
 
 #endif // LLVM_LIBC_SRC_ERRNO_LLVMLIBC_ERRNO_H

diff  --git a/libc/src/fcntl/linux/CMakeLists.txt b/libc/src/fcntl/linux/CMakeLists.txt
index 17d7b4b76491f..926292ca93cd2 100644
--- a/libc/src/fcntl/linux/CMakeLists.txt
+++ b/libc/src/fcntl/linux/CMakeLists.txt
@@ -8,7 +8,7 @@ add_entrypoint_object(
     libc.include.errno
     libc.include.fcntl
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -21,7 +21,7 @@ add_entrypoint_object(
     libc.include.errno
     libc.include.fcntl
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -34,5 +34,5 @@ add_entrypoint_object(
     libc.include.errno
     libc.include.fcntl
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )

diff  --git a/libc/src/math/generic/CMakeLists.txt b/libc/src/math/generic/CMakeLists.txt
index 87770431adeb3..cba0879be4802 100644
--- a/libc/src/math/generic/CMakeLists.txt
+++ b/libc/src/math/generic/CMakeLists.txt
@@ -43,7 +43,7 @@ add_object_library(
   DEPENDS
     libc.include.errno
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_object_library(
@@ -65,7 +65,7 @@ add_entrypoint_object(
   DEPENDS
     .sincosf_utils
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
   COMPILE_OPTIONS
     -O3
 )
@@ -79,7 +79,7 @@ add_entrypoint_object(
   DEPENDS
     .sincosf_utils
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.__support.FPUtil.fputil
   COMPILE_OPTIONS
     -O3
@@ -94,7 +94,7 @@ add_entrypoint_object(
   DEPENDS
     .sincosf_utils
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
   COMPILE_OPTIONS
     -O3
 )

diff  --git a/libc/src/signal/linux/CMakeLists.txt b/libc/src/signal/linux/CMakeLists.txt
index 419146f5bd447..c069c9fa350eb 100644
--- a/libc/src/signal/linux/CMakeLists.txt
+++ b/libc/src/signal/linux/CMakeLists.txt
@@ -41,7 +41,7 @@ add_entrypoint_object(
     libc.include.signal
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -55,7 +55,7 @@ add_entrypoint_object(
     libc.include.signal
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -68,7 +68,7 @@ add_entrypoint_object(
   DEPENDS
     libc.include.errno
     libc.include.signal
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -81,7 +81,7 @@ add_entrypoint_object(
   DEPENDS
     libc.include.errno
     libc.include.signal
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -106,7 +106,7 @@ add_entrypoint_object(
   DEPENDS
     libc.include.errno
     libc.include.signal
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -119,5 +119,5 @@ add_entrypoint_object(
   DEPENDS
     libc.include.errno
     libc.include.signal
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )

diff  --git a/libc/src/sys/mman/linux/CMakeLists.txt b/libc/src/sys/mman/linux/CMakeLists.txt
index 949d965fdbe91..0ca65afad9332 100644
--- a/libc/src/sys/mman/linux/CMakeLists.txt
+++ b/libc/src/sys/mman/linux/CMakeLists.txt
@@ -8,7 +8,7 @@ add_entrypoint_object(
     libc.include.sys_mman
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -21,5 +21,5 @@ add_entrypoint_object(
     libc.include.sys_mman
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )

diff  --git a/libc/src/sys/stat/linux/CMakeLists.txt b/libc/src/sys/stat/linux/CMakeLists.txt
index bf92d5f4b88cb..88d50622e98e0 100644
--- a/libc/src/sys/stat/linux/CMakeLists.txt
+++ b/libc/src/sys/stat/linux/CMakeLists.txt
@@ -9,7 +9,7 @@ add_entrypoint_object(
     libc.include.sys_stat
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -22,5 +22,5 @@ add_entrypoint_object(
     libc.include.sys_stat
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )

diff  --git a/libc/src/threads/linux/CMakeLists.txt b/libc/src/threads/linux/CMakeLists.txt
index 6fdca98ebe849..f5ac139889e8e 100644
--- a/libc/src/threads/linux/CMakeLists.txt
+++ b/libc/src/threads/linux/CMakeLists.txt
@@ -50,7 +50,7 @@ add_entrypoint_object(
     libc.include.threads
     libc.src.__support.common
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.sys.mman.mmap
   COMPILE_OPTIONS
     -O3

diff  --git a/libc/src/time/CMakeLists.txt b/libc/src/time/CMakeLists.txt
index 7e849cf0543ae..514b36cd852ac 100644
--- a/libc/src/time/CMakeLists.txt
+++ b/libc/src/time/CMakeLists.txt
@@ -7,7 +7,7 @@ add_object_library(
   DEPENDS
     libc.include.errno
     libc.include.time
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -64,5 +64,5 @@ add_entrypoint_object(
     .time_utils
     libc.include.errno
     libc.include.time
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )

diff  --git a/libc/src/unistd/linux/CMakeLists.txt b/libc/src/unistd/linux/CMakeLists.txt
index 30e073a1cb1be..f990a820b8b98 100644
--- a/libc/src/unistd/linux/CMakeLists.txt
+++ b/libc/src/unistd/linux/CMakeLists.txt
@@ -8,7 +8,7 @@ add_entrypoint_object(
     libc.include.unistd
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -21,7 +21,7 @@ add_entrypoint_object(
     libc.include.unistd
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -34,7 +34,7 @@ add_entrypoint_object(
     libc.include.unistd
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -48,7 +48,7 @@ add_entrypoint_object(
     libc.include.unistd
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -62,7 +62,7 @@ add_entrypoint_object(
     libc.include.unistd
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -76,7 +76,7 @@ add_entrypoint_object(
     libc.include.unistd
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )
 
 add_entrypoint_object(
@@ -89,5 +89,5 @@ add_entrypoint_object(
     libc.include.unistd
     libc.include.sys_syscall
     libc.src.__support.OSUtil.osutil
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )

diff  --git a/libc/test/loader/linux/CMakeLists.txt b/libc/test/loader/linux/CMakeLists.txt
index 27d808c16a00c..36f4ddb1d9627 100644
--- a/libc/test/loader/linux/CMakeLists.txt
+++ b/libc/test/loader/linux/CMakeLists.txt
@@ -70,6 +70,6 @@ add_loader_test(
 #    libc.include.sys_mman
 #    libc.loader.linux.crt1
 #    libc.src.assert.__assert_fail
-#    libc.src.errno.__errno_location
+#    libc.src.errno.errno
 #    libc.src.sys.mman.mmap
 #)

diff  --git a/libc/test/src/__support/File/CMakeLists.txt b/libc/test/src/__support/File/CMakeLists.txt
index 485c8e8a38abe..2757acc5b7040 100644
--- a/libc/test/src/__support/File/CMakeLists.txt
+++ b/libc/test/src/__support/File/CMakeLists.txt
@@ -6,6 +6,7 @@ add_libc_unittest(
   SRCS
     file_test.cpp
   DEPENDS
+    libc.include.errno
     libc.include.stdio
     libc.include.stdlib
     libc.src.__support.File.file

diff  --git a/libc/test/src/errno/CMakeLists.txt b/libc/test/src/errno/CMakeLists.txt
index d60ee207d8840..70520735b9d6f 100644
--- a/libc/test/src/errno/CMakeLists.txt
+++ b/libc/test/src/errno/CMakeLists.txt
@@ -11,5 +11,5 @@ add_libc_unittest(
   SRCS
     errno_test.cpp
   DEPENDS
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
 )

diff  --git a/libc/test/src/math/CMakeLists.txt b/libc/test/src/math/CMakeLists.txt
index 0b7ce71d0095c..0ca9cb55c74e6 100644
--- a/libc/test/src/math/CMakeLists.txt
+++ b/libc/test/src/math/CMakeLists.txt
@@ -309,7 +309,7 @@ add_fp_unittest(
   DEPENDS
     libc.include.errno
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.fenv.feclearexcept
     libc.src.fenv.feraiseexcept
     libc.src.fenv.fetestexcept
@@ -329,7 +329,7 @@ add_fp_unittest(
   DEPENDS
     libc.include.errno
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.fenv.feclearexcept
     libc.src.fenv.feraiseexcept
     libc.src.fenv.fetestexcept
@@ -349,7 +349,7 @@ add_fp_unittest(
   DEPENDS
     libc.include.errno
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.fenv.feclearexcept
     libc.src.fenv.feraiseexcept
     libc.src.fenv.fetestexcept
@@ -369,7 +369,7 @@ add_fp_unittest(
   DEPENDS
     libc.include.errno
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.fenv.feclearexcept
     libc.src.fenv.feraiseexcept
     libc.src.fenv.fetestexcept
@@ -389,7 +389,7 @@ add_fp_unittest(
   DEPENDS
     libc.include.errno
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.fenv.feclearexcept
     libc.src.fenv.feraiseexcept
     libc.src.fenv.fetestexcept
@@ -409,7 +409,7 @@ add_fp_unittest(
   DEPENDS
     libc.include.errno
     libc.include.math
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.fenv.feclearexcept
     libc.src.fenv.feraiseexcept
     libc.src.fenv.fetestexcept

diff  --git a/libc/test/src/signal/CMakeLists.txt b/libc/test/src/signal/CMakeLists.txt
index c5baaf7d9d550..3274914e48233 100644
--- a/libc/test/src/signal/CMakeLists.txt
+++ b/libc/test/src/signal/CMakeLists.txt
@@ -33,7 +33,7 @@ add_libc_unittest(
     sigprocmask_test.cpp
   DEPENDS
     libc.include.errno
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.signal.raise
     libc.src.signal.sigaddset
     libc.src.signal.sigemptyset
@@ -63,7 +63,7 @@ add_libc_unittest(
   DEPENDS
     libc.include.errno
     libc.include.signal
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.signal.raise
     libc.src.signal.signal
     libc.test.errno_setter_matcher

diff  --git a/libc/test/src/sys/mman/linux/CMakeLists.txt b/libc/test/src/sys/mman/linux/CMakeLists.txt
index c7d3dde7d9751..a95f7c8f8f01c 100644
--- a/libc/test/src/sys/mman/linux/CMakeLists.txt
+++ b/libc/test/src/sys/mman/linux/CMakeLists.txt
@@ -9,7 +9,7 @@ add_libc_unittest(
   DEPENDS
     libc.include.errno
     libc.include.sys_mman
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.sys.mman.mmap
     libc.src.sys.mman.munmap
     libc.test.errno_setter_matcher

diff  --git a/libc/test/src/threads/CMakeLists.txt b/libc/test/src/threads/CMakeLists.txt
index 2e23623327932..6ac093cb7205c 100644
--- a/libc/test/src/threads/CMakeLists.txt
+++ b/libc/test/src/threads/CMakeLists.txt
@@ -26,7 +26,7 @@ add_libc_unittest(
     thrd_test.cpp
   DEPENDS
     libc.include.threads
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.threads.thrd_create
     libc.src.threads.thrd_join
 )
@@ -39,7 +39,7 @@ add_libc_unittest(
     mtx_test.cpp
   DEPENDS
     libc.include.threads
-    libc.src.errno.__errno_location
+    libc.src.errno.errno
     libc.src.threads.mtx_destroy
     libc.src.threads.mtx_init
     libc.src.threads.mtx_lock


        


More information about the libc-commits mailing list