Add missing files

This commit is contained in:
Mihai Maruseac 2021-02-09 12:50:12 -08:00
parent fb3d8d64d8
commit 4e4684cf87
3 changed files with 39 additions and 0 deletions

23
tensorflow/setup_llvm.bzl Normal file
View File

@ -0,0 +1,23 @@
"""TensorFlow workspace initialization. Consult the WORKSPACE on how to use it."""
load("@llvm-bazel//:terminfo.bzl", "llvm_terminfo_disable")
load("@llvm-bazel//:zlib.bzl", "llvm_zlib_disable")
load("@llvm-bazel//:configure.bzl", "llvm_configure")
def setup_llvm():
# Disable terminfo and zlib that are bundled with LLVM
llvm_terminfo_disable(
name = "llvm_terminfo",
)
llvm_zlib_disable(
name = "llvm_zlib",
)
# Now that all LLVM settings are loaded, configure the LLVM project.
# This mixes llvm-bazel and llvm-project-raw to create llvm-project.
# The result has both the source code and the BUILD files in one place.
llvm_configure(
name = "llvm-project",
src_path = ".",
src_workspace = "@llvm-project-raw//:WORKSPACE",
)

15
third_party/llvm-bazel.patch vendored Normal file
View File

@ -0,0 +1,15 @@
diff --git a/llvm-project-overlay/llvm/BUILD b/llvm-project-overlay/llvm/BUILD
index 9f1d8c339..e1ab25e88 100644
--- a/llvm-project-overlay/llvm/BUILD
+++ b/llvm-project-overlay/llvm/BUILD
@@ -1730,6 +1730,10 @@ gentbl(
srcs = ["lib/Target/" + target["name"] + "/TargetInfo/" + target["name"] + "TargetInfo.cpp"],
hdrs = glob(["lib/Target/" + target["name"] + "/TargetInfo/*.h"]),
copts = llvm_copts,
+ # Workaround for https://github.com/bazelbuild/bazel/issues/3828
+ # TODO(gcmn): Remove this when upgrading to a Bazel version containing
+ # https://github.com/bazelbuild/bazel/commit/e3b7e17b05f1
+ includes = ["lib/Target/" + target["name"]],
strip_include_prefix = "lib/Target/" + target["name"],
deps = [
":" + target["name"] + "CommonTableGen",

1
third_party/llvm-project/BUILD.bazel vendored Normal file
View File

@ -0,0 +1 @@
# Empty BUILD file for integrating LLVM.