[libc-commits] [libc] [libc] Make hermetic test syscall deps linux-only (PR #210715)
Pavel Labath via libc-commits
libc-commits at lists.llvm.org
Mon Jul 20 06:26:53 PDT 2026
https://github.com/labath created https://github.com/llvm/llvm-project/pull/210715
They are only used on linux, so this matches that.
They are also only used in full build mode, but hermetic tests only work in full build mode, so we don't need to check that here. The darwin check is a noop as (AAIU) we don't support full_build on darwin, but I've kept it for symmetry.
>From 06d448ebc1660f7b227e04c7d652cc31110dd068 Mon Sep 17 00:00:00 2001
From: Pavel Labath <pavel at labath.sk>
Date: Mon, 20 Jul 2026 13:22:58 +0000
Subject: [PATCH] [libc] Make hermetic test syscall deps linux-only
They are only used on linux, so this matches that.
They are also only used in full build mode, but hermetic tests only work
in full build mode, so we don't need to check that here. The darwin
check is a noop as (AAIU) we don't support full_build on darwin, but
I've kept it for symmetry.
---
libc/cmake/modules/LLVMLibCTestRules.cmake | 29 +++++++++++++---------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index fdc7764c65177..73803b809b991 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -780,20 +780,25 @@ function(add_libc_hermetic test_name)
libc.src.string.memset
libc.src.strings.bcmp
libc.src.strings.bzero
- # Syscalls used by death tests.
- libc.src.poll.poll
- libc.src.signal.kill
- libc.src.stdio.fflush
- libc.src.stdio.stderr
- libc.src.stdio.stdout
- libc.src.stdlib.exit
- libc.src.string.strsignal
- libc.src.sys.wait.waitpid
- libc.src.unistd.close
- libc.src.unistd.fork
- libc.src.unistd.pipe
)
+ # Syscalls used by death tests. See also libc/test/UnitTest/CMakeLists.txt.
+ if(${LIBC_TARGET_OS} STREQUAL "linux" OR ${LIBC_TARGET_OS} STREQUAL "darwin")
+ list(APPEND fq_deps_list
+ libc.src.poll.poll
+ libc.src.signal.kill
+ libc.src.stdio.fflush
+ libc.src.stdio.stderr
+ libc.src.stdio.stdout
+ libc.src.stdlib.exit
+ libc.src.string.strsignal
+ libc.src.sys.wait.waitpid
+ libc.src.unistd.close
+ libc.src.unistd.fork
+ libc.src.unistd.pipe
+ )
+ endif()
+
if(libc.src.compiler.__stack_chk_fail IN_LIST TARGET_LLVMLIBC_ENTRYPOINTS)
# __stack_chk_fail should always be included if supported to allow building
# libc with the stack protector enabled.
More information about the libc-commits
mailing list