[libc-commits] [libc] 8d4ac53 - [libc][NFC] Merge llvmlibc and llvmlibm targets in to a single target.

Siva Chandra Reddy via libc-commits libc-commits at lists.llvm.org
Tue Feb 23 21:29:41 PST 2021


Author: Siva Chandra Reddy
Date: 2021-02-23T21:29:06-08:00
New Revision: 8d4ac5337f196967fa7266a7f65d6b827911416a

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

LOG: [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.

Added: 
    

Modified: 
    libc/CMakeLists.txt
    libc/config/linux/aarch64/entrypoints.txt
    libc/config/linux/x86_64/entrypoints.txt
    libc/lib/CMakeLists.txt
    libc/test/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index be22fb6c9a66..0bf1e3b427fc 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -70,7 +70,7 @@ include("${LIBC_SOURCE_DIR}/config/${LIBC_TARGET_OS}/${LIBC_TARGET_MACHINE}/entr
 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/libc/config/linux/aarch64/entrypoints.txt b/libc/config/linux/aarch64/entrypoints.txt
index b90ae1774bdc..5a546d7b2407 100644
--- a/libc/config/linux/aarch64/entrypoints.txt
+++ b/libc/config/linux/aarch64/entrypoints.txt
@@ -20,19 +20,6 @@ set(TARGET_LIBC_ENTRYPOINTS
     # 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_LIBC_ENTRYPOINTS
 )
 
 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 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.truncf
     libc.src.math.truncl
 )
+
+set(TARGET_LLVMLIBC_ENTRYPOINTS
+  ${TARGET_LIBC_ENTRYPOINTS}
+  ${TARGET_LIBM_ENTRYPOINTS}
+)

diff  --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index 0db3e148923a..5e5c8fc3509c 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -23,19 +23,6 @@ set(TARGET_LIBC_ENTRYPOINTS
     # 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_LIBC_ENTRYPOINTS
 )
 
 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 @@ set(TARGET_LIBM_ENTRYPOINTS
     libc.src.math.truncf
     libc.src.math.truncl
 )
+
+set(TARGET_LLVMLIBC_ENTRYPOINTS
+  ${TARGET_LIBC_ENTRYPOINTS}
+  ${TARGET_LIBM_ENTRYPOINTS}
+)

diff  --git a/libc/lib/CMakeLists.txt b/libc/lib/CMakeLists.txt
index b2b872c6d179..b8ca13b27124 100644
--- a/libc/lib/CMakeLists.txt
+++ b/libc/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/libc/test/src/CMakeLists.txt b/libc/test/src/CMakeLists.txt
index 8375cd15bd84..291925f5db2d 100644
--- a/libc/test/src/CMakeLists.txt
+++ b/libc/test/src/CMakeLists.txt
@@ -15,7 +15,7 @@ add_subdirectory(unistd)
 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 @@ add_custom_command(
 
   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 @@ target_link_options(
   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()


        


More information about the libc-commits mailing list