[llvm-branch-commits] [llvm] [bazel] Port 4faf0ae, 15cff90, 9028ff14, 4057f8e4 (PR #226853)
Jackson Stogel via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Sun Sep 27 17:14:47 PDT 2026
https://github.com/jtstogel created https://github.com/llvm/llvm-project/pull/226853
None
>From 6e671d17e5cc3324ff0fa10c8cca9ba53f63b2e1 Mon Sep 17 00:00:00 2001
From: jtstogel <jtstogel at gmail.com>
Date: Thu, 24 Sep 2026 21:42:11 -0700
Subject: [PATCH] [bazel] Port 4faf0ae, 15cff90, 9028ff14, 4057f8e4
---
.../llvm-project-overlay/libc/BUILD.bazel | 80 ++++++++++++++++++-
.../libc/startup/linux/BUILD.bazel | 4 +-
.../libc/startup/linux/x86_64/BUILD.bazel | 15 ----
3 files changed, 78 insertions(+), 21 deletions(-)
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index 53953e041f76d..72a3e709e4af4 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -3684,6 +3684,29 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_osutil_linux_syscall_wrappers_clone",
+ hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/clone.h"],
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ textual_hdrs = [
+ "src/__support/OSUtil/linux/syscall_wrappers/aarch64/clone.h",
+ "src/__support/OSUtil/linux/syscall_wrappers/riscv/clone.h",
+ "src/__support/OSUtil/linux/syscall_wrappers/x86_64/clone.h",
+ ],
+ deps = [
+ ":__support_common",
+ ":__support_error_or",
+ ":__support_libc_assert",
+ ":__support_macros_config",
+ ":__support_macros_properties_architectures",
+ ":hdr_stdint_proxy",
+ ":types_pid_t",
+ ],
+)
+
libc_support_library(
name = "__support_osutil_linux_syscall_wrappers_close",
hdrs = ["src/__support/OSUtil/linux/syscall_wrappers/close.h"],
@@ -4227,6 +4250,21 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_threads_cleanup_stack",
+ hdrs = ["src/__support/threads/cleanup_stack.h"],
+ full_build_only = True,
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_macros_attributes",
+ ":__support_macros_config",
+ ":types_struct___pthread_cleanup_frame",
+ ],
+)
+
libc_support_library(
name = "__support_threads_linux_futex_word_type",
hdrs = ["src/__support/threads/linux/futex_word.h"],
@@ -4255,6 +4293,7 @@ libc_support_library(
":__support_macros_attributes",
":__support_macros_config",
":__support_macros_properties_architectures",
+ ":__support_threads_cleanup_stack",
":hdr_stdint_proxy",
":types_size_t",
":types_struct___pthread_cleanup_frame",
@@ -4465,8 +4504,10 @@ libc_support_library(
":__support_fixedvector",
":__support_macros_attributes",
":__support_macros_config",
+ ":__support_threads_cleanup_stack",
":__support_threads_mutex",
":__support_threads_thread_headers",
+ ":types_struct___pthread_cleanup_frame",
] + select({
"@platforms//os:linux": [":__support_threads_linux_thread"],
"//conditions:default": [],
@@ -4476,10 +4517,6 @@ libc_support_library(
libc_support_library(
name = "__support_threads_linux_thread",
srcs = ["src/__support/threads/linux/thread.cpp"],
- copts = [
- "-fno-omit-frame-pointer",
- "-Wno-frame-address",
- ],
full_build_only = True,
target_compatible_with = select({
"@platforms//os:linux": [],
@@ -4498,6 +4535,7 @@ libc_support_library(
":__support_libc_errno",
":__support_macros_attributes",
":__support_macros_config",
+ ":__support_osutil_linux_syscall_wrappers_clone",
":__support_osutil_linux_syscall_wrappers_close",
":__support_osutil_linux_syscall_wrappers_getpid",
":__support_osutil_linux_syscall_wrappers_mmap",
@@ -4514,6 +4552,7 @@ libc_support_library(
":__support_threads_futex_utils",
":__support_threads_linux_futex_utils",
":__support_threads_linux_futex_word_type",
+ ":__support_threads_linux_tls",
":__support_threads_mutex",
":__support_threads_thread_attributes",
":__support_threads_thread_headers",
@@ -4527,6 +4566,39 @@ libc_support_library(
],
)
+libc_support_library(
+ name = "__support_threads_linux_tls",
+ srcs = selects.with_or({
+ PLATFORM_CPU_X86_64: ["src/__support/threads/linux/x86_64/tls.cpp"],
+ PLATFORM_CPU_ARM64: ["src/__support/threads/linux/aarch64/tls.cpp"],
+ PLATFORM_CPU_RISCV64: ["src/__support/threads/linux/riscv/tls.cpp"],
+ "//conditions:default": [],
+ }),
+ copts = [
+ "-ffreestanding",
+ "-fno-builtin",
+ "-fno-omit-frame-pointer",
+ "-fno-stack-protector",
+ "-O3",
+ ],
+ full_build_only = True,
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ deps = [
+ ":__support_macros_config",
+ ":__support_osutil_linux_syscall_wrappers_getrandom",
+ ":__support_osutil_linux_syscall_wrappers_mmap",
+ ":__support_osutil_linux_syscall_wrappers_munmap",
+ ":__support_osutil_syscall",
+ ":__support_threads_tcb",
+ ":config_app_h",
+ ":hdr_sys_mman_macros",
+ ":string_memory_utils",
+ ],
+)
+
libc_support_library(
name = "__support_threads_callonce",
hdrs = ["src/__support/threads/callonce.h"],
diff --git a/utils/bazel/llvm-project-overlay/libc/startup/linux/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/startup/linux/BUILD.bazel
index e8f76f330f49b..e80f253ecb88a 100644
--- a/utils/bazel/llvm-project-overlay/libc/startup/linux/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/startup/linux/BUILD.bazel
@@ -54,6 +54,8 @@ libc_startup_library(
"//libc:__support_macros_config",
"//libc:__support_osutil_linux_auxv",
"//libc:__support_osutil_syscall",
+ "//libc:__support_threads_linux_futex_utils",
+ "//libc:__support_threads_linux_tls",
"//libc:__support_threads_tcb",
"//libc:__support_threads_thread",
"//libc:__support_threads_thread_headers",
@@ -76,7 +78,6 @@ libc_startup_library(
] + selects.with_or({
PLATFORM_CPU_X86_64: [
"//libc/startup/linux/x86_64:irelative",
- "//libc/startup/linux/x86_64:tls",
],
"//conditions:default": [],
}),
@@ -91,7 +92,6 @@ merge_relocatable_object(
PLATFORM_CPU_X86_64: [
"//libc/startup/linux/x86_64:irelative",
"//libc/startup/linux/x86_64:start",
- "//libc/startup/linux/x86_64:tls",
],
"//conditions:default": [],
}),
diff --git a/utils/bazel/llvm-project-overlay/libc/startup/linux/x86_64/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/startup/linux/x86_64/BUILD.bazel
index db07f7b62a2e7..4ecc22e92072c 100644
--- a/utils/bazel/llvm-project-overlay/libc/startup/linux/x86_64/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/startup/linux/x86_64/BUILD.bazel
@@ -13,21 +13,6 @@ package(
],
)
-libc_startup_library(
- name = "tls",
- srcs = ["tls.cpp"],
- deps = [
- "//libc:__support_macros_config",
- "//libc:__support_osutil_linux_syscall_wrappers_getrandom",
- "//libc:__support_osutil_linux_syscall_wrappers_mmap",
- "//libc:__support_osutil_linux_syscall_wrappers_munmap",
- "//libc:__support_threads_tcb",
- "//libc:config_app_h",
- "//libc:hdr_sys_mman_macros",
- "//libc:string_memory_utils",
- ],
-)
-
libc_startup_library(
name = "start",
srcs = ["start.cpp"],
More information about the llvm-branch-commits
mailing list