[llvm-branch-commits] [libc] [llvm] [libc][bazel] Make a large swath of targets full-build compatible (PR #218993)
Jackson Stogel via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Wed Aug 26 20:16:25 PDT 2026
https://github.com/jtstogel updated https://github.com/llvm/llvm-project/pull/218993
>From ae34d728151c22a444d01b2ab6f2b2442aa79b5c Mon Sep 17 00:00:00 2001
From: jtstogel <jtstogel at gmail.com>
Date: Wed, 19 Aug 2026 13:31:39 -0700
Subject: [PATCH] [libc][bazel] Make a large swath of targets full-build
compatible
---
libc/src/signal/linux/__restore.cpp | 3 +-
libc/src/signal/linux/kill.cpp | 1 -
libc/src/stdio/remove.h | 1 -
libc/src/stdlib/atexit.cpp | 3 +-
.../llvm-project-overlay/libc/BUILD.bazel | 1295 ++++++++++++++++-
5 files changed, 1249 insertions(+), 54 deletions(-)
diff --git a/libc/src/signal/linux/__restore.cpp b/libc/src/signal/linux/__restore.cpp
index d3b4240f3e6ac..6d3ff79067228 100644
--- a/libc/src/signal/linux/__restore.cpp
+++ b/libc/src/signal/linux/__restore.cpp
@@ -18,8 +18,7 @@
namespace LIBC_NAMESPACE_DECL {
extern "C" void __restore_rt()
- __attribute__((no_sanitize("all"),
- hidden));
+ __attribute__((no_sanitize("all"), visibility("hidden")));
extern "C" void __restore_rt() {
LIBC_NAMESPACE::syscall_impl<long>(SYS_rt_sigreturn);
diff --git a/libc/src/signal/linux/kill.cpp b/libc/src/signal/linux/kill.cpp
index f6b6c3c052a5b..732ee1d353036 100644
--- a/libc/src/signal/linux/kill.cpp
+++ b/libc/src/signal/linux/kill.cpp
@@ -12,7 +12,6 @@
#include "src/__support/common.h"
#include "src/__support/libc_errno.h"
#include "src/__support/macros/config.h"
-#include "src/signal/linux/signal_utils.h"
#include <sys/syscall.h> // For syscall numbers.
diff --git a/libc/src/stdio/remove.h b/libc/src/stdio/remove.h
index 267946ff27598..9a05f01dcb7ff 100644
--- a/libc/src/stdio/remove.h
+++ b/libc/src/stdio/remove.h
@@ -9,7 +9,6 @@
#ifndef LLVM_LIBC_SRC_STDIO_REMOVE_H
#define LLVM_LIBC_SRC_STDIO_REMOVE_H
-#include "hdr/types/FILE.h"
#include "src/__support/macros/config.h"
namespace LIBC_NAMESPACE_DECL {
diff --git a/libc/src/stdlib/atexit.cpp b/libc/src/stdlib/atexit.cpp
index 5b924be3a63ed..58e8a614517a4 100644
--- a/libc/src/stdlib/atexit.cpp
+++ b/libc/src/stdlib/atexit.cpp
@@ -9,12 +9,13 @@
#include "src/stdlib/atexit.h"
#include "hdr/types/atexithandler_t.h"
#include "src/__support/common.h"
+#include "src/__support/macros/attributes.h"
#include "src/__support/macros/config.h"
#include "src/stdlib/exit_handler.h"
namespace LIBC_NAMESPACE_DECL {
-constinit ExitCallbackList atexit_callbacks;
+LIBC_CONSTINIT ExitCallbackList atexit_callbacks;
Mutex handler_list_mtx(/*is_priority_inherit=*/false, /*is_recursive=*/false,
/*is_robust=*/false, /*is_pshared=*/false);
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 9e39d279f253c..c545d6bbde68d 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -325,6 +325,27 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "config_app_h",
+ hdrs = ["config/app.h"],
+ deps = [
+ ":__support_macros_properties_architectures",
+ ] + select({
+ "@platforms//os:linux": [":config_linux_app_h"],
+ "//conditions:default": [],
+ }),
+)
+
+libc_support_library(
+ name = "config_linux_app_h",
+ hdrs = ["config/linux/app.h"],
+ deps = [
+ ":__support_macros_config",
+ ":__support_macros_properties_architectures",
+ ":hdr_stdint_proxy",
+ ],
+)
+
libc_support_library(
name = "__support_macros_macro_utils",
hdrs = ["src/__support/macros/macro-utils.h"],
@@ -341,6 +362,51 @@ libc_support_library(
################################# Include Files ################################
+libc_support_library(
+ name = "llvm_libc_macros_assert_macros",
+ hdrs = ["include/llvm-libc-macros/assert-macros.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_stdbit_macros",
+ textual_hdrs = ["include/llvm-libc-macros/stdbit-macros.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_stdckdint_macros",
+ hdrs = ["include/llvm-libc-macros/stdckdint-macros.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_offsetof_macro",
+ hdrs = ["include/llvm-libc-macros/offsetof-macro.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_containerof_macro",
+ hdrs = ["include/llvm-libc-macros/containerof-macro.h"],
+ deps = [":llvm_libc_macros_offsetof_macro"],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_null_macro",
+ hdrs = ["include/llvm-libc-macros/null-macro.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_sys_queue_macros",
+ hdrs = ["include/llvm-libc-macros/sys-queue-macros.h"],
+ deps = [
+ ":llvm_libc_macros_containerof_macro",
+ ":llvm_libc_macros_null_macro",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_common_h",
+ hdrs = ["include/__llvm-libc-common.h"],
+)
+
libc_support_library(
name = "llvm_libc_macros_complex_macros",
hdrs = [
@@ -357,6 +423,12 @@ libc_support_library(
deps = [":llvm_libc_macros_limits_macros"],
)
+libc_support_library(
+ name = "llvm_libc_macros_math_function_macros",
+ hdrs = ["include/llvm-libc-macros/math-function-macros.h"],
+ deps = [":llvm_libc_macros_math_macros"],
+)
+
libc_support_library(
name = "llvm_libc_macros_limits_macros",
hdrs = ["include/llvm-libc-macros/limits-macros.h"],
@@ -373,6 +445,19 @@ libc_support_library(
deps = [":llvm_libc_types_float128"],
)
+libc_support_library(
+ name = "llvm_libc_macros_file_seek_macros",
+ hdrs = ["include/llvm-libc-macros/file-seek-macros.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_stdio_macros",
+ hdrs = ["include/llvm-libc-macros/stdio-macros.h"],
+ deps = [
+ ":llvm_libc_types_FILE",
+ ],
+)
+
libc_support_library(
name = "llvm_libc_macros_stdint_macros",
hdrs = ["include/llvm-libc-macros/stdint-macros.h"],
@@ -384,6 +469,48 @@ libc_support_library(
deps = [":llvm_libc_macros_float_macros"],
)
+libc_support_library(
+ name = "llvm_libc_macros_sched_macros",
+ hdrs = [
+ "include/llvm-libc-macros/linux/sched-macros.h",
+ "include/llvm-libc-macros/sched-macros.h",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_poll_macros",
+ hdrs = [
+ "include/llvm-libc-macros/linux/poll-macros.h",
+ "include/llvm-libc-macros/poll-macros.h",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_pthread_macros",
+ hdrs = [
+ "include/llvm-libc-macros/pthread-macros.h",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_signal_macros",
+ hdrs = [
+ "include/llvm-libc-macros/linux/signal-macros.h",
+ "include/llvm-libc-macros/signal-macros.h",
+ ],
+ deps = [
+ ":llvm_libc_common_h",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_unistd_macros",
+ hdrs = [
+ "include/llvm-libc-macros/linux/unistd-macros.h",
+ "include/llvm-libc-macros/unistd-macros.h",
+ ],
+)
+
libc_support_library(
name = "llvm_libc_types_float128",
hdrs = ["include/llvm-libc-types/float128.h"],
@@ -405,6 +532,31 @@ libc_support_library(
deps = [":llvm_libc_macros_complex_macros"],
)
+libc_support_library(
+ name = "llvm_libc_types_mode_t",
+ hdrs = ["include/llvm-libc-types/mode_t.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_pid_t",
+ hdrs = ["include/llvm-libc-types/pid_t.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_uid_t",
+ hdrs = ["include/llvm-libc-types/uid_t.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_union_sigval",
+ hdrs = ["include/llvm-libc-types/union_sigval.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_off_t",
+ hdrs = ["include/llvm-libc-types/off_t.h"],
+)
+
libc_support_library(
name = "llvm_libc_types_struct_cmsghdr",
hdrs = ["include/llvm-libc-types/struct_cmsghdr.h"],
@@ -434,6 +586,22 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "llvm_libc_macros_sys_wait_macros",
+ hdrs = [
+ "include/llvm-libc-macros/linux/sys-wait-macros.h",
+ "include/llvm-libc-macros/sys-wait-macros.h",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_macros_wchar_macros",
+ hdrs = ["include/llvm-libc-macros/wchar-macros.h"],
+ deps = [
+ ":llvm_libc_types_wint_t",
+ ],
+)
+
libc_support_library(
name = "llvm_libc_types_size_t",
hdrs = ["include/llvm-libc-types/size_t.h"],
@@ -444,6 +612,112 @@ libc_support_library(
hdrs = ["include/llvm-libc-types/char8_t.h"],
)
+libc_support_library(
+ name = "llvm_libc_macros_fenv_macros",
+ hdrs = ["include/llvm-libc-macros/fenv-macros.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_sigset_t",
+ hdrs = ["include/llvm-libc-types/sigset_t.h"],
+ deps = [
+ ":llvm_libc_macros_signal_macros",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_siginfo_t",
+ hdrs = ["include/llvm-libc-types/siginfo_t.h"],
+ deps = [
+ ":llvm_libc_types_clock_t",
+ ":llvm_libc_types_pid_t",
+ ":llvm_libc_types_uid_t",
+ ":llvm_libc_types_union_sigval",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_struct_sigaction",
+ hdrs = ["include/llvm-libc-types/struct_sigaction.h"],
+ deps = [
+ ":llvm_libc_types_siginfo_t",
+ ":llvm_libc_types_sigset_t",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_nfds_t",
+ hdrs = ["include/llvm-libc-types/nfds_t.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_struct_pollfd",
+ hdrs = ["include/llvm-libc-types/struct_pollfd.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_clock_t",
+ hdrs = ["include/llvm-libc-types/clock_t.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_suseconds_t",
+ hdrs = ["include/llvm-libc-types/suseconds_t.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_time_t",
+ hdrs = [
+ "include/llvm-libc-types/time_t.h",
+ "include/llvm-libc-types/time_t_64.h",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_struct_timeval",
+ hdrs = ["include/llvm-libc-types/struct_timeval.h"],
+ deps = [
+ ":llvm_libc_types_suseconds_t",
+ ":llvm_libc_types_time_t",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_struct_rusage",
+ hdrs = ["include/llvm-libc-types/struct_rusage.h"],
+ deps = [
+ ":llvm_libc_types_struct_timeval",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_wchar_t",
+ hdrs = ["include/llvm-libc-types/wchar_t.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_wint_t",
+ hdrs = ["include/llvm-libc-types/wint_t.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_FILE",
+ hdrs = ["include/llvm-libc-types/FILE.h"],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_char32_t",
+ hdrs = ["include/llvm-libc-types/char32_t.h"],
+ deps = [
+ ":llvm_libc_macros_stdint_macros",
+ ],
+)
+
+libc_support_library(
+ name = "llvm_libc_types_wctype_t",
+ hdrs = ["include/llvm-libc-types/wctype_t.h"],
+)
+
########################### Macro Proxy Header Files ###########################
libc_support_library(
@@ -459,12 +733,21 @@ libc_support_library(
libc_support_library(
name = "hdr_fcntl_macros",
hdrs = ["hdr/fcntl_macros.h"],
- deps = [":hdr_fcntl_overlay"],
+ deps = select({
+ ":full_build": [
+ ":llvm_libc_macros_fcntl_macros",
+ ],
+ "//conditions:default": [":hdr_fcntl_overlay"],
+ }),
)
libc_support_library(
name = "hdr_fcntl_overlay",
hdrs = ["hdr/fcntl_overlay.h"],
+ target_compatible_with = select({
+ ":full_build": ["@platforms//:incompatible"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
@@ -472,9 +755,37 @@ libc_support_library(
hdrs = ["hdr/netinet_in_macros.h"],
)
+libc_support_library(
+ name = "hdr_pthread_macros",
+ hdrs = ["hdr/pthread_macros.h"],
+ deps = select({
+ ":full_build": [
+ ":llvm_libc_macros_pthread_macros",
+ ],
+ "//conditions:default": [],
+ }),
+)
+
libc_support_library(
name = "hdr_signal_macros",
hdrs = ["hdr/signal_macros.h"],
+ deps = select({
+ ":full_build": [
+ ":llvm_libc_macros_signal_macros",
+ ],
+ "//conditions:default": [],
+ }),
+)
+
+libc_support_library(
+ name = "hdr_sched_macros",
+ hdrs = ["hdr/sched_macros.h"],
+ deps = select({
+ ":full_build": [
+ ":llvm_libc_macros_sched_macros",
+ ],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
@@ -529,9 +840,25 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "llvm_libc_macros_error_number_macros",
+ hdrs = [
+ "include/llvm-libc-macros/error-number-macros.h",
+ ] + select({
+ "@platforms//os:linux": ["include/llvm-libc-macros/linux/error-number-macros.h"],
+ "//conditions:default": [],
+ }),
+)
+
libc_support_library(
name = "hdr_errno_macros",
hdrs = ["hdr/errno_macros.h"],
+ deps = select({
+ "//libc:full_build": [
+ ":llvm_libc_macros_error_number_macros",
+ ],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
@@ -542,73 +869,122 @@ libc_support_library(
libc_support_library(
name = "hdr_float_macros",
hdrs = ["hdr/float_macros.h"],
+ deps = select({
+ "//libc:full_build": [
+ ":llvm_libc_macros_float_macros",
+ ],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "hdr_stdio_macros",
hdrs = ["hdr/stdio_macros.h"],
- deps = [
- ":hdr_stdio_overlay",
- ],
+ deps = select({
+ ":full_build": [
+ ":llvm_libc_macros_file_seek_macros",
+ ":llvm_libc_macros_stdio_macros",
+ ],
+ "//conditions:default": [
+ ":hdr_stdio_overlay",
+ ],
+ }),
)
libc_support_library(
name = "hdr_unistd_macros",
hdrs = ["hdr/unistd_macros.h"],
- deps = [
- ":hdr_unistd_overlay",
- ],
+ deps = select({
+ ":full_build": [
+ ":llvm_libc_macros_unistd_macros",
+ ],
+ "//conditions:default": [
+ ":hdr_unistd_overlay",
+ ],
+ }),
)
libc_support_library(
name = "hdr_limits_macros",
hdrs = ["hdr/limits_macros.h"],
+ deps = select({
+ "//libc:full_build": [
+ ":llvm_libc_macros_limits_macros",
+ ],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "hdr_stdio_overlay",
hdrs = ["hdr/stdio_overlay.h"],
+ target_compatible_with = select({
+ ":full_build": ["@platforms//:incompatible"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "hdr_stdlib_macros",
hdrs = ["hdr/stdlib_macros.h"],
- deps = [
- ":hdr_stdlib_overlay",
- ],
+ deps = select({
+ ":full_build": [],
+ "//conditions:default": [":hdr_stdlib_overlay"],
+ }),
)
libc_support_library(
name = "hdr_stdlib_overlay",
hdrs = ["hdr/stdlib_overlay.h"],
+ target_compatible_with = select({
+ ":full_build": ["@platforms//:incompatible"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "hdr_unistd_overlay",
hdrs = ["hdr/unistd_overlay.h"],
+ target_compatible_with = select({
+ ":full_build": ["@platforms//:incompatible"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "hdr_wchar_macros",
hdrs = ["hdr/wchar_macros.h"],
- deps = [
- ":hdr_wchar_overlay",
- ],
+ deps = select({
+ ":full_build": [":llvm_libc_macros_wchar_macros"],
+ "//conditions:default": [":hdr_wchar_overlay"],
+ }),
)
libc_support_library(
name = "hdr_wchar_overlay",
hdrs = ["hdr/wchar_overlay.h"],
+ target_compatible_with = select({
+ ":full_build": ["@platforms//:incompatible"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "hdr_uchar_overlay",
hdrs = ["hdr/uchar_overlay.h"],
+ target_compatible_with = select({
+ ":full_build": ["@platforms//:incompatible"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "hdr_wctype_overlay",
hdrs = ["hdr/wctype_overlay.h"],
+ target_compatible_with = select({
+ ":full_build": ["@platforms//:incompatible"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
@@ -626,9 +1002,30 @@ libc_support_library(
hdrs = ["hdr/sys_resource_macros.h"],
)
+libc_support_library(
+ name = "hdr_sys_wait_macros",
+ hdrs = ["hdr/sys_wait_macros.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_macros_sys_wait_macros"],
+ "//conditions:default": [],
+ }),
+)
+
libc_support_library(
name = "hdr_elf_proxy",
hdrs = ["hdr/elf_proxy.h"],
+ includes = [
+ "staging",
+ "staging/include",
+ ],
+ deps = [
+ ":include_llvm-libc-proxy_elf_proxy_h",
+ ],
+)
+
+libc_support_library(
+ name = "hdr_elf_macros",
+ hdrs = ["hdr/elf_macros.h"],
)
libc_support_library(
@@ -641,25 +1038,58 @@ libc_support_library(
libc_support_library(
name = "func_aligned_alloc",
hdrs = ["hdr/func/aligned_alloc.h"],
- deps = [":hdr_stdlib_overlay"],
+ deps = select({
+ ":full_build": [
+ ":__support_common",
+ ":types_size_t",
+ ],
+ "//conditions:default": [":hdr_stdlib_overlay"],
+ }),
)
libc_support_library(
name = "func_free",
hdrs = ["hdr/func/free.h"],
- deps = [":hdr_stdlib_overlay"],
+ deps = select({
+ ":full_build": [
+ ":__support_common",
+ ],
+ "//conditions:default": [":hdr_stdlib_overlay"],
+ }),
)
libc_support_library(
name = "func_malloc",
hdrs = ["hdr/func/malloc.h"],
- deps = [":hdr_stdlib_overlay"],
+ deps = select({
+ ":full_build": [
+ ":__support_common",
+ ":types_size_t",
+ ],
+ "//conditions:default": [":hdr_stdlib_overlay"],
+ }),
)
libc_support_library(
name = "func_realloc",
hdrs = ["hdr/func/realloc.h"],
- deps = [":hdr_stdlib_overlay"],
+ deps = select({
+ ":full_build": [
+ ":__support_common",
+ ":types_size_t",
+ ],
+ "//conditions:default": [":hdr_stdlib_overlay"],
+ }),
+)
+
+libc_support_library(
+ name = "types_atexithandler_t",
+ hdrs = ["hdr/types/atexithandler_t.h"],
+ # Only compatible with full build mode. atexit is not available in overlay mode.
+ target_compatible_with = select({
+ ":full_build": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
)
libc_support_library(
@@ -670,12 +1100,19 @@ libc_support_library(
libc_support_library(
name = "types_clock_t",
hdrs = ["hdr/types/clock_t.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_clock_t"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "types_div_t",
hdrs = ["hdr/types/div_t.h"],
- deps = [":hdr_stdlib_overlay"],
+ deps = select({
+ ":full_build": [],
+ "//conditions:default": [":hdr_stdlib_overlay"],
+ }),
)
libc_support_library(
@@ -691,24 +1128,88 @@ libc_support_library(
libc_support_library(
name = "types_ldiv_t",
hdrs = ["hdr/types/ldiv_t.h"],
- deps = [":hdr_stdlib_overlay"],
+ deps = select({
+ ":full_build": [],
+ "//conditions:default": [":hdr_stdlib_overlay"],
+ }),
)
libc_support_library(
name = "types_lldiv_t",
hdrs = ["hdr/types/lldiv_t.h"],
- deps = [":hdr_stdlib_overlay"],
+ deps = select({
+ ":full_build": [],
+ "//conditions:default": [":hdr_stdlib_overlay"],
+ }),
+)
+
+libc_support_library(
+ name = "hdr_types_struct_link_map",
+ hdrs = ["hdr/types/struct_link_map.h"],
+)
+
+libc_support_library(
+ name = "hdr_types_struct_r_debug",
+ hdrs = ["hdr/types/struct_r_debug.h"],
+)
+
+libc_support_library(
+ name = "hdr_types_struct_sched_param",
+ hdrs = ["hdr/types/struct_sched_param.h"],
)
libc_support_library(
name = "types_mode_t",
hdrs = ["hdr/types/mode_t.h"],
- deps = [":hdr_fcntl_overlay"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_mode_t"],
+ "//conditions:default": [":hdr_fcntl_overlay"],
+ }),
)
libc_support_library(
name = "types_sigset_t",
hdrs = ["hdr/types/sigset_t.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_sigset_t"],
+ "//conditions:default": [],
+ }),
+)
+
+libc_support_library(
+ name = "types_siginfo_t",
+ hdrs = ["hdr/types/siginfo_t.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_siginfo_t"],
+ "//conditions:default": [],
+ }),
+)
+
+libc_support_library(
+ name = "types_struct_sigaction",
+ hdrs = ["hdr/types/struct_sigaction.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_struct_sigaction"],
+ "//conditions:default": [],
+ }),
+)
+
+libc_support_library(
+ name = "types_nfds_t",
+ hdrs = ["hdr/types/nfds_t.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_nfds_t"],
+ "//conditions:default": [],
+ }),
+)
+
+libc_support_library(
+ name = "types_struct_pollfd",
+ hdrs = ["hdr/types/struct_pollfd.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_struct_pollfd"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
@@ -724,19 +1225,28 @@ libc_support_library(
libc_support_library(
name = "types_struct_f_owner_ex",
hdrs = ["hdr/types/struct_f_owner_ex.h"],
- deps = [":hdr_fcntl_overlay"],
+ deps = select({
+ ":full_build": [],
+ "//conditions:default": [":hdr_fcntl_overlay"],
+ }),
)
libc_support_library(
name = "types_struct_flock",
hdrs = ["hdr/types/struct_flock.h"],
- deps = [":hdr_fcntl_overlay"],
+ deps = select({
+ ":full_build": [],
+ "//conditions:default": [":hdr_fcntl_overlay"],
+ }),
)
libc_support_library(
name = "types_struct_flock64",
hdrs = ["hdr/types/struct_flock64.h"],
- deps = [":hdr_fcntl_overlay"],
+ deps = select({
+ ":full_build": [],
+ "//conditions:default": [":hdr_fcntl_overlay"],
+ }),
)
libc_support_library(
@@ -749,14 +1259,40 @@ libc_support_library(
hdrs = ["hdr/types/struct_timespec.h"],
)
+libc_support_library(
+ name = "types_suseconds_t",
+ hdrs = ["hdr/types/suseconds_t.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_suseconds_t"],
+ "//conditions:default": [],
+ }),
+)
+
libc_support_library(
name = "types_time_t",
hdrs = ["hdr/types/time_t.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_time_t"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "types_struct_timeval",
hdrs = ["hdr/types/struct_timeval.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_struct_timeval"],
+ "//conditions:default": [],
+ }),
+)
+
+libc_support_library(
+ name = "types_struct_rusage",
+ hdrs = ["hdr/types/struct_rusage.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_struct_rusage"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
@@ -772,27 +1308,37 @@ libc_support_library(
libc_support_library(
name = "types_pid_t",
hdrs = ["hdr/types/pid_t.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_pid_t"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "types_uid_t",
hdrs = ["hdr/types/uid_t.h"],
+ deps = select({
+ ":full_build": [":llvm_libc_types_uid_t"],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
name = "types_off_t",
hdrs = ["hdr/types/off_t.h"],
- deps = [
- ":hdr_stdio_overlay",
- ],
+ deps = select({
+ ":full_build": [":llvm_libc_types_off_t"],
+ "//conditions:default": [":hdr_stdio_overlay"],
+ }),
)
libc_support_library(
name = "types_FILE",
hdrs = ["hdr/types/FILE.h"],
- deps = [
- ":hdr_stdio_overlay",
- ],
+ deps = select({
+ ":full_build": [":llvm_libc_types_FILE"],
+ "//conditions:default": [":hdr_stdio_overlay"],
+ }),
)
libc_support_library(
@@ -879,33 +1425,37 @@ libc_support_library(
libc_support_library(
name = "types_wchar_t",
hdrs = ["hdr/types/wchar_t.h"],
- deps = [
- ":hdr_wchar_overlay",
- ],
+ deps = select({
+ ":full_build": [":llvm_libc_types_wchar_t"],
+ "//conditions:default": [":hdr_wchar_overlay"],
+ }),
)
libc_support_library(
name = "types_wctype_t",
hdrs = ["hdr/types/wctype_t.h"],
- deps = [
- ":hdr_wctype_overlay",
- ],
+ deps = select({
+ ":full_build": [":llvm_libc_types_wctype_t"],
+ "//conditions:default": [":hdr_wctype_overlay"],
+ }),
)
libc_support_library(
name = "types_wint_t",
hdrs = ["hdr/types/wint_t.h"],
- deps = [
- ":hdr_wchar_overlay",
- ],
+ deps = select({
+ ":full_build": [":llvm_libc_types_wint_t"],
+ "//conditions:default": [":hdr_wchar_overlay"],
+ }),
)
libc_support_library(
name = "types_char32_t",
hdrs = ["hdr/types/char32_t.h"],
- deps = [
- ":hdr_uchar_overlay",
- ],
+ deps = select({
+ ":full_build": [":llvm_libc_types_char32_t"],
+ "//conditions:default": [":hdr_uchar_overlay"],
+ }),
)
libc_support_library(
@@ -1131,6 +1681,14 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_cpp_mutex",
+ hdrs = ["src/__support/CPP/mutex.h"],
+ deps = [
+ ":__support_macros_config",
+ ],
+)
+
libc_support_library(
name = "__support_cpp_new",
srcs = ["src/__support/CPP/new.cpp"],
@@ -1499,13 +2057,21 @@ libc_support_library(
name = "__support_libc_assert",
hdrs = ["src/__support/libc_assert.h"],
deps = [
+ ":__support_common",
":__support_macros_attributes",
":__support_macros_config",
":__support_macros_hardening",
":__support_macros_macro_utils",
":__support_macros_optimization",
":__support_macros_properties_os",
- ],
+ ] + select({
+ "//libc:full_build": [
+ ":__support_integer_to_string",
+ ":__support_osutil_exit",
+ ":__support_osutil_io",
+ ],
+ "//conditions:default": [],
+ }),
)
libc_support_library(
@@ -1650,7 +2216,6 @@ libc_support_library(
":hdr_errno_macros",
":hdr_stdint_proxy",
":hdr_stdio_macros",
- ":hdr_stdio_overlay",
":hdr_wchar_macros",
":string_memory_utils",
":types_off_t",
@@ -1862,6 +2427,24 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_osutil_linux_syscall_wrappers_raise",
+ hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/raise.h"],
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_error_or",
+ ":__support_macros_config",
+ ":__support_osutil_linux_syscall_wrappers_rt_sigprocmask",
+ ":__support_osutil_syscall",
+ ":hdr_signal_macros",
+ ":types_sigset_t",
+ ],
+)
+
libc_support_library(
name = "__support_osutil_linux_syscall_wrappers_readlink",
hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/readlink.h"],
@@ -1963,6 +2546,73 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_osutil_linux_syscall_wrappers_rt_sigprocmask",
+ hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/rt_sigprocmask.h"],
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_error_or",
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ":types_sigset_t",
+ ],
+)
+
+libc_support_library(
+ name = "__support_osutil_linux_syscall_wrappers_sched_getparam",
+ hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/sched_getparam.h"],
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_error_or",
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ":hdr_types_struct_sched_param",
+ ":types_pid_t",
+ ],
+)
+
+libc_support_library(
+ name = "__support_osutil_linux_syscall_wrappers_sched_getscheduler",
+ hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/sched_getscheduler.h"],
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_error_or",
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ":hdr_types_struct_sched_param",
+ ":types_pid_t",
+ ],
+)
+
+libc_support_library(
+ name = "__support_osutil_linux_syscall_wrappers_sched_setscheduler",
+ hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/sched_setscheduler.h"],
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_error_or",
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ":hdr_types_struct_sched_param",
+ ":types_pid_t",
+ ],
+)
+
libc_support_library(
name = "__support_osutil_linux_syscall_wrappers_sendmsg",
hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/sendmsg.h"],
@@ -2129,8 +2779,6 @@ libc_support_library(
libc_support_library(
name = "__support_printf_core_printf_config",
hdrs = ["src/__support/printf_core/printf_config.h"],
- deps = [
- ],
)
libc_support_library(
@@ -2785,6 +3433,7 @@ libc_support_library(
"src/__support/OSUtil/linux/syscall.h",
"src/__support/OSUtil/linux/aarch64/syscall.h",
"src/__support/OSUtil/linux/x86_64/syscall.h",
+ "src/__support/OSUtil/linux/riscv/syscall.h",
],
"@platforms//os:macos": [
"src/__support/OSUtil/darwin/syscall.h",
@@ -2984,6 +3633,26 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_osutil_linux_syscall_wrappers_wait4",
+ hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/wait4.h"],
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_error_or",
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ":hdr_signal_macros",
+ ":hdr_sys_wait_macros",
+ ":types_pid_t",
+ ":types_siginfo_t",
+ ":types_struct_rusage",
+ ],
+)
+
libc_support_library(
name = "__support_osutil_linux_syscall_wrappers_mmap",
hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/mmap.h"],
@@ -3457,6 +4126,20 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_threads_thread_attributes",
+ hdrs = ["src/__support/threads/thread_attributes.h"],
+ deps = [
+ ":__support_common",
+ ":__support_cpp_atomic",
+ ":__support_macros_attributes",
+ ":__support_macros_config",
+ ":__support_macros_properties_architectures",
+ ":hdr_stdint_proxy",
+ ":types_size_t",
+ ],
+)
+
libc_support_library(
name = "__support_threads_futex_utils",
hdrs = ["src/__support/threads/futex_utils.h"],
@@ -3502,6 +4185,7 @@ libc_support_library(
deps = [
":__support_macros_optimization",
":__support_osutil_syscall",
+ ":__support_threads_thread_headers",
":types_pid_t",
],
)
@@ -3589,6 +4273,76 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_threads_thread_headers",
+ hdrs = ["src/__support/threads/thread.h"],
+ deps = [
+ ":__support_cpp_atomic",
+ ":__support_cpp_optional",
+ ":__support_cpp_string_view",
+ ":__support_cpp_stringstream",
+ ":__support_error_or",
+ ":__support_macros_attributes",
+ ":__support_macros_config",
+ ":__support_macros_properties_architectures",
+ ":__support_threads_thread_attributes",
+ ":hdr_stdint_proxy",
+ ":hdr_types_struct_sched_param",
+ ],
+)
+
+libc_support_library(
+ name = "__support_threads_thread",
+ srcs = select({
+ "@platforms//os:linux": [
+ "src/__support/threads/linux/thread.cpp",
+ "src/__support/threads/thread.cpp",
+ ],
+ "//conditions:default": [],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_cpp_array",
+ ":__support_cpp_atomic",
+ ":__support_cpp_mutex",
+ ":__support_cpp_optional",
+ ":__support_cpp_string_view",
+ ":__support_cpp_stringstream",
+ ":__support_fixedvector",
+ ":__support_libc_errno",
+ ":__support_macros_attributes",
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ":__support_threads_mutex",
+ ":__support_threads_thread_headers",
+ ":hdr_stdint_proxy",
+ ] + select({
+ "@platforms//os:linux": [
+ ":__support_error_or",
+ ":__support_osutil_linux_syscall_wrappers_close",
+ ":__support_osutil_linux_syscall_wrappers_mmap",
+ ":__support_osutil_linux_syscall_wrappers_mprotect",
+ ":__support_osutil_linux_syscall_wrappers_munmap",
+ ":__support_osutil_linux_syscall_wrappers_open",
+ ":__support_osutil_linux_syscall_wrappers_read",
+ ":__support_osutil_linux_syscall_wrappers_sched_getparam",
+ ":__support_osutil_linux_syscall_wrappers_sched_getscheduler",
+ ":__support_osutil_linux_syscall_wrappers_sched_setscheduler",
+ ":__support_osutil_linux_syscall_wrappers_write",
+ ":__support_threads_futex_utils",
+ ":__support_threads_linux_futex_utils",
+ ":__support_threads_linux_futex_word_type",
+ ":config_app_h",
+ ":errno",
+ ":hdr_errno_macros",
+ ":hdr_fcntl_macros",
+ ":hdr_sched_macros",
+ ":hdr_sys_mman_macros",
+ ],
+ "//conditions:default": [],
+ }),
+)
+
libc_support_library(
name = "__support_threads_callonce",
hdrs = ["src/__support/threads/callonce.h"],
@@ -3607,6 +4361,17 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_threads_fork_callbacks",
+ srcs = ["src/__support/threads/fork_callbacks.cpp"],
+ hdrs = ["src/__support/threads/fork_callbacks.h"],
+ deps = [
+ ":__support_cpp_mutex",
+ ":__support_macros_config",
+ ":__support_threads_mutex",
+ ],
+)
+
libc_support_library(
name = "__support_time",
hdrs = glob(["src/__support/time/*.h"]),
@@ -3764,6 +4529,12 @@ cc_library(
] + glob(["shared/math/**/*.h"]),
copts = libc_common_copts(),
includes = ["."],
+ target_compatible_with = select({
+ # Not full-build compatible.
+ # Full builds of LLVM-libc require some deps which are not header-only.
+ ":full_build": ["@platforms//:incompatible"],
+ "//conditions:default": [],
+ }),
deps = [
":__support_big_int",
":__support_common",
@@ -3847,6 +4618,26 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "program_invocation_name",
+ srcs = ["src/errno/program_invocation_name.cpp"],
+ hdrs = ["src/errno/program_invocation_name.h"],
+ deps = [
+ ":__support_common",
+ ":__support_macros_config",
+ ],
+)
+
+libc_support_library(
+ name = "program_invocation_short_name",
+ srcs = ["src/errno/program_invocation_short_name.cpp"],
+ hdrs = ["src/errno/program_invocation_short_name.h"],
+ deps = [
+ ":__support_common",
+ ":__support_macros_config",
+ ],
+)
+
############################### arpa/inet targets ##############################
libc_function(
@@ -10574,6 +11365,19 @@ libc_function(
],
)
+################################ link targets ##################################
+
+libc_function(
+ name = "_r_debug",
+ srcs = ["src/link/_r_debug.cpp"],
+ hdrs = ["src/link/_r_debug.h"],
+ deps = [
+ ":__support_common",
+ ":__support_macros_config",
+ ":hdr_types_struct_r_debug",
+ ],
+)
+
################################ math targets ##################################
libc_math_function(
@@ -14057,7 +14861,77 @@ bit_prefix_needs_math_list = [
for bit_suffix in bit_suffix_list
]
-############################### stdlib targets ###############################
+############################### stdlib targets ###############################
+
+libc_support_library(
+ name = "exit_handler",
+ hdrs = ["src/stdlib/exit_handler.h"],
+ # Full-build only, as overlay mode must use the host libc's cleanup.
+ target_compatible_with = select({
+ ":full_build": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_blockstore",
+ ":__support_common",
+ ":__support_cpp_mutex",
+ ":__support_cpp_new",
+ ":__support_fixedvector",
+ ":__support_macros_config",
+ ":__support_threads_mutex",
+ ],
+)
+
+libc_function(
+ name = "_Exit",
+ srcs = ["src/stdlib/_Exit.cpp"],
+ hdrs = ["src/stdlib/_Exit.h"],
+ # Full-build only, as overlay mode must use the host libc's cleanup.
+ target_compatible_with = select({
+ ":full_build": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_macros_config",
+ ":__support_osutil_exit",
+ ],
+)
+
+libc_function(
+ name = "atexit",
+ srcs = ["src/stdlib/atexit.cpp"],
+ hdrs = ["src/stdlib/atexit.h"],
+ # Full-build only, as overlay mode must use the host libc's cleanup.
+ target_compatible_with = select({
+ ":full_build": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_macros_attributes",
+ ":__support_macros_config",
+ ":exit_handler",
+ ":types_atexithandler_t",
+ ],
+)
+
+libc_function(
+ name = "exit",
+ srcs = ["src/stdlib/exit.cpp"],
+ hdrs = ["src/stdlib/exit.h"],
+ # Full-build only, as overlay mode must use the host libc's cleanup.
+ target_compatible_with = select({
+ ":full_build": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_macros_config",
+ ":__support_osutil_exit",
+ ":__support_threads_thread_headers",
+ ],
+)
libc_function(
name = "abs",
@@ -14191,6 +15065,90 @@ libc_function(
],
)
+libc_support_library(
+ name = "abort_utils",
+ hdrs = ["src/stdlib/abort_utils.h"],
+ # Full-build only, as overlay mode must use the host libc's cleanup.
+ target_compatible_with = select({
+ ":full_build": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ textual_hdrs = select({
+ "@platforms//os:linux": ["src/stdlib/linux/abort_utils.h"],
+ "//conditions:default": [],
+ }),
+ deps = [
+ ":__support_common",
+ ":__support_macros_config",
+ ":__support_macros_properties_architectures",
+ ] + select({
+ "@platforms//os:linux": [
+ ":__signal_utils",
+ ":__support_osutil_exit",
+ ":__support_osutil_linux_syscall_wrappers_raise",
+ ":types_sigset_t",
+ ":types_struct_sigaction",
+ ],
+ "//conditions:default": [],
+ }),
+)
+
+libc_function(
+ name = "abort",
+ srcs = ["src/stdlib/abort.cpp"],
+ hdrs = ["src/stdlib/abort.h"],
+ # Full-build only, as overlay mode must use the host libc's abort.
+ target_compatible_with = select({
+ ":full_build": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_macros_config",
+ ":abort_utils",
+ ],
+)
+
+libc_support_library(
+ name = "environ_internal",
+ srcs = ["src/stdlib/environ_internal.cpp"],
+ hdrs = ["src/stdlib/environ_internal.h"],
+ deps = [
+ ":__support_alloc_checker",
+ ":__support_common",
+ ":__support_cpp_new",
+ ":__support_cpp_optional",
+ ":__support_cpp_string_view",
+ ":__support_macros_attributes",
+ ":__support_macros_config",
+ ":config_app_h",
+ ":environ",
+ ":string_memory_utils",
+ ":types_size_t",
+ ],
+)
+
+libc_function(
+ name = "getenv",
+ srcs = ["src/stdlib/getenv.cpp"],
+ hdrs = ["src/stdlib/getenv.h"],
+ deps = [
+ ":__support_common",
+ ":__support_macros_config",
+ ":environ_internal",
+ ],
+)
+
+libc_support_library(
+ name = "__stack_chk_fail",
+ srcs = ["src/compiler/generic/__stack_chk_fail.cpp"],
+ hdrs = ["src/compiler/__stack_chk_fail.h"],
+ deps = [
+ ":__support_osutil_io",
+ ":abort_utils",
+ ":hdr_stdint_proxy",
+ ],
+)
+
libc_support_library(
name = "qsort_util",
hdrs = [
@@ -14760,6 +15718,17 @@ libc_function(
],
)
+libc_function(
+ name = "strsignal",
+ srcs = ["src/string/strsignal.cpp"],
+ hdrs = ["src/string/strsignal.h"],
+ deps = [
+ ":__support_common",
+ ":__support_macros_config",
+ ":__support_stringutil",
+ ],
+)
+
libc_function(
name = "strcpy",
srcs = ["src/string/strcpy.cpp"],
@@ -15115,6 +16084,23 @@ libc_function(
],
)
+################################ time targets ##################################
+
+libc_function(
+ name = "clock",
+ srcs = ["src/time/linux/clock.cpp"],
+ hdrs = ["src/time/clock.h"],
+ deps = [
+ ":__support_common",
+ ":__support_cpp_limits",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":__support_time",
+ ":__support_time_clock_gettime",
+ ":hdr_time_macros",
+ ":types_clock_t",
+ ],
+)
################################ unistd targets ################################
libc_function(
@@ -15336,6 +16322,112 @@ libc_function(
],
)
+libc_function(
+ name = "fork",
+ srcs = ["src/unistd/linux/fork.cpp"],
+ hdrs = ["src/unistd/fork.h"],
+ deps = [
+ ":__support_common",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ":__support_threads_fork_callbacks",
+ ":__support_threads_identifier",
+ ":__support_threads_thread",
+ ":__support_threads_thread_headers",
+ ":errno",
+ ":hdr_signal_macros",
+ ":hdr_unistd_macros",
+ ":types_pid_t",
+ ],
+)
+
+libc_function(
+ name = "poll",
+ srcs = ["src/poll/linux/poll.cpp"],
+ hdrs = ["src/poll/poll.h"],
+ deps = [
+ ":__support_common",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ":types_nfds_t",
+ ":types_struct_pollfd",
+ ":types_struct_timespec",
+ ],
+)
+
+libc_support_library(
+ name = "__restore_rt",
+ srcs = ["src/signal/linux/__restore.cpp"],
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ],
+)
+
+libc_support_library(
+ name = "__signal_utils",
+ hdrs = ["src/signal/linux/signal_utils.h"],
+ # Only compatible with full build mode on Linux. Overlay mode has header
+ # conflicts with system headers (e.g. sa_handler macro in glibc).
+ target_compatible_with = select({
+ ":full_build_linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__restore_rt",
+ ":__support_common",
+ ":__support_error_or",
+ ":__support_macros_config",
+ ":__support_osutil_linux_syscall_wrappers_rt_sigprocmask",
+ ":__support_osutil_syscall",
+ ":__support_osutil_vdso",
+ ":__support_threads_raw_rwlock",
+ ":hdr_signal_macros",
+ ":types_siginfo_t",
+ ":types_sigset_t",
+ ":types_size_t",
+ ":types_struct_sigaction",
+ ],
+)
+
+libc_function(
+ name = "kill",
+ srcs = ["src/signal/linux/kill.cpp"],
+ hdrs = ["src/signal/kill.h"],
+ deps = [
+ ":__support_common",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":__support_osutil_syscall",
+ ":types_pid_t",
+ ],
+)
+
+libc_function(
+ name = "waitpid",
+ srcs = ["src/sys/wait/linux/waitpid.cpp"],
+ hdrs = ["src/sys/wait/waitpid.h"],
+ deps = [
+ ":__support_common",
+ ":__support_libc_assert",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":__support_osutil_linux_syscall_wrappers_wait4",
+ ":errno",
+ ":hdr_signal_macros",
+ ":hdr_sys_wait_macros",
+ ":types_pid_t",
+ ":types_siginfo_t",
+ ":types_struct_rusage",
+ ],
+)
+
libc_function(
name = "getuid",
srcs = ["src/unistd/linux/getuid.cpp"],
@@ -15742,6 +16834,113 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "stderr",
+ srcs = ["src/stdio/linux/stderr.cpp"],
+ hdrs = ["src/stdio/stderr.h"],
+ deps = [
+ ":__support_common",
+ ":__support_file_platform_file",
+ ":__support_macros_config",
+ ":types_FILE",
+ ],
+)
+
+libc_function(
+ name = "fflush",
+ srcs = ["src/stdio/generic/fflush.cpp"],
+ hdrs = ["src/stdio/fflush.h"],
+ deps = [
+ ":__support_common",
+ ":__support_file_file",
+ ":__support_file_platform_file",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":errno",
+ ":stderr",
+ ":stdin",
+ ":stdout",
+ ":types_FILE",
+ ],
+)
+
+libc_function(
+ name = "fclose",
+ srcs = ["src/stdio/generic/fclose.cpp"],
+ hdrs = ["src/stdio/fclose.h"],
+ deps = [
+ ":__support_file_file",
+ ":__support_file_platform_file",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":types_FILE",
+ ],
+)
+
+libc_function(
+ name = "fopen",
+ srcs = ["src/stdio/generic/fopen.cpp"],
+ hdrs = ["src/stdio/fopen.h"],
+ deps = [
+ ":__support_file_file",
+ ":__support_file_platform_file",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":__support_macros_null_check",
+ ":types_FILE",
+ ],
+)
+
+libc_function(
+ name = "fread",
+ srcs = ["src/stdio/generic/fread.cpp"],
+ hdrs = ["src/stdio/fread.h"],
+ deps = [
+ ":__support_file_file",
+ ":__support_file_platform_file",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":types_FILE",
+ ],
+)
+
+libc_function(
+ name = "fwrite",
+ srcs = ["src/stdio/generic/fwrite.cpp"],
+ hdrs = ["src/stdio/fwrite.h"],
+ deps = [
+ ":__support_file_file",
+ ":__support_file_platform_file",
+ ":__support_libc_errno",
+ ":__support_macros_config",
+ ":types_FILE",
+ ],
+)
+
+libc_function(
+ name = "feof",
+ srcs = ["src/stdio/generic/feof.cpp"],
+ hdrs = ["src/stdio/feof.h"],
+ deps = [
+ ":__support_file_file",
+ ":__support_file_platform_file",
+ ":__support_macros_config",
+ ":types_FILE",
+ ],
+)
+
+libc_function(
+ name = "ferror",
+ srcs = ["src/stdio/generic/ferror.cpp"],
+ hdrs = ["src/stdio/ferror.h"],
+ deps = [
+ ":__support_file_file",
+ ":__support_file_platform_file",
+ ":__support_macros_config",
+ ":types_FILE",
+ ],
+)
+
libc_function(
name = "asprintf",
srcs = ["src/stdio/asprintf.cpp"],
@@ -16114,8 +17313,6 @@ libc_function(
":errno",
":hdr_errno_macros",
":hdr_fcntl_macros",
- ":hdr_stdio_overlay",
- ":types_FILE",
],
)
More information about the llvm-branch-commits
mailing list