Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add -lrt to linkflags #37719

Merged
merged 1 commit into from
Mar 19, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions tensorflow/tensorflow.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ def tf_cc_shared_object(
srcs = [],
deps = [],
data = [],
linkopts = [],
linkopts = if_not_windows(["-lrt"]),
framework_so = tf_binary_additional_srcs(),
soversion = None,
kernels = [],
Expand Down Expand Up @@ -641,7 +641,7 @@ def tf_cc_binary(
srcs = [],
deps = [],
data = [],
linkopts = [],
linkopts = if_not_windows(["-lrt"]),
copts = tf_copts(),
kernels = [],
per_os_targets = False, # Generate targets with SHARED_LIBRARY_NAME_PATTERNS
Expand Down Expand Up @@ -737,7 +737,7 @@ def tf_gen_op_wrapper_cc(
tf_cc_binary(
name = tool,
copts = tf_copts(),
linkopts = if_not_windows(["-lm", "-Wl,-ldl"]),
linkopts = if_not_windows(["-lm", "-Wl,-ldl", "-lrt"]),
linkstatic = 1, # Faster to link this one-time-use binary dynamically
deps = [op_gen] + deps,
)
Expand Down Expand Up @@ -924,7 +924,7 @@ def tf_gen_op_wrapper_py(
tf_cc_binary(
name = tool_name,
copts = tf_copts(),
linkopts = if_not_windows(["-lm", "-Wl,-ldl"]) + cc_linkopts,
linkopts = if_not_windows(["-lm", "-Wl,-ldl", "-lrt"]) + cc_linkopts,
linkstatic = 1, # Faster to link this one-time-use binary dynamically
visibility = [clean_dep("//tensorflow:internal")],
deps = ([
Expand Down Expand Up @@ -1221,7 +1221,7 @@ def tf_cc_tests(
tags = [],
size = "medium",
args = None,
linkopts = [],
linkopts = if_not_windows(["-lrt"]),
kernels = [],
create_named_test_suite = False,
visibility = None):
Expand Down