aboutsummaryrefslogtreecommitdiffhomepage
path: root/third_party/gpus
diff options
context:
space:
mode:
authorGravatar Peter Hawkins <phawkins@google.com>2016-12-08 00:17:13 -0800
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2016-12-08 00:26:38 -0800
commit202f77420beb8a556c6a3d685e8f5daab0a8275c (patch)
treee2b6c192a464f1a51cd993d5701f8aaee57b6613 /third_party/gpus
parent2c766bbfabf477432b738051e836ece4062962e0 (diff)
Fix static initialization based registry patterns with shared libraries when built with --config=cuda.
Change: 141406402
Diffstat (limited to 'third_party/gpus')
-rw-r--r--third_party/gpus/crosstool/BUILD.tpl6
-rw-r--r--third_party/gpus/crosstool/CROSSTOOL.tpl1
2 files changed, 6 insertions, 1 deletions
diff --git a/third_party/gpus/crosstool/BUILD.tpl b/third_party/gpus/crosstool/BUILD.tpl
index 5dc24f7b60..7e46f36dc3 100644
--- a/third_party/gpus/crosstool/BUILD.tpl
+++ b/third_party/gpus/crosstool/BUILD.tpl
@@ -21,7 +21,11 @@ cc_toolchain(
objcopy_files = ":empty",
static_runtime_libs = [":empty"],
strip_files = ":empty",
- supports_param_files = 0,
+ # To support linker flags that need to go to the start of command line
+ # we need the toolchain to support parameter files. Parameter files are
+ # last on the command line and contain all shared libraries to link, so all
+ # regular options will be left of them.
+ supports_param_files = 1,
)
cc_toolchain(
diff --git a/third_party/gpus/crosstool/CROSSTOOL.tpl b/third_party/gpus/crosstool/CROSSTOOL.tpl
index 3ce6b74a52..b77a45c325 100644
--- a/third_party/gpus/crosstool/CROSSTOOL.tpl
+++ b/third_party/gpus/crosstool/CROSSTOOL.tpl
@@ -54,6 +54,7 @@ toolchain {
# Use "-std=c++11" for nvcc. For consistency, force both the host compiler
# and the device compiler to use "-std=c++11".
cxx_flag: "-std=c++11"
+ linker_flag: "-Wl,-no-as-needed"
linker_flag: "-lstdc++"
linker_flag: "-B/usr/bin/"