summary refs log tree commit diff
path: root/pkgs/development/python-modules/tensorflow/tf-1.15-bazel-1.0.patch
blob: 4d70e99108bf04eaf295022b330e7ed43505e5bb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
diff --git a/tensorflow/c/BUILD b/tensorflow/c/BUILD
index f740ba66b5..6cc9003787 100644
--- a/tensorflow/c/BUILD
+++ b/tensorflow/c/BUILD
@@ -270,6 +270,7 @@ tf_cuda_library(
         "//tensorflow/core/platform",
         "@com_google_absl//absl/strings",
     ],
+    alwayslink = 1,
 )
 
 exports_files(
diff --git a/tensorflow/c/eager/BUILD b/tensorflow/c/eager/BUILD
index 5c42e508f7..16b421862c 100644
--- a/tensorflow/c/eager/BUILD
+++ b/tensorflow/c/eager/BUILD
@@ -79,6 +79,7 @@ tf_cuda_library(
         "//tensorflow/core/profiler/lib:profiler_session",
         "//tensorflow/core:gpu_runtime",
     ],
+    alwayslink = 1,
 )
 
 tf_cuda_library(
@@ -226,6 +227,7 @@ tf_cuda_library(
         "//tensorflow/core/profiler/rpc/client:capture_profile",
         "//tensorflow/core:gpu_runtime",
     ],
+    alwayslink = 1,
 )
 
 tf_cuda_cc_test(
diff --git a/tensorflow/cc/saved_model/BUILD b/tensorflow/cc/saved_model/BUILD
index 39b84922d1..b2affdd999 100644
--- a/tensorflow/cc/saved_model/BUILD
+++ b/tensorflow/cc/saved_model/BUILD
@@ -123,6 +123,7 @@ cc_library(
         "//tensorflow/core/util/tensor_bundle:naming",
         # mobile not supported yet
     ]),
+    alwayslink = 1,
 )
 
 tf_cc_test(
diff --git a/tensorflow/core/BUILD b/tensorflow/core/BUILD
index c23c1f9b39..805643b217 100644
--- a/tensorflow/core/BUILD
+++ b/tensorflow/core/BUILD
@@ -777,6 +777,7 @@ cc_library(
         ":lib_proto_parsing",
         ":protos_all_cc",
     ],
+    alwayslink = 1,
 )
 
 # DEPRECATED: use platform:stringpiece instead.
@@ -2496,6 +2497,7 @@ cc_library(
                "@com_google_protobuf//:protobuf",
            ] + tf_protos_all_impl() + tf_protos_grappler_impl() +
            tf_additional_numa_deps(),
+    alwayslink = 1,
 )
 
 # File compiled with extra flags to get cpu-specific acceleration.
diff --git a/tensorflow/core/lib/random/BUILD b/tensorflow/core/lib/random/BUILD
index 3bd933261b..e1e589e76d 100644
--- a/tensorflow/core/lib/random/BUILD
+++ b/tensorflow/core/lib/random/BUILD
@@ -50,6 +50,7 @@ cc_library(
         "//tensorflow/core/platform:types",
         "//third_party/eigen3",
     ],
+    alwayslink = 1,
 )
 
 filegroup(
diff --git a/tensorflow/core/platform/default/build_config.bzl b/tensorflow/core/platform/default/build_config.bzl
index 5459d8d428..feba3a5686 100644
--- a/tensorflow/core/platform/default/build_config.bzl
+++ b/tensorflow/core/platform/default/build_config.bzl
@@ -228,6 +228,7 @@ def cc_proto_library(
         hdrs = gen_hdrs,
         deps = cc_libs + deps,
         includes = includes,
+        alwayslink = 1,
         **kargs
     )
     native.cc_library(
diff --git a/tensorflow/lite/java/src/test/native/BUILD b/tensorflow/lite/java/src/test/native/BUILD
index 6dcdab2aee..32bb0a8d85 100644
--- a/tensorflow/lite/java/src/test/native/BUILD
+++ b/tensorflow/lite/java/src/test/native/BUILD
@@ -19,6 +19,7 @@ cc_library(
         "//tensorflow/lite/java/jni",
         "//tensorflow/lite/kernels:kernel_util",
     ],
+    alwayslink = 1,
 )
 
 tflite_jni_binary(
diff --git a/tensorflow/lite/python/testdata/BUILD b/tensorflow/lite/python/testdata/BUILD
index 7bda81358f..ac1188d844 100644
--- a/tensorflow/lite/python/testdata/BUILD
+++ b/tensorflow/lite/python/testdata/BUILD
@@ -60,6 +60,7 @@ cc_library(
     deps = [
         "//tensorflow/lite/c:c_api_internal",
     ],
+    alwayslink = 1,
 )
 
 cc_binary(
diff --git a/tensorflow/python/BUILD b/tensorflow/python/BUILD
index 6fd9b4f273..29df3a3dff 100644
--- a/tensorflow/python/BUILD
+++ b/tensorflow/python/BUILD
@@ -375,6 +375,7 @@ cc_library(
         "//tensorflow/core:lib",
         "//tensorflow/core:protos_all_cc",
     ],
+    alwayslink = 1,
 )
 
 cc_library(
@@ -411,6 +412,7 @@ cc_library(
         "//third_party/py/numpy:headers",
         "//third_party/python_runtime:headers",
     ],
+    alwayslink = 1,
 )
 
 cc_library(
@@ -617,6 +619,7 @@ cc_library(
         "//tensorflow/core:op_gen_lib",
         "//tensorflow/core:protos_all_cc",
     ],
+    alwayslink = 1,
 )
 
 py_library(
diff --git a/tensorflow/tensorflow.bzl b/tensorflow/tensorflow.bzl
index a3956322fe..32752f59ad 100644
--- a/tensorflow/tensorflow.bzl
+++ b/tensorflow/tensorflow.bzl
@@ -2331,6 +2331,7 @@ def tf_generate_proto_text_sources(name, srcs_relative_dir, srcs, protodeps = []
         hdrs = out_hdrs,
         visibility = visibility,
         deps = deps,
+        alwayslink = 1,
     )
 
 def tf_genrule_cmd_append_to_srcs(to_append):
diff --git a/tensorflow/tools/graph_transforms/BUILD b/tensorflow/tools/graph_transforms/BUILD
index adafe2aca1..8965316b12 100644
--- a/tensorflow/tools/graph_transforms/BUILD
+++ b/tensorflow/tools/graph_transforms/BUILD
@@ -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
diff --git a/third_party/icu/data/BUILD.bazel b/third_party/icu/data/BUILD.bazel
index 7db21566e4..8e18c7cc3a 100644
--- a/third_party/icu/data/BUILD.bazel
+++ b/third_party/icu/data/BUILD.bazel
@@ -43,4 +43,5 @@ cc_library(
     name = "conversion_data",
     srcs = [":conversion_data.c"],
     deps = ["@icu//:headers"],
+    alwayslink = 1,
 )
diff --git a/third_party/protobuf/protobuf.patch b/third_party/protobuf/protobuf.patch
index df0648563d..18fc6cdf35 100644
--- a/third_party/protobuf/protobuf.patch
+++ b/third_party/protobuf/protobuf.patch
@@ -11,7 +11,15 @@ index 2fb26050..c2744d5b 100644
  
  ################################################################################
  # Protobuf Runtime Library
-@@ -218,7 +218,7 @@ cc_library(
+@@ -209,6 +209,7 @@ cc_library(
+     copts = COPTS,
+     includes = ["src/"],
+     linkopts = LINK_OPTS,
++    alwayslink = 1,
+     visibility = ["//visibility:public"],
+     deps = [":protobuf_lite"] + PROTOBUF_DEPS,
+ )
+@@ -219,7 +220,7 @@ cc_library(
  # TODO(keveman): Remove this target once the support gets added to Bazel.
  cc_library(
      name = "protobuf_headers",
@@ -20,3 +28,4 @@ index 2fb26050..c2744d5b 100644
      includes = ["src/"],
      visibility = ["//visibility:public"],
  )
+ 
\ No newline at end of file
diff --git a/third_party/systemlibs/protobuf.bzl b/third_party/systemlibs/protobuf.bzl
index 774514f3fd..1c415b018b 100644
--- a/third_party/systemlibs/protobuf.bzl
+++ b/third_party/systemlibs/protobuf.bzl
@@ -262,6 +262,7 @@ def cc_proto_library(
         hdrs = gen_hdrs,
         deps = cc_libs + deps,
         includes = includes,
+        alwayslink = 1,
         **kargs
     )