From 7304afd4f2b782da407166797ee1364cbcfdb8b4 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Mon, 6 Aug 2018 08:06:09 -0700 Subject: [PATCH] [TF:XLA] Ensure that deadness_analysis.cc is only linked once Escaping the transitive dependency on :compilation_passes is impossible: //tensorflow/compiler/jit:deadness_analysis_test -> //tensorflow/compiler/jit/kernels:xla_launch_op -> //tensorflow/compiler/jit:xla_device -> //tensorflow/compiler/jit:jit_compilation_passes -> //tensorflow/compiler/jit:compilation_passes Linking both :compilation_passes and :deadness_analysis_internal into one test leads to ODR conflicts. Asan complains about them. Just remove the internal target and add the internal header to the test. PiperOrigin-RevId: 207546071 --- tensorflow/compiler/jit/BUILD | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-) diff --git a/tensorflow/compiler/jit/BUILD b/tensorflow/compiler/jit/BUILD index 377cd11f44d..d3238c6a5ef 100644 --- a/tensorflow/compiler/jit/BUILD +++ b/tensorflow/compiler/jit/BUILD @@ -301,22 +301,6 @@ tf_cc_test( ], ) -cc_library( - name = "deadness_analysis_internal", - testonly = True, - srcs = [ - "deadness_analysis.cc", - ], - hdrs = [ - "deadness_analysis.h", - "deadness_analysis_internal.h", - ], - deps = [ - "//tensorflow/core:graph", - "//tensorflow/core:lib", - ], -) - cc_library( name = "compilation_passes", srcs = [ @@ -398,11 +382,12 @@ tf_cc_test( name = "deadness_analysis_test", size = "small", srcs = [ + "deadness_analysis_internal.h", "deadness_analysis_test.cc", ], deps = [ ":common", - ":deadness_analysis_internal", + ":compilation_passes", "//tensorflow/cc:cc_ops", "//tensorflow/cc:cc_ops_internal", "//tensorflow/cc:function_ops", @@ -414,6 +399,7 @@ tf_cc_test( "//tensorflow/core:core_cpu", "//tensorflow/core:framework", "//tensorflow/core:framework_internal", + "//tensorflow/core:graph", "//tensorflow/core:lib", "//tensorflow/core:test", "//tensorflow/core:test_main",