[llvm] [libc][bazel] Enable epoll_pwait2 on bazel (PR #108254)
Michael Jones via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 11 10:23:43 PDT 2024
https://github.com/michaelrj-google created https://github.com/llvm/llvm-project/pull/108254
The wrapper for epoll_pwait2 has been difficult to enable since it
requires a very new version of the linux kernel (5.11). On cmake we
still need to create a mechanism to check if we can build it, but our
current bazel users are all on a new enough kernel version we can just
enable it.
>From 18c2ff031ddb531857992ccc37519d8c3dc1c04b Mon Sep 17 00:00:00 2001
From: Michael Jones <michaelrj at google.com>
Date: Wed, 11 Sep 2024 10:18:05 -0700
Subject: [PATCH] [libc][bazel] Enable epoll_pwait2 on bazel
The wrapper for epoll_pwait2 has been difficult to enable since it
requires a very new version of the linux kernel (5.11). On cmake we
still need to create a mechanism to check if we can build it, but our
current bazel users are all on a new enough kernel version we can just
enable it.
---
.../llvm-project-overlay/libc/BUILD.bazel | 42 +++++++++----------
.../libc/test/src/sys/epoll/BUILD.bazel | 34 +++++++--------
2 files changed, 36 insertions(+), 40 deletions(-)
diff --git a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
index f3d3c745246af8..0746bf5c1eff1c 100644
--- a/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/BUILD.bazel
@@ -4126,25 +4126,23 @@ libc_function(
],
)
-#TODO: Enable once epoll_pwait2 availablilty can be checked first.
-# https://github.com/llvm/llvm-project/issues/80060
-# libc_function(
-# name = "epoll_pwait2",
-# srcs = ["src/sys/epoll/linux/epoll_pwait2.cpp"],
-# hdrs = ["src/sys/epoll/epoll_pwait2.h"],
-# target_compatible_with = select({
-# "@platforms//os:linux": [],
-# "//conditions:default": ["@platforms//:incompatible"],
-# }),
-# weak = True,
-# deps = [
-# ":__support_macros_sanitizer",
-# ":__support_osutil_syscall",
-# ":errno",
-# ":hdr_signal_macros",
-# ":hdr_sys_epoll_macros",
-# ":types_sigset_t",
-# ":types_struct_epoll_event",
-# ":types_struct_timespec",
-# ],
-# )
+libc_function(
+ name = "epoll_pwait2",
+ srcs = ["src/sys/epoll/linux/epoll_pwait2.cpp"],
+ hdrs = ["src/sys/epoll/epoll_pwait2.h"],
+ target_compatible_with = select({
+ "@platforms//os:linux": [],
+ "//conditions:default": ["@platforms//:incompatible"],
+ }),
+ weak = True,
+ deps = [
+ ":__support_macros_sanitizer",
+ ":__support_osutil_syscall",
+ ":errno",
+ ":hdr_signal_macros",
+ ":hdr_sys_epoll_macros",
+ ":types_sigset_t",
+ ":types_struct_epoll_event",
+ ":types_struct_timespec",
+ ],
+)
diff --git a/utils/bazel/llvm-project-overlay/libc/test/src/sys/epoll/BUILD.bazel b/utils/bazel/llvm-project-overlay/libc/test/src/sys/epoll/BUILD.bazel
index b090bde35b88d6..7fb50403682a74 100644
--- a/utils/bazel/llvm-project-overlay/libc/test/src/sys/epoll/BUILD.bazel
+++ b/utils/bazel/llvm-project-overlay/libc/test/src/sys/epoll/BUILD.bazel
@@ -78,21 +78,19 @@ libc_test(
],
)
-#TODO: Enable once epoll_pwait2 availablilty can be checked first.
-# https://github.com/llvm/llvm-project/issues/80060
-# libc_test(
-# name = "epoll_pwait2_test",
-# srcs = ["linux/epoll_pwait2_test.cpp"],
-# libc_function_deps = [
-# "//libc:epoll_pwait2",
-# "//libc:epoll_create1",
-# "//libc:epoll_ctl",
-# "//libc:pipe",
-# "//libc:close",
-# ],
-# deps = [
-# "//libc:hdr_sys_epoll_macros",
-# "//libc:types_struct_epoll_event",
-# "//libc:types_struct_timespec",
-# ],
-# )
+libc_test(
+ name = "epoll_pwait2_test",
+ srcs = ["linux/epoll_pwait2_test.cpp"],
+ libc_function_deps = [
+ "//libc:epoll_pwait2",
+ "//libc:epoll_create1",
+ "//libc:epoll_ctl",
+ "//libc:pipe",
+ "//libc:close",
+ ],
+ deps = [
+ "//libc:hdr_sys_epoll_macros",
+ "//libc:types_struct_epoll_event",
+ "//libc:types_struct_timespec",
+ ],
+)
More information about the llvm-commits
mailing list