diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn index 0f7a6b48f..e772fc3d5 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn @@ -1676,8 +1676,9 @@ config("export_dynamic") { # thin_archive ----------------------------------------------------------------- # -# Enables thin archives on posix. Regular archives directly include the object -# files used to generate it. Thin archives merely reference the object files. +# Enables thin archives on posix, and on windows when the lld linker is used. +# Regular archives directly include the object files used to generate it. +# Thin archives merely reference the object files. # This makes building them faster since it requires less disk IO, but is # inappropriate if you wish to redistribute your static library. # This config is added to the global config, so thin archives should already be @@ -1693,6 +1694,8 @@ config("thin_archive") { # archive names to 16 characters, which is not what we want). if ((is_posix && !is_nacl && !is_mac && !is_ios) || is_fuchsia) { arflags = [ "-T" ] + } else if (is_win && use_lld) { + arflags = [ "/llvmlibthin" ] } } diff --git a/toolchain/win/BUILD.gn b/toolchain/win/BUILD.gn index d6b42ce9b..663f4ebd1 100644 --- a/toolchain/win/BUILD.gn +++ b/toolchain/win/BUILD.gn @@ -116,7 +116,7 @@ template("msvc_toolchain") { # lld-link includes a replacement for lib.exe that can produce thin # archives and understands bitcode (for lto builds). - lib = "$prefix/$lld_link /lib /llvmlibthin" + lib = "$prefix/$lld_link /lib" link = "$prefix/$lld_link" if (host_os != "win") { # See comment adding --rsp-quoting to $cl above for more information.