[libc][NFC] Add dummy errno target to satisfy mixed mode builds.

In mixed mode builds, we should not be including errno as part of
LLVM libc - errno from another library (or the system library) should be
used. But, other entrypoints which use errno list LLVM libc's errno as a
dep ta satisfy the full build mode. So, we add a dummy errno
implementation with empty files to make both mixed mode and full build
mode happy.

GitOrigin-RevId: 381f9affabba647a44412803562b19519fc25611
diff --git a/src/errno/CMakeLists.txt b/src/errno/CMakeLists.txt
index e13aa1d..eff1c73 100644
--- a/src/errno/CMakeLists.txt
+++ b/src/errno/CMakeLists.txt
@@ -1,3 +1,4 @@
+if (LLVM_LIBC_FULL_BUILD)
 add_entrypoint_object(
   __errno_location
   SRCS
@@ -6,3 +7,12 @@
     __errno_location.h
     llvmlibc_errno.h
 )
+else()
+add_entrypoint_object(
+  __errno_location
+  SRCS
+    dummy_errno.cpp
+  HDRS
+    dummy_errno.h
+)
+endif()
diff --git a/src/errno/dummy_errno.cpp b/src/errno/dummy_errno.cpp
new file mode 100644
index 0000000..6abf0ea
--- /dev/null
+++ b/src/errno/dummy_errno.cpp
@@ -0,0 +1,7 @@
+//===-- An empty file to be used for mixed mode builds --------------------===//
+//
+// 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
+//
+//===----------------------------------------------------------------------===//
diff --git a/src/errno/dummy_errno.h b/src/errno/dummy_errno.h
new file mode 100644
index 0000000..2d007b2
--- /dev/null
+++ b/src/errno/dummy_errno.h
@@ -0,0 +1,7 @@
+//===-- An empty file to be used for mixed mode builds ----------*- 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
+//
+//===----------------------------------------------------------------------===//
diff --git a/test/src/errno/CMakeLists.txt b/test/src/errno/CMakeLists.txt
index 61a3094..d60ee20 100644
--- a/test/src/errno/CMakeLists.txt
+++ b/test/src/errno/CMakeLists.txt
@@ -1,3 +1,7 @@
+if(NOT LLVM_LIBC_FULL_BUILD)
+  return()
+endif()
+
 add_libc_testsuite(libc_errno_unittests)
 
 add_libc_unittest(