Skip to content

Commit

Permalink
Update TF for Bazel 1.0's --incompatible_remove_legacy_whole_archive
Browse files Browse the repository at this point in the history
bazelbuild/bazel#7362

This PR updates `cc_library`s to use `alwayslink=1` when needed. Currently, library archives and library object groups are wrapped in `--whole_archive`, `--no_whole_archive`, thus the whole library is always linked. This changes with Bazel 1.0, and libraries that export otherwise unused symbols must be tagged as `alwayslink=1`.

This PR fixes tensorflow#32835 (once again, as it was fixed by tensorflow#33415 but the codebase regressed in the meantime.)
It also fixes most of the TF tests.

PiperOrigin-RevId: 276772147
Change-Id: I05db02e84200a484df52f4f02b601dc486636912
(cherry picked from commit 52167ad)
  • Loading branch information
tensorflower-gardener authored and timokau committed Nov 2, 2019
1 parent e8b0020 commit cec52a8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions tensorflow/lite/python/testdata/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ cc_library(
deps = [
"//tensorflow/lite/c:c_api_internal",
],
alwayslink = 1,
)

cc_binary(
Expand Down
1 change: 1 addition & 0 deletions tensorflow/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ cc_library(
"//tensorflow/core:lib",
"//tensorflow/core:protos_all_cc",
],
alwayslink = 1,
)

cc_library(
Expand Down
1 change: 1 addition & 0 deletions tensorflow/tools/graph_transforms/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ cc_library(
"//tensorflow/core:lib_internal",
"//tensorflow/core:protos_all_cc",
],
alwayslink = 1,
)

# This library includes a main function, to make it easy to create other
Expand Down
1 change: 1 addition & 0 deletions third_party/icu/data/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,5 @@ cc_library(
name = "conversion_data",
srcs = [":conversion_data.c"],
deps = ["@icu//:headers"],
alwayslink = 1,
)

0 comments on commit cec52a8

Please sign in to comment.