[libc][NFC] Merge llvmlibc and llvmlibm targets in to a single target.

The single target is called llvmlibc. We can add back smaller libm and
other targets in future if required.

GitOrigin-RevId: 8d4ac5337f196967fa7266a7f65d6b827911416a
diff --git a/CMakeLists.txt b/CMakeLists.txt
index be22fb6..0bf1e3b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -70,7 +70,7 @@
 include("${LIBC_SOURCE_DIR}/config/${LIBC_TARGET_OS}/${LIBC_TARGET_MACHINE}/headers.txt")
 
 set(TARGET_ENTRYPOINT_NAME_LIST "")
-foreach(entrypoint IN LISTS TARGET_LIBC_ENTRYPOINTS TARGET_LIBM_ENTRYPOINTS)
+foreach(entrypoint IN LISTS TARGET_LLVMLIBC_ENTRYPOINTS)
   string(FIND ${entrypoint} "." last_dot_loc REVERSE)
   if(${last_dot_loc} EQUAL -1)
     message(FATAL "Invalid entrypoint target name ${entrypoint}; Expected a '.' "
diff --git a/config/linux/aarch64/entrypoints.txt b/config/linux/aarch64/entrypoints.txt
index b90ae17..5a546d7 100644
--- a/config/linux/aarch64/entrypoints.txt
+++ b/config/linux/aarch64/entrypoints.txt
@@ -20,19 +20,6 @@
     # errno.h entrypoints
     libc.src.errno.__errno_location
 
-    # fenv.h entrypoints
-    libc.src.fenv.feclearexcept
-    libc.src.fenv.fegetenv
-    libc.src.fenv.fegetexceptflag
-    libc.src.fenv.fegetround
-    libc.src.fenv.feholdexcept
-    libc.src.fenv.fesetenv
-    libc.src.fenv.fesetexceptflag
-    libc.src.fenv.fesetround
-    libc.src.fenv.feraiseexcept
-    libc.src.fenv.fetestexcept
-    libc.src.fenv.feupdateenv
-
     # stdlib.h entrypoints
     libc.src.stdlib.abs
     libc.src.stdlib.labs
@@ -62,6 +49,19 @@
 )
 
 set(TARGET_LIBM_ENTRYPOINTS
+    # fenv.h entrypoints
+    libc.src.fenv.feclearexcept
+    libc.src.fenv.fegetenv
+    libc.src.fenv.fegetexceptflag
+    libc.src.fenv.fegetround
+    libc.src.fenv.feholdexcept
+    libc.src.fenv.fesetenv
+    libc.src.fenv.fesetexceptflag
+    libc.src.fenv.fesetround
+    libc.src.fenv.feraiseexcept
+    libc.src.fenv.fetestexcept
+    libc.src.fenv.feupdateenv
+
     # math.h entrypoints
     libc.src.math.copysign
     libc.src.math.copysignf
@@ -144,3 +144,8 @@
     libc.src.math.truncf
     libc.src.math.truncl
 )
+
+set(TARGET_LLVMLIBC_ENTRYPOINTS
+  ${TARGET_LIBC_ENTRYPOINTS}
+  ${TARGET_LIBM_ENTRYPOINTS}
+)
diff --git a/config/linux/x86_64/entrypoints.txt b/config/linux/x86_64/entrypoints.txt
index 0db3e14..5e5c8fc 100644
--- a/config/linux/x86_64/entrypoints.txt
+++ b/config/linux/x86_64/entrypoints.txt
@@ -23,19 +23,6 @@
     # errno.h entrypoints
     libc.src.errno.__errno_location
 
-    # fenv.h entrypoints
-    libc.src.fenv.feclearexcept
-    libc.src.fenv.fegetenv
-    libc.src.fenv.fegetexceptflag
-    libc.src.fenv.fegetround
-    libc.src.fenv.feholdexcept
-    libc.src.fenv.fesetenv
-    libc.src.fenv.fesetexceptflag
-    libc.src.fenv.fesetround
-    libc.src.fenv.feraiseexcept
-    libc.src.fenv.fetestexcept
-    libc.src.fenv.feupdateenv
-
     # signal.h entrypoints
     libc.src.signal.raise
     libc.src.signal.sigaction
@@ -96,6 +83,19 @@
 )
 
 set(TARGET_LIBM_ENTRYPOINTS
+    # fenv.h entrypoints
+    libc.src.fenv.feclearexcept
+    libc.src.fenv.fegetenv
+    libc.src.fenv.fegetexceptflag
+    libc.src.fenv.fegetround
+    libc.src.fenv.feholdexcept
+    libc.src.fenv.fesetenv
+    libc.src.fenv.fesetexceptflag
+    libc.src.fenv.fesetround
+    libc.src.fenv.feraiseexcept
+    libc.src.fenv.fetestexcept
+    libc.src.fenv.feupdateenv
+
     # math.h entrypoints
     libc.src.math.copysign
     libc.src.math.copysignf
@@ -178,3 +178,8 @@
     libc.src.math.truncf
     libc.src.math.truncl
 )
+
+set(TARGET_LLVMLIBC_ENTRYPOINTS
+  ${TARGET_LIBC_ENTRYPOINTS}
+  ${TARGET_LIBM_ENTRYPOINTS}
+)
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt
index b2b872c..b8ca13b 100644
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -1,11 +1,5 @@
 add_entrypoint_library(
   llvmlibc
   DEPENDS
-  ${TARGET_LIBC_ENTRYPOINTS}
-)
-
-add_entrypoint_library(
-  llvmlibm
-  DEPENDS
-  ${TARGET_LIBM_ENTRYPOINTS}
+  ${TARGET_LLVMLIBC_ENTRYPOINTS}
 )
diff --git a/test/src/CMakeLists.txt b/test/src/CMakeLists.txt
index 8375cd1..291925f 100644
--- a/test/src/CMakeLists.txt
+++ b/test/src/CMakeLists.txt
@@ -15,7 +15,7 @@
 set(public_test ${CMAKE_CURRENT_BINARY_DIR}/public_integration_test.cpp)
 
 set(entrypoints_name_list "")
-foreach(entry IN LISTS TARGET_LIBC_ENTRYPOINTS TARGET_LIBM_ENTRYPOINTS)
+foreach(entry IN LISTS TARGET_LLVMLIBC_ENTRYPOINTS)
   get_target_property(entry_name ${entry} "ENTRYPOINT_NAME")
   list(APPEND entrypoints_name_list ${entry_name})
 endforeach()
@@ -36,7 +36,7 @@
 
   DEPENDS ${LIBC_SOURCE_DIR}/config/${LIBC_TARGET_OS}/api.td ${spec_files}
           libc-prototype-testgen ${TARGET_PUBLIC_HEADERS}
-          llvmlibc llvmlibm
+          llvmlibc
 )
 
 add_executable(
@@ -69,7 +69,7 @@
   PRIVATE "-nostdlib"
 )
 set(library_files)
-foreach(library_name IN LISTS "llvmlibc;llvmlibm")
+foreach(library_name IN LISTS "llvmlibc")
   get_target_property(library_file ${library_name} "LIBRARY_FILE")
   list(APPEND library_files ${library_file})
 endforeach()