[libc-commits] [libc] [llvm] [ci][libc] Switch premerge libc runtime to full-build mode (PR #231937)
Jeff Bailey via libc-commits
libc-commits at lists.llvm.org
Fri Oct 23 03:47:06 PDT 2026
https://github.com/kaladron updated https://github.com/llvm/llvm-project/pull/231937
>From 652b69fde44dc0ed4bab4cd2a078b11ed737fe16 Mon Sep 17 00:00:00 2001
From: Jeff Bailey <jbailey at raspberryginger.com>
Date: Wed, 14 Oct 2026 13:58:34 +0100
Subject: [PATCH 1/3] [ci][libc] Switch premerge libc runtime to full-build
mode
Enable full-build mode for libc in premerge CI when check-libc is
targeted, skipping death and shared math tests to keep execution fast.
Also add a libc-headers dependency to test rules to prevent parallel
build races against public header generation.
Assisted-by: Automated tooling, human reviewed.
---
.ci/monolithic-linux.sh | 8 ++++++++
libc/cmake/modules/LLVMLibCTestRules.cmake | 6 ++++++
2 files changed, 14 insertions(+)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index 2abd53c8ed3c6..39a3c12c25339 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -37,6 +37,14 @@ if [[ " ${runtime_targets} " == *" check-libclc "* ]]; then
)
fi
+if [[ " ${runtime_targets} " == *" check-libc "* ]]; then
+ runtime_cmake_args+=(
+ -D LLVM_LIBC_FULL_BUILD=ON
+ -D LIBC_TEST_SKIP_DEATH_TESTS=ON
+ -D LIBC_TEST_SKIP_SHARED_TESTS=ON
+ )
+fi
+
start-group "CMake"
# Set the system llvm-symbolizer as preferred.
diff --git a/libc/cmake/modules/LLVMLibCTestRules.cmake b/libc/cmake/modules/LLVMLibCTestRules.cmake
index 1c7a4252a69d6..0ffc2a5be792b 100644
--- a/libc/cmake/modules/LLVMLibCTestRules.cmake
+++ b/libc/cmake/modules/LLVMLibCTestRules.cmake
@@ -843,6 +843,9 @@ function(create_libc_test fq_target_name)
${fq_build_target_name}
${fq_deps_list}
)
+ if(TARGET libc-headers)
+ add_dependencies(${fq_build_target_name} libc-headers)
+ endif()
# 5. Add test runner target
_add_libc_test_runner(
@@ -1104,6 +1107,9 @@ function(add_integration_test test_name)
add_dependencies(${fq_build_target_name}
libc.test.IntegrationTest.test
${INTEGRATION_TEST_DEPENDS})
+ if(TARGET libc-headers)
+ add_dependencies(${fq_build_target_name} libc-headers)
+ endif()
_add_libc_test_runner(
${fq_target_name}
>From 7d942dcba3a601add3ac8d2f815753c9f41bee3d Mon Sep 17 00:00:00 2001
From: Jeff Bailey <jbailey at raspberryginger.com>
Date: Fri, 23 Oct 2026 07:16:16 +0100
Subject: [PATCH 2/3] [ci][libc] Pass multiarch kernel headers in premerge CI
Pass the Debian/Ubuntu multiarch directory in LIBC_KERNEL_HEADERS
so that <asm/mman.h> is found during full-build compilation.
Assisted-by: Automated tooling, human reviewed.
---
.ci/monolithic-linux.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/.ci/monolithic-linux.sh b/.ci/monolithic-linux.sh
index 39a3c12c25339..ba91a0b79e674 100755
--- a/.ci/monolithic-linux.sh
+++ b/.ci/monolithic-linux.sh
@@ -38,10 +38,15 @@ if [[ " ${runtime_targets} " == *" check-libclc "* ]]; then
fi
if [[ " ${runtime_targets} " == *" check-libc "* ]]; then
+ libc_kernel_headers="/usr/include"
+ if [[ -d "/usr/include/$(uname -m)-linux-gnu" ]]; then
+ libc_kernel_headers="${libc_kernel_headers};/usr/include/$(uname -m)-linux-gnu"
+ fi
runtime_cmake_args+=(
-D LLVM_LIBC_FULL_BUILD=ON
-D LIBC_TEST_SKIP_DEATH_TESTS=ON
-D LIBC_TEST_SKIP_SHARED_TESTS=ON
+ -D LIBC_KERNEL_HEADERS="${libc_kernel_headers}"
)
fi
>From 07ab64474148348deb5963ad873b358b1146f8fb Mon Sep 17 00:00:00 2001
From: Jeff Bailey <jbailey at raspberryginger.com>
Date: Fri, 23 Oct 2026 11:46:41 +0100
Subject: [PATCH 3/3] [libc][test] Fix unused variable in libgen death tests
Move the return value assignments inside the ASSERT_DEATH lambda
to avoid unused variable warnings when death tests are skipped.
Assisted-by: Automated tooling, human reviewed.
---
libc/test/src/libgen/basename_death_test.cpp | 8 ++++++--
libc/test/src/libgen/dirname_death_test.cpp | 8 ++++++--
2 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/libc/test/src/libgen/basename_death_test.cpp b/libc/test/src/libgen/basename_death_test.cpp
index b533dac9eba2f..2a5aaa0e9d329 100644
--- a/libc/test/src/libgen/basename_death_test.cpp
+++ b/libc/test/src/libgen/basename_death_test.cpp
@@ -15,6 +15,10 @@
#include "test/UnitTest/Test.h"
TEST(LlvmLibcBasenameTest, ModifyReturnValue) {
- char *r = LIBC_NAMESPACE::basename(nullptr);
- ASSERT_DEATH([r]() { r[0] = 'a'; }, WITH_SIGNAL(-1));
+ ASSERT_DEATH(
+ []() {
+ char *r = LIBC_NAMESPACE::basename(nullptr);
+ r[0] = 'a';
+ },
+ WITH_SIGNAL(-1));
}
diff --git a/libc/test/src/libgen/dirname_death_test.cpp b/libc/test/src/libgen/dirname_death_test.cpp
index 6a972d75df26e..c16edfc5b765c 100644
--- a/libc/test/src/libgen/dirname_death_test.cpp
+++ b/libc/test/src/libgen/dirname_death_test.cpp
@@ -15,6 +15,10 @@
#include "test/UnitTest/Test.h"
TEST(LlvmLibcDirnameTest, ModifyReturnValue) {
- char *r = LIBC_NAMESPACE::dirname(nullptr);
- ASSERT_DEATH([r]() { r[0] = 'a'; }, WITH_SIGNAL(-1));
+ ASSERT_DEATH(
+ []() {
+ char *r = LIBC_NAMESPACE::dirname(nullptr);
+ r[0] = 'a';
+ },
+ WITH_SIGNAL(-1));
}
More information about the libc-commits
mailing list