From 438f52c765ac1e4d170e7feed3a9024f04e170ef Mon Sep 17 00:00:00 2001 From: pcc Date: Wed, 11 Nov 2015 19:16:57 -0800 Subject: build: Add Windows port of LLVM LTO config; start using thin archives with lld. This uses "-Xclang -emit-llvm-bc" because the clang-cl driver does not support LTO. BUG=507755 R=thakis@chromium.org Review URL: https://codereview.chromium.org/1432133002 Cr-Commit-Position: refs/heads/master@{#359228} --- build/common.gypi | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'build') diff --git a/build/common.gypi b/build/common.gypi index a253ce6..61ee7f3 100644 --- a/build/common.gypi +++ b/build/common.gypi @@ -6002,6 +6002,9 @@ # Limited to Windows because lld-link is the driver that is # compatible with link.exe. ['LD', '<(make_clang_dir)/bin/lld-link'], + # lld-link includes a replacement for lib.exe that can produce thin + # archives and understands bitcode (for use_lto==1). + ['AR', '<(make_clang_dir)/bin/lld-link /lib /llvmlibthin'], ], }], ['OS=="android" and clang==0', { @@ -6087,6 +6090,15 @@ ], }], ], + 'msvs_settings': { + 'VCCLCompilerTool': { + 'AdditionalOptions': [ + # TODO(pcc): Add LTO support to clang-cl driver and use it here. + '-Xclang', + '-emit-llvm-bc', + ], + }, + }, }, }], # Apply a lower LTO optimization level as the default is too slow. @@ -6106,6 +6118,13 @@ }, }], ], + 'msvs_settings': { + 'VCLinkerTool': { + 'AdditionalOptions': [ + '/opt:lldlto=1', + ], + }, + }, }, }], ['use_lto==1 and clang==1 and target_arch=="arm"', { -- cgit v1.1