From cf8fc7220f31b5e5ea664365c4857402079d9a7b Mon Sep 17 00:00:00 2001 From: pcloudy Date: Fri, 31 Mar 2017 11:50:19 +0000 Subject: 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 --- tools/cpp/wrapper/bin/pydir/msvc_link.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'tools/cpp/wrapper/bin/pydir') 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']), ] -- cgit v1.2.3