From afb76393811a7e46ffab256c29116492bfd08e31 Mon Sep 17 00:00:00 2001 From: "A. Unique TensorFlower" Date: Wed, 4 Sep 2019 02:56:23 -0700 Subject: [PATCH] Add more alwayslink = 1 so we can build Tensorflow on Windows after --incompatible_remove_legacy_whole_archive (https://github.com/bazelbuild/bazel/issues/7362) is flipped Currently, library archives and library object groups are wrapped in `--whole_archive`, `--no_whole_archive`, thus the whole library is always linked. This will change with Bazel 1.0, and libraries that export otherwise unused symbols must be tagged as `alwayslink=1`. PiperOrigin-RevId: 267115768 --- tensorflow/c/BUILD | 1 + tensorflow/c/eager/BUILD | 2 ++ 2 files changed, 3 insertions(+) diff --git a/tensorflow/c/BUILD b/tensorflow/c/BUILD index ffc457de4aa76d..463899d7712331 100644 --- a/tensorflow/c/BUILD +++ b/tensorflow/c/BUILD @@ -270,6 +270,7 @@ tf_cuda_library( "//tensorflow/core/platform", "@com_google_absl//absl/strings", ], + alwayslink = 1, ) exports_files( diff --git a/tensorflow/c/eager/BUILD b/tensorflow/c/eager/BUILD index f6ae6759727995..2742bead4e4d84 100644 --- a/tensorflow/c/eager/BUILD +++ b/tensorflow/c/eager/BUILD @@ -80,6 +80,7 @@ tf_cuda_library( "//tensorflow/core/profiler/lib:profiler_session", "//tensorflow/core:gpu_runtime", ], + alwayslink = 1, ) tf_cuda_library( @@ -227,6 +228,7 @@ tf_cuda_library( "//tensorflow/core/profiler/rpc/client:capture_profile", "//tensorflow/core:gpu_runtime", ], + alwayslink = 1, ) tf_cuda_cc_test(