Commit 24622fa5 authored by Yuki Shiino's avatar Yuki Shiino Committed by Commit Bot

base/allocator: Fix android_cronet build with PA-Everywhere

https://crrev.com/c/2300380 is failing to build on android_cronet
bot due to a conflict in GN settings between
use_allocator=="partition" and use_partition_alloc=false.

Ideally, we shouldn't have two flags and we'd better to remove
use_partition_alloc in future.  This patch mitigates the issue
by prioritizing use_allocator over use_partition_alloc.

Bug: 998048
Change-Id: I293a884186dfa9804930b835ba236efb818a761d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2368797Reviewed-by: default avatarBenoit L <lizeb@chromium.org>
Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Yuki Shiino <yukishiino@chromium.org>
Cr-Commit-Position: refs/heads/master@{#801737}
parent 42e16a13
......@@ -20,7 +20,6 @@
import("//base/allocator/allocator.gni")
import("//base/trace_event/tracing.gni")
import("//build/buildflag_header.gni")
import("//build/config/allocator.gni")
import("//build/config/arm.gni")
import("//build/config/c++/c++.gni")
import("//build/config/chromecast_build.gni")
......
......@@ -4,7 +4,6 @@
import("//base/allocator/allocator.gni")
import("//build/buildflag_header.gni")
import("//build/config/allocator.gni")
import("//build/config/compiler/compiler.gni")
declare_args() {
......
......@@ -7,7 +7,8 @@ import("//build/config/sanitizers/sanitizers.gni")
# Temporarily disable tcmalloc on arm64 linux to get rid of compilation errors.
if (is_android || is_apple || is_asan || is_lsan || is_tsan || is_msan ||
is_win || is_fuchsia || ((is_linux || is_chromeos) && target_cpu == "arm64") ||
is_win || is_fuchsia ||
((is_linux || is_chromeos) && target_cpu == "arm64") ||
(is_cast_audio_only && target_cpu == "arm")) {
_default_allocator = "none"
} else {
......@@ -31,6 +32,11 @@ declare_args() {
# Causes all the allocations to be routed via allocator_shim.cc.
use_allocator_shim = _default_use_allocator_shim
# Partition alloc is included by default except iOS.
# TODO(lizeb, yukishiino): Remove |use_partition_alloc| once PA-Everywhere
# is enabled.
use_partition_alloc = !is_ios
}
assert(use_allocator == "none" || use_allocator == "tcmalloc" ||
......@@ -44,10 +50,17 @@ assert(!is_mac || use_allocator == "none", "Tcmalloc doesn't work on macOS.")
assert(!is_ios || use_allocator == "none", "Tcmalloc doesn't work on iOS.")
assert(
!use_allocator_shim || is_linux || is_chromeos || is_android || is_win || is_apple,
!use_allocator_shim || is_linux || is_chromeos || is_android || is_win ||
is_apple,
"use_allocator_shim works only on Android, iOS, Linux, macOS, and Windows.")
if (is_win && use_allocator_shim) {
assert(!is_component_build,
"The allocator shim doesn't work for the component build on Windows.")
}
if (use_allocator == "partition") {
# If there is a conflict, prioritize |use_allocator| over
# |use_partition_alloc|.
use_partition_alloc = true
}
# 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.
declare_args() {
# Partition alloc is included by default except iOS.
# TODO(thakis): Move this elsewhere, probably
# base/allocator/partition_allocator/buildflags.gni
use_partition_alloc = !is_ios
}
......@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/allocator.gni")
import("//build/config/clang/clang.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/dcheck_always_on.gni")
......
......@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//base/win/embedded_i18n/generate_embedded_i18n.gni")
import("//build/config/allocator.gni")
import("//build/config/clang/clang.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/dcheck_always_on.gni")
......
......@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/allocator.gni")
import("//build/config/clang/clang.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/dcheck_always_on.gni")
......
......@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/allocator.gni")
import("//build/config/buildflags_paint_preview.gni")
import("//build/config/chrome_build.gni")
import("//build/config/compiler/compiler.gni")
......
......@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//base/allocator/allocator.gni")
import("//build/config/allocator.gni")
import("//build/config/compiler/compiler.gni")
# Windows/x86 is disabled due to https://crbug.com/969146
......
......@@ -3,7 +3,6 @@
# found in the LICENSE file.
import("//base/allocator/allocator.gni")
import("//build/config/allocator.gni")
component("client") {
output_name = "gwp_asan_client"
......
......@@ -2,7 +2,6 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/allocator.gni")
import("//testing/test.gni")
import("//tools/v8_context_snapshot/v8_context_snapshot.gni")
import("//v8/gni/v8.gni")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment