[libc-commits] [libc] a9c7d0e - [libc] fix fullbuild handling for macro functions

Michael Jones via libc-commits libc-commits at lists.llvm.org
Tue Oct 4 15:37:38 PDT 2022


Author: Michael Jones
Date: 2022-10-04T15:37:31-07:00
New Revision: a9c7d0e1aeca5916ef8e994b517f3ad2b4e0b6a8

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

LOG: [libc] fix fullbuild handling for macro functions

Now they're only included at all if the mode is fullbuild.

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

Added: 
    

Modified: 
    libc/config/linux/x86_64/entrypoints.txt
    libc/test/src/sched/CMakeLists.txt
    libc/test/src/unistd/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libc/config/linux/x86_64/entrypoints.txt b/libc/config/linux/x86_64/entrypoints.txt
index fa7cec71db821..0bd5f897edbbc 100644
--- a/libc/config/linux/x86_64/entrypoints.txt
+++ b/libc/config/linux/x86_64/entrypoints.txt
@@ -25,7 +25,6 @@ set(TARGET_LIBC_ENTRYPOINTS
     # sched.h entrypoints
     libc.src.sched.sched_getaffinity
     libc.src.sched.sched_setaffinity
-    libc.src.sched.sched_getcpucount
 
     # string.h entrypoints
     libc.src.string.bcmp
@@ -160,7 +159,6 @@ set(TARGET_LIBC_ENTRYPOINTS
     libc.src.unistd.rmdir
     libc.src.unistd.symlink
     libc.src.unistd.symlinkat
-    libc.src.unistd.__llvm_libc_syscall
     libc.src.unistd.truncate
     libc.src.unistd.unlink
     libc.src.unistd.unlinkat
@@ -335,6 +333,9 @@ if(LLVM_LIBC_FULL_BUILD)
     libc.src.pthread.pthread_once
     libc.src.pthread.pthread_setspecific
 
+    # sched.h entrypoints
+    libc.src.sched.sched_getcpucount
+
     # stdio.h entrypoints
     libc.src.stdio.clearerr
     libc.src.stdio.clearerr_unlocked
@@ -410,6 +411,7 @@ if(LLVM_LIBC_FULL_BUILD)
 
     # unistd.h entrypoints
     libc.src.unistd.fork
+    libc.src.unistd.__llvm_libc_syscall
   )
 endif()
 

diff  --git a/libc/test/src/sched/CMakeLists.txt b/libc/test/src/sched/CMakeLists.txt
index e4ac5b818b81f..02ff550bde41f 100644
--- a/libc/test/src/sched/CMakeLists.txt
+++ b/libc/test/src/sched/CMakeLists.txt
@@ -16,22 +16,18 @@ add_libc_unittest(
     libc.test.errno_setter_matcher
 )
 
-# Since this test depends on a macro defined in the sched header, it won't work
-# without fullbuild.
-if(LLVM_LIBC_FULL_BUILD)
-  add_libc_unittest(
-    cpu_count_test
-    SUITE
-      libc_sched_unittests
-    SRCS
-      cpu_count_test.cpp
-    DEPENDS
-      libc.include.errno
-      libc.include.sched
-      libc.include.sys_syscall
-      libc.src.__support.OSUtil.osutil
-      libc.src.sched.sched_getaffinity
-      libc.src.sched.sched_getcpucount
-      libc.test.errno_setter_matcher
-  )
-endif()
+add_libc_unittest(
+  cpu_count_test
+  SUITE
+    libc_sched_unittests
+  SRCS
+    cpu_count_test.cpp
+  DEPENDS
+    libc.include.errno
+    libc.include.sched
+    libc.include.sys_syscall
+    libc.src.__support.OSUtil.osutil
+    libc.src.sched.sched_getaffinity
+    libc.src.sched.sched_getcpucount
+    libc.test.errno_setter_matcher
+)

diff  --git a/libc/test/src/unistd/CMakeLists.txt b/libc/test/src/unistd/CMakeLists.txt
index d8f3138d253bb..448116e140b23 100644
--- a/libc/test/src/unistd/CMakeLists.txt
+++ b/libc/test/src/unistd/CMakeLists.txt
@@ -362,19 +362,17 @@ add_libc_unittest(
     libc.src.unistd.geteuid
 )
 
-if(LLVM_LIBC_FULL_BUILD)
-  add_libc_unittest(
-    syscall_test
-    SUITE
-      libc_unistd_unittests
-    SRCS
-      syscall_test.cpp
-    DEPENDS
-      libc.src.unistd.__llvm_libc_syscall
-      libc.include.errno
-      libc.include.unistd
-      libc.include.fcntl
-      libc.include.sys_syscall
-      libc.test.errno_setter_matcher
-  )
-endif()
+add_libc_unittest(
+  syscall_test
+  SUITE
+    libc_unistd_unittests
+  SRCS
+    syscall_test.cpp
+  DEPENDS
+    libc.src.unistd.__llvm_libc_syscall
+    libc.include.errno
+    libc.include.unistd
+    libc.include.fcntl
+    libc.include.sys_syscall
+    libc.test.errno_setter_matcher
+)


        


More information about the libc-commits mailing list