aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/cpp/wrapper/bin/pydir
diff options
context:
space:
mode:
authorGravatar pcloudy <pcloudy@google.com>2017-03-31 11:50:19 +0000
committerGravatar Philipp Wollermann <philwo@google.com>2017-03-31 17:13:18 +0200
commitcf8fc7220f31b5e5ea664365c4857402079d9a7b (patch)
tree28a91531e4f4adc081a8573b6830fe5d80ffb8fc /tools/cpp/wrapper/bin/pydir
parent5a787e39fbaae338b970b72ed4cd52f72407e7bd (diff)
Fix MSVC CROSSTOOL for linking against lib files
1. No need to add /WHOLEARCHIVE option for object files 2. When linking against a .lib file of a dll with /WHOLEARCHIVE option, the linker produces an error. So strip it in msvc_link.py. The second point is a temporary workaround to make TF GPU build work, we'll fix it properly when we figure out how to deal with .lib, .dll, .pdb files on Windwos. Fix https://github.com/bazelbuild/bazel/issues/2753 Change-Id: Ia77b67546bfd4f19ceeb0f6ab9ab3b7a598c4fe9 PiperOrigin-RevId: 151811504
Diffstat (limited to 'tools/cpp/wrapper/bin/pydir')
-rw-r--r--tools/cpp/wrapper/bin/pydir/msvc_link.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/tools/cpp/wrapper/bin/pydir/msvc_link.py b/tools/cpp/wrapper/bin/pydir/msvc_link.py
index 91176446f8..c0011a256e 100644
--- a/tools/cpp/wrapper/bin/pydir/msvc_link.py
+++ b/tools/cpp/wrapper/bin/pydir/msvc_link.py
@@ -33,9 +33,6 @@ LINKPATTERNS = [
('-L(.+)', ['/LIBPATH:$PATH0']),
('-static', []),
('-shared', ['/DLL']),
- # TODO(pcloudy): Make "whole archive" a feature in CROSSTOOL
- # /WHOLEARCHIVE is supported in Visual Stuido 2015 update 2
- (('-whole-archive', '(.+)'), ['/WHOLEARCHIVE:$PATH0']),
('-no-whole-archive', []),
('-rdynamic', []),
(r'-Wl,(.+)\.lib', ['$0.lib']),
@@ -44,6 +41,7 @@ LINKPATTERNS = [
('-Wl,-rpath(.+)', []),
('-Wl,-S', []), # Debug symbols are in pdb files.
('-Wl,/SUBSYSTEM:(WINDOWS|CONSOLE)', ['/SUBSYSTEM:$0']),
+ (r'/WHOLEARCHIVE:(.+)\.lib', ['$0.lib']),
]