[libc-commits] [libc] [libc] Generate a stub for librt.a (PR #225357)
via libc-commits
libc-commits at lists.llvm.org
Tue Sep 22 03:28:51 PDT 2026
llvmorg-github-actions[bot] wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libc
Author: Jeff Bailey (kaladron)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/225357.diff
1 Files Affected:
- (modified) libc/lib/CMakeLists.txt (+1-1)
``````````diff
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(
``````````
</details>
https://github.com/llvm/llvm-project/pull/225357
More information about the libc-commits
mailing list