Skip to content

Commit 0e417a7

Browse files
authored
[bazel] Add rules for clang-fuzzer protobuf-related libraries (#123126)
Also bumped up bazel_skylib to the latest version because the proto rules were complaining about a missing feature.
1 parent d2d531e commit 0e417a7

File tree

2 files changed

+29
-5
lines changed

2 files changed

+29
-5
lines changed

utils/bazel/WORKSPACE

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
66
load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")
77

8-
SKYLIB_VERSION = "1.3.0"
8+
SKYLIB_VERSION = "1.7.1"
99

1010
http_archive(
1111
name = "bazel_skylib",
12-
sha256 = "74d544d96f4a5bb630d465ca8bbcfe231e3594e5aae57e1edbf17a6eb3ca2506",
12+
sha256 = "bc283cdfcd526a52c3201279cda4bc298652efa898b10b4db0837dc51652756f",
1313
urls = [
1414
"https://mirror.bazel.build/github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = SKYLIB_VERSION),
1515
"https://github.com/bazelbuild/bazel-skylib/releases/download/{version}/bazel-skylib-{version}.tar.gz".format(version = SKYLIB_VERSION),
@@ -18,9 +18,9 @@ http_archive(
1818

1919
http_archive(
2020
name = "rules_cc",
21-
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.17/rules_cc-0.0.17.tar.gz"],
2221
sha256 = "abc605dd850f813bb37004b77db20106a19311a96b2da1c92b789da529d28fe1",
2322
strip_prefix = "rules_cc-0.0.17",
23+
urls = ["https://github.com/bazelbuild/rules_cc/releases/download/0.0.17/rules_cc-0.0.17.tar.gz"],
2424
)
2525

2626
new_local_repository(
@@ -158,9 +158,9 @@ maybe(
158158
maybe(
159159
http_archive,
160160
name = "robin_map",
161-
strip_prefix = "robin-map-1.3.0",
162-
sha256 = "a8424ad3b0affd4c57ed26f0f3d8a29604f0e1f2ef2089f497f614b1c94c7236",
163161
build_file = "@llvm-raw//utils/bazel/third_party_build:robin_map.BUILD",
162+
sha256 = "a8424ad3b0affd4c57ed26f0f3d8a29604f0e1f2ef2089f497f614b1c94c7236",
163+
strip_prefix = "robin-map-1.3.0",
164164
url = "https://github.com/Tessil/robin-map/archive/refs/tags/v1.3.0.tar.gz",
165165
)
166166

utils/bazel/llvm-project-overlay/clang/BUILD.bazel

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2758,6 +2758,30 @@ cc_library(
27582758
],
27592759
)
27602760

2761+
proto_library(
2762+
name = "cxx-proto",
2763+
srcs = ["tools/clang-fuzzer/cxx_proto.proto"],
2764+
)
2765+
2766+
cc_proto_library(
2767+
name = "cxx_cc_proto",
2768+
deps = [":cxx-proto"],
2769+
)
2770+
2771+
cc_library(
2772+
name = "proto-to-cxx-lib",
2773+
srcs = ["tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.cpp"],
2774+
hdrs = ["tools/clang-fuzzer/proto-to-cxx/proto_to_cxx.h"],
2775+
includes = ["tools/clang-fuzzer"],
2776+
deps = [":cxx_cc_proto"],
2777+
)
2778+
2779+
cc_binary(
2780+
name = "clang-proto-to-cxx",
2781+
srcs = ["tools/clang-fuzzer/proto-to-cxx/proto_to_cxx_main.cpp"],
2782+
deps = [":proto-to-cxx-lib"],
2783+
)
2784+
27612785
cc_library(
27622786
name = "clang-fuzzer-initialize",
27632787
srcs = ["tools/clang-fuzzer/fuzzer-initialize/fuzzer_initialize.cpp"],

0 commit comments

Comments
 (0)