diff --git a/BUILD.bazel b/BUILD.bazel
index d33c9ea4c892..2aae10dc446c 100644
--- a/BUILD.bazel
+++ b/BUILD.bazel
@@ -1851,6 +1851,142 @@ cc_binary_with_abi(
],
)
+cc_binary_with_abi(
+ name = "kselftest_x86_single_step_syscall",
+ srcs = [
+ "tools/testing/selftests/x86/helpers.h",
+ "tools/testing/selftests/x86/single_step_syscall.c",
+ ],
+ abis = ["x86_64"],
+ copts = [
+ "-std=gnu99",
+ "-O2",
+ "-pthread",
+ ],
+ includes = ["tools/testing/selftests"],
+ linkopts = ["-static"],
+ path_prefix = _KSELFTEST_DIR,
+ target_compatible_with = ["@platforms//os:android"],
+ visibility = ["//visibility:private"],
+ deps = [
+ ":kselftest_headers_lib",
+ ],
+)
+
+cc_binary_with_abi(
+ name = "kselftest_x86_syscall_nt",
+ srcs = [
+ "tools/testing/selftests/x86/helpers.h",
+ "tools/testing/selftests/x86/syscall_nt.c",
+ ],
+ abis = ["x86_64"],
+ copts = [
+ "-std=gnu99",
+ "-O2",
+ "-pthread",
+ ],
+ includes = ["tools/testing/selftests"],
+ linkopts = ["-static"],
+ path_prefix = _KSELFTEST_DIR,
+ target_compatible_with = ["@platforms//os:android"],
+ visibility = ["//visibility:private"],
+ deps = [
+ ":kselftest_headers_lib",
+ ],
+)
+
+cc_binary_with_abi(
+ name = "kselftest_x86_ptrace_syscall",
+ srcs = [
+ "tools/testing/selftests/x86/helpers.h",
+ "tools/testing/selftests/x86/ptrace_syscall.c",
+ ],
+ abis = ["x86_64"],
+ copts = [
+ "-std=gnu99",
+ "-O2",
+ "-pthread",
+ ],
+ includes = ["tools/testing/selftests"],
+ linkopts = ["-static"],
+ path_prefix = _KSELFTEST_DIR,
+ target_compatible_with = ["@platforms//os:android"],
+ visibility = ["//visibility:private"],
+ deps = [
+ ":kselftest_headers_lib",
+ ],
+)
+
+cc_binary_with_abi(
+ name = "kselftest_x86_test_mremap_vdso",
+ srcs = [
+ "tools/testing/selftests/x86/helpers.h",
+ "tools/testing/selftests/x86/test_mremap_vdso.c",
+ ],
+ abis = ["x86_64"],
+ copts = [
+ "-std=gnu99",
+ "-O2",
+ "-pthread",
+ ],
+ includes = ["tools/testing/selftests"],
+ linkopts = ["-static"],
+ path_prefix = _KSELFTEST_DIR,
+ target_compatible_with = ["@platforms//os:android"],
+ visibility = ["//visibility:private"],
+ deps = [
+ ":kselftest_headers_lib",
+ ],
+)
+
+cc_binary_with_abi(
+ name = "kselftest_x86_check_initial_reg_state",
+ srcs = [
+ "tools/testing/selftests/x86/check_initial_reg_state.c",
+ "tools/testing/selftests/x86/helpers.h",
+ ],
+ abis = ["x86_64"],
+ copts = [
+ "-std=gnu99",
+ "-O2",
+ "-pthread",
+ ],
+ includes = ["tools/testing/selftests"],
+ linkopts = [
+ "-static",
+ "-Wl",
+ "-ereal_start",
+ ],
+ path_prefix = _KSELFTEST_DIR,
+ target_compatible_with = ["@platforms//os:android"],
+ visibility = ["//visibility:private"],
+ deps = [
+ ":kselftest_headers_lib",
+ ],
+)
+
+cc_binary_with_abi(
+ name = "kselftest_x86_ldt_gdt",
+ srcs = [
+ "tools/testing/selftests/x86/helpers.h",
+ "tools/testing/selftests/x86/ldt_gdt.c",
+ ],
+ abis = ["x86_64"],
+ copts = [
+ "-std=gnu99",
+ "-O2",
+ "-pthread",
+ ],
+ includes = ["tools/testing/selftests"],
+ linkopts = ["-static"],
+ path_prefix = _KSELFTEST_DIR,
+ target_compatible_with = ["@platforms//os:android"],
+ visibility = ["//visibility:private"],
+ deps = [
+ ":kselftest_headers_lib",
+ ],
+)
+
copy_file(
name = "kselftest_gen_config",
src = select({
@@ -1921,6 +2057,12 @@ android_filegroup(
":kselftest_vdso_vdso_test_clock_getres_x86_64",
":kselftest_vdso_vdso_test_getcpu_x86_64",
":kselftest_vdso_vdso_test_gettimeofday_x86_64",
+ ":kselftest_x86_check_initial_reg_state_x86_64",
+ ":kselftest_x86_ldt_gdt_x86_64",
+ ":kselftest_x86_ptrace_syscall_x86_64",
+ ":kselftest_x86_single_step_syscall_x86_64",
+ ":kselftest_x86_syscall_nt_x86_64",
+ ":kselftest_x86_test_mremap_vdso_x86_64",
],
cpu = "x86_64",
visibility = ["//visibility:private"],
diff --git a/tools/testing/selftests/android/config_x86_64.xml b/tools/testing/selftests/android/config_x86_64.xml
index 78881d7fc47d..5c83b430079e 100644
--- a/tools/testing/selftests/android/config_x86_64.xml
+++ b/tools/testing/selftests/android/config_x86_64.xml
@@ -85,5 +85,11 @@ SPDX-License-Identifier: GPL-2.0 OR Apache-2.0
+
+
+
+
+
+