Skip to content

Commit

Permalink
Manage win lld-link.exe thin archive flag with config("thin_archive")
Browse files Browse the repository at this point in the history
  • Loading branch information
piscisaureus committed Dec 7, 2018
1 parent 414ab91 commit 75a7f82
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions config/compiler/BUILD.gn
Expand Up @@ -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
Expand All @@ -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" ]
}
}

Expand Down
2 changes: 1 addition & 1 deletion toolchain/win/BUILD.gn
Expand Up @@ -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.
Expand Down

0 comments on commit 75a7f82

Please sign in to comment.