File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -216,6 +216,8 @@ build --announce_rc
216216# Other build flags.
217217build --define=grpc_no_ares=true
218218
219+ build --incompatible_remove_legacy_whole_archive
220+
219221# Modular TF build options
220222build:dynamic_kernels --define=dynamic_loaded_kernels=true
221223build:dynamic_kernels --copt=-DAUTOLOAD_DYNAMIC_KERNELS
Original file line number Diff line number Diff line change @@ -622,6 +622,18 @@ tf_cc_shared_object(
622622 ] + tf_additional_binary_deps (),
623623)
624624
625+ # This is intended to be the same as tf_binary_additional_srcs:
626+ # https://github.com/tensorflow/tensorflow/blob/cd67f4f3723f9165aabedd0171aaadc6290636e5/tensorflow/tensorflow.bzl#L396-L425
627+ # And is usable in the "deps" attribute instead of the "srcs" attribute
628+ # as a workaround for https://github.com/tensorflow/tensorflow/issues/34117
629+ cc_import (
630+ name = "libtensorflow_framework_import_lib" ,
631+ shared_library = select ({
632+ "//tensorflow:macos" : ":libtensorflow_framework.dylib" ,
633+ "//conditions:default" : ":libtensorflow_framework.so" ,
634+ }),
635+ )
636+
625637# -------------------------------------------
626638# New rules should be added above this target.
627639# -------------------------------------------
Original file line number Diff line number Diff line change @@ -629,6 +629,11 @@ def tf_cc_binary(
629629 [
630630 clean_dep ("//third_party/mkl:intel_binary_blob" ),
631631 ],
632+ ) + if_static (
633+ extra_deps = [],
634+ otherwise = [
635+ clean_dep ("//tensorflow:libtensorflow_framework_import_lib" ),
636+ ],
632637 ),
633638 data = depset (data + added_data_deps ),
634639 linkopts = linkopts + _rpath_linkopts (name_os ),
You can’t perform that action at this time.
0 commit comments