Update TF for Bazel 1.0's --incompatible_remove_legacy_whole_archive
https://github.com/bazelbuild/bazel/issues/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 https://github.com/tensorflow/tensorflow/issues/32835 (once again, as it was fixed by https://github.com/tensorflow/tensorflow/pull/33415 but the codebase regressed in the meantime.) It also fixes most of the TF tests. PiperOrigin-RevId: 276772147 Change-Id: I05db02e84200a484df52f4f02b601dc486636912
This commit is contained in:
parent
49c6786044
commit
52167ad658
@ -30,6 +30,7 @@ cc_library(
|
||||
"//tensorflow/core/platform:logging",
|
||||
"//tensorflow/core/platform:types",
|
||||
],
|
||||
alwayslink = 1,
|
||||
)
|
||||
|
||||
cc_library(
|
||||
|
@ -268,6 +268,7 @@ cc_library(
|
||||
"@com_google_absl//absl/base",
|
||||
"@com_google_absl//absl/synchronization",
|
||||
],
|
||||
alwayslink = 1,
|
||||
)
|
||||
|
||||
cc_library(
|
||||
|
@ -210,6 +210,7 @@ TF_DEFAULT_PLATFORM_LIBRARIES = {
|
||||
],
|
||||
"visibility": ["//visibility:private"],
|
||||
"tags": ["no_oss", "manual"],
|
||||
"alwayslink": 1,
|
||||
},
|
||||
"notification": {
|
||||
"name": "notification_impl",
|
||||
@ -298,6 +299,7 @@ TF_DEFAULT_PLATFORM_LIBRARIES = {
|
||||
],
|
||||
"tags": ["no_oss", "manual"],
|
||||
"visibility": ["//visibility:private"],
|
||||
"alwayslink": 1,
|
||||
},
|
||||
"test": {
|
||||
"name": "test_impl",
|
||||
|
1
tensorflow/lite/python/testdata/BUILD
vendored
1
tensorflow/lite/python/testdata/BUILD
vendored
@ -61,6 +61,7 @@ cc_library(
|
||||
deps = [
|
||||
"//tensorflow/lite/c:c_api_internal",
|
||||
],
|
||||
alwayslink = 1,
|
||||
)
|
||||
|
||||
cc_binary(
|
||||
|
@ -439,6 +439,7 @@ cc_library(
|
||||
"//tensorflow/core:lib",
|
||||
"//tensorflow/core:protos_all_cc",
|
||||
],
|
||||
alwayslink = 1,
|
||||
)
|
||||
|
||||
tf_python_pybind_extension(
|
||||
|
@ -234,6 +234,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
|
||||
|
1
third_party/icu/data/BUILD.bazel
vendored
1
third_party/icu/data/BUILD.bazel
vendored
@ -40,4 +40,5 @@ cc_library(
|
||||
name = "conversion_data",
|
||||
srcs = [":conversion_data.c"],
|
||||
deps = ["@icu//:headers"],
|
||||
alwayslink = 1,
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user