From 2c9527d988d2f5935b9406511104819463c37662 Mon Sep 17 00:00:00 2001
From: P K <pk19604014@gmail.com>
Date: Mon, 11 Jul 2022 17:32:57 -0400
Subject: [PATCH] Added Bazel build for compiler-rt/fuzzer

---
 .../compiler-rt/BUILD.bazel                    | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 compiler-rt/BUILD.bazel

diff --git a/compiler-rt/BUILD.bazel b/compiler-rt/BUILD.bazel
new file mode 100644
index 000000000000..c6796b24a8e1
--- /dev/null
+++ b/compiler-rt/BUILD.bazel
@@ -0,0 +1,18 @@
+package(default_visibility = ["//visibility:public"])
+
+cc_library(
+    name = "FuzzerMain",
+    srcs = glob(
+        ["lib/fuzzer/Fuzzer*.cpp"],
+    ),
+    hdrs = glob([
+        "lib/fuzzer/Fuzzer*.h",
+        "lib/fuzzer/Fuzzer*.def",
+    ]),
+    copts = [
+      # Not using no-sanitize=address per https://github.com/google/sanitizers/wiki/AddressSanitizerContainerOverflow#false-positives
+      "-fno-sanitize=memory,thread,undefined",
+      "-fsanitize-coverage=0",
+    ],
+    includes = ["lib/fuzzer"],
+)
--
2.37.0.144.g8ac04bfd2-goog
