Add some missing dependencies so that the TPU version of TensorFlow builds

PiperOrigin-RevId: 323477747
Change-Id: I13393c728bda8f6c541955513a7e6315799ec844
diff --git a/tensorflow/core/tpu/BUILD b/tensorflow/core/tpu/BUILD
index b8cc603..62d411c 100644
--- a/tensorflow/core/tpu/BUILD
+++ b/tensorflow/core/tpu/BUILD
@@ -143,8 +143,11 @@
     deps = [
         ":libtftpu_header",
         ":tpu_api",
+        ":tpu_compilation_device",
         ":tpu_config_c_api",
         ":tpu_library_init_fns",
+        ":tpu_node_device",
+        ":tpu_system_device",
         "//tensorflow/core:lib",
         "//tensorflow/core/tpu/graph_rewrite:tpu_rewrite_pass_registration",
         "//tensorflow/core/tpu/kernels:tpu_compile_c_api_hdrs",
diff --git a/tensorflow/core/tpu/tpu_compilation_device.cc b/tensorflow/core/tpu/tpu_compilation_device.cc
index 2b23148..f124000 100644
--- a/tensorflow/core/tpu/tpu_compilation_device.cc
+++ b/tensorflow/core/tpu/tpu_compilation_device.cc
@@ -18,7 +18,14 @@
 #include "tensorflow/core/tpu/tpu_node_device_util.h"
 
 namespace tensorflow {
+namespace {
 
-REGISTER_XLA_BACKEND(DEVICE_TPU_XLA_JIT, kTpuAllTypes, TpuOpFilter);
+bool RegisterTpuXlaBackend() {
+  REGISTER_XLA_BACKEND(DEVICE_TPU_XLA_JIT, kTpuAllTypes, TpuOpFilter);
+  return true;
+}
 
+static bool tpu_xla_backend_registered = RegisterTpuXlaBackend();
+
+}  // namespace
 }  // namespace tensorflow