[libc-commits] [libc] [libc] Generate a stub for librt.a (PR #225357)
Jeff Bailey via libc-commits
libc-commits at lists.llvm.org
Tue Sep 22 03:27:30 PDT 2026
https://github.com/kaladron created https://github.com/llvm/llvm-project/pull/225357
Created an empty librt.a static archive on Linux to avoid link errors when build rules explicitly pass -lrt to the linker. Realtime extensions reside in the main libc.a archive instead.
Follows the pattern set in commit ede01decbcb34bd2f04b9102ab96664cc6d5aa4b.
Assisted-by: Automated tooling, human reviewed.
>From 3e1d98390005ef4318ed8279ac670e0f20429fee Mon Sep 17 00:00:00 2001
From: Jeff Bailey <jbailey at raspberryginger.com>
Date: Tue, 22 Sep 2026 07:46:20 +0100
Subject: [PATCH] [libc] Generate a stub for librt.a
Created an empty librt.a static archive on Linux to avoid link errors
when build rules explicitly pass -lrt to the linker. Realtime
extensions reside in the main libc.a archive instead.
Follows the pattern set in commit ede01decbcb34bd2f04b9102ab96664cc6d5aa4b.
Assisted-by: Automated tooling, human reviewed.
---
libc/lib/CMakeLists.txt | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libc/lib/CMakeLists.txt b/libc/lib/CMakeLists.txt
index 07bc467b72cf1..0d8e7424e6247 100644
--- a/libc/lib/CMakeLists.txt
+++ b/libc/lib/CMakeLists.txt
@@ -74,7 +74,7 @@ endforeach()
# bits of libc to be located in separate files (e.g. libpthread).
set(added_empty_archives "")
if(LLVM_LIBC_FULL_BUILD AND ${LIBC_TARGET_OS} STREQUAL "linux")
- list(APPEND libc_empty_archive_names pthread dl)
+ list(APPEND libc_empty_archive_names pthread dl rt)
foreach(archive ${libc_empty_archive_names})
set(empty_archive_path ${LIBC_LIBRARY_DIR}/lib${archive}.a)
add_custom_command(
More information about the libc-commits
mailing list