Skip to content
Permalink
Browse files

win: Stop using split_static_library in chrome/, content/

This was a workaround for a toolchain problem we no longer have --
lld-link has thin static libraries and this is a no-op for it for that
reason already.

Bug: 857060
Change-Id: Ib16c732e3f0a6a0973feff72c7fa4bd1154e2615
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1865420
Reviewed-by: Avi Drissman <avi@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Reviewed-by: Hans Wennborg <hans@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#706877}
  • Loading branch information
nico authored and Commit Bot committed Oct 17, 2019
1 parent 2401691 commit a86070adf5bd34af99bd698b369a9c624a40676e
@@ -3,7 +3,6 @@
# found in the LICENSE file.

import("//build/config/nacl/config.gni") # To see if jumbo should be turned off
import("//build/split_static_library.gni") # When someone uses that target_type
import("//build/toolchain/goma.gni")

declare_args() {
@@ -49,9 +48,9 @@ jumbo_file_merge_default = 50
# Goma builds benefit from more parallelism
jumbo_file_merge_goma = 8

# Use one of the targets jumbo_source_set, jumbo_static_library,
# jumbo_split_static_library or jumbo_component to generate a target
# which merges sources if possible to compile much faster.
# Use one of the targets jumbo_source_set, jumbo_static_library, or
# jumbo_component to generate a target which merges sources if possible to
# compile much faster.
#
# Special values.
#
@@ -214,11 +213,6 @@ template("internal_jumbo_target") {
}

target_type = invoker.target_type
if (use_jumbo_build_for_target && target_type == "split_static_library") {
# Meaningless and also impossible if split_count > len(jumbo_files)
target_type = "static_library"
not_needed(invoker, [ "split_count" ])
}

# Perform the actual operation, either on the original sources or
# the sources post-jumbo merging.
@@ -280,22 +274,6 @@ set_defaults("jumbo_static_library") {
configs = default_compiler_configs
}

# See documentation above by "internal_jumbo_target".
template("jumbo_split_static_library") {
internal_jumbo_target(target_name) {
target_type = "split_static_library"
forward_variables_from(invoker, "*")
}
}

set_defaults("jumbo_split_static_library") {
# This sets the default list of configs when the
# jumbo_split_static_library target is defined. The
# default_compiler_configs comes from BUILDCONFIG.gn and is the list
# normally applied to static libraries and source sets.
configs = default_compiler_configs
}

# See documentation above by "internal_jumbo_target".
template("jumbo_component") {
internal_jumbo_target(target_name) {
@@ -1,6 +1,7 @@
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/sanitizers/sanitizers.gni")
import("//gpu/vulkan/features.gni")

import("//cc/cc.gni")
@@ -9,7 +9,6 @@ import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/linux/gtk/gtk.gni")
import("//build/config/ui.gni")
import("//build/split_static_library.gni")
import("//chrome/common/features.gni")
import("//components/feature_engagement/features.gni")
import("//components/feed/features.gni")
@@ -73,17 +72,7 @@ proto_library("ntp_background_proto") {

# Use a static library here because many test binaries depend on this but don't
# require many files from it. This makes linking more efficient.
jumbo_split_static_library("browser") {
# Split into multiple static libraries on Windows builds. We have hit size
# limits on Windows official builds and on goma builds when symbol_level = 2
# is selected. Always splitting on Windows builds is simpler than trying to
# perfectly calculate the scenarios where it is required.
if (is_win) {
split_count = 5
} else {
split_count = 1
}

jumbo_static_library("browser") {
sources = [
"about_flags.cc",
"about_flags.h",
@@ -9,7 +9,6 @@ import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/linux/gtk/gtk.gni")
import("//build/config/ui.gni")
import("//build/split_static_library.gni")
import("//chrome/common/features.gni")
import("//chromeos/assistant/assistant.gni")
import("//components/feature_engagement/features.gni")
@@ -28,17 +27,7 @@ import("//ui/views/features.gni")

# Use a static library here because many test binaries depend on this but don't
# require many files from it. This makes linking more efficient.
jumbo_split_static_library("ui") {
# Split into multiple static libraries on Windows builds. We have hit size
# limits on Windows official builds and on goma builds when symbol_level = 2
# is selected. Always splitting on Windows builds is simpler than trying to
# perfectly calculate the scenarios where it is required.
if (is_win) {
split_count = 5
} else {
split_count = 1
}

jumbo_static_library("ui") {
sources = [
"accelerator_utils.h",
"app_list/app_list_util.cc",
@@ -6,7 +6,6 @@ import("//build/config/chromecast_build.gni")
import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/ui.gni")
import("//build/split_static_library.gni")
import("//content/common/features.gni")
import("//media/media_options.gni")
import("//ppapi/buildflags/buildflags.gni")
@@ -17,7 +16,7 @@ import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
if (is_component_build) {
link_target_type = "jumbo_source_set"
} else {
link_target_type = "jumbo_split_static_library"
link_target_type = "jumbo_static_library"
}

target(link_target_type, "renderer") {
@@ -323,15 +322,6 @@ target(link_target_type, "renderer") {
]
}

if (!is_component_build) {
if (is_win && is_official_build) {
split_count = 2 # In certain configurations a full renderer.lib can
# be 2+ GB which breaks some Windows tools.
} else {
split_count = 1
}
}

configs += [
"//content:content_implementation",
"//build/config/compiler:no_size_t_to_int_warning",
@@ -69,7 +69,7 @@ system in another browser engine.
1. Add `import("//build/config/jumbo.gni")` to `BUILD.gn`.
2. Change your target, for instance `static_library`, to
`jumbo_static_library`. So far `source_set`, `component`,
`static_library` and `split_static_library` are supported.
`static_library` are supported.
3. Recompile and test.

### Example
@@ -6,7 +6,6 @@ import("//build/config/chromecast_build.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/dcheck_always_on.gni")
import("//build/config/ui.gni")
import("//build/split_static_library.gni")
import("//build/toolchain/toolchain.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//third_party/blink/renderer/bindings/bindings.gni")

0 comments on commit a86070a

Please sign in to comment.
You can’t perform that action at this time.