0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-06-03 17:45:16 +00:00
Files
2025-05-03 13:51:22 +08:00

367 lines
12 KiB
Diff

From 67b57d4c4b5024175094b97ea27d277a2c96f46d Mon Sep 17 00:00:00 2001
From: Chongyun Lee <licy183@termux.dev>
Date: Wed, 16 Apr 2025 01:49:52 +0800
Subject: [PATCH] reland jumbo 1
Enable jumbo build for the following component(s)/source_set(s):
- //base:base
- //base:i18n
Enable jumbo build for the following template(s):
- //cc/cc.gni -> template("cc_component")
- //components/viz/viz.gni -> template("viz_component")
- //components/viz/viz.gni -> template("viz_static_library")
- //components/viz/viz.gni -> template("viz_source_set")
---
base/BUILD.gn | 15 +++++++++++++--
.../poisson_allocation_sampler.cc | 9 ++++++++-
.../sampling_heap_profiler.cc | 9 ++++++++-
base/task/sequenced_task_runner.cc | 4 ++++
base/task/single_thread_task_runner.cc | 4 ++++
cc/cc.gni | 5 +++--
.../viz/service/display/occlusion_culler.cc | 4 ++++
.../service/display/overlay_candidate_factory.cc | 4 ++++
components/viz/service/display/skia_renderer.cc | 4 ++++
.../viz/service/display/software_renderer.cc | 4 ++++
.../service/frame_sinks/frame_sink_manager_impl.h | 3 +++
components/viz/viz.gni | 7 ++++---
12 files changed, 63 insertions(+), 9 deletions(-)
diff --git a/base/BUILD.gn b/base/BUILD.gn
index 57a6af0061..fd69197bea 100644
--- a/base/BUILD.gn
+++ b/base/BUILD.gn
@@ -28,6 +28,7 @@ import("//build/config/cast.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/cronet/config.gni")
import("//build/config/dcheck_always_on.gni")
+import("//build/config/jumbo.gni")
import("//build/config/logging.gni")
import("//build/config/nacl/config.gni")
import("//build/config/profiling/profiling.gni")
@@ -173,7 +174,7 @@ use_epoll = is_linux || is_chromeos || is_android
# base compilation units to be linked in where they wouldn't have otherwise.
# This does not include test code (test support and anything in the test
# directory) which should use source_set as is recommended for GN targets).
-component("base") {
+jumbo_component("base") {
sources = [
"allocator/allocator_check.cc",
"allocator/allocator_check.h",
@@ -980,6 +981,10 @@ component("base") {
]
}
+ jumbo_excluded_sources = [
+ "logging.cc",
+ ]
+
if (is_linux || is_chromeos) {
sources += [
"debug/proc_maps_linux.cc",
@@ -998,6 +1003,7 @@ component("base") {
"threading/thread_type_delegate.cc",
"threading/thread_type_delegate.h",
]
+ jumbo_excluded_sources += [ "process/memory_linux.cc" ]
}
if (is_chromeos) {
@@ -1963,6 +1969,11 @@ component("base") {
"win/wrapped_window_proc.h",
]
+ # winternl.h and NTSecAPI.h have different definitions of UNICODE_STRING.
+ # There's only one client of NTSecAPI.h in base but several of winternl.h,
+ # so exclude the NTSecAPI.h one.
+ jumbo_excluded_sources += [ "rand_util_win.cc" ]
+
deps += [ "//base/win:base_win_buildflags" ]
if (com_init_check_hook_disabled) {
@@ -2807,7 +2818,7 @@ static_library("base_static") {
}
}
-component("i18n") {
+jumbo_component("i18n") {
output_name = "base_i18n"
sources = [
"i18n/base_i18n_export.h",
diff --git a/base/sampling_heap_profiler/poisson_allocation_sampler.cc b/base/sampling_heap_profiler/poisson_allocation_sampler.cc
index 7cb929647f..fdf96e9d5b 100644
--- a/base/sampling_heap_profiler/poisson_allocation_sampler.cc
+++ b/base/sampling_heap_profiler/poisson_allocation_sampler.cc
@@ -19,6 +19,8 @@
#include "base/rand_util.h"
#include "build/build_config.h"
+#define ThreadLocalData ThreadLocalData_PoissonAllocationSampler
+
namespace base {
namespace {
@@ -60,7 +62,7 @@ struct ThreadLocalData {
// Returns an object storing thread-local state. This does NOT use
// base::ThreadLocalStorage, so it's safe to call from hooks in the
// base::ThreadLocalStorage implementation.
-ThreadLocalData* GetThreadLocalData() {
+ThreadLocalData* GetThreadLocalData_PoissonAllocationSampler() {
#if USE_LOCAL_TLS_EMULATION()
// If available, use ThreadLocalStorage to bypass dependencies introduced by
// Clang's implementation of thread_local.
@@ -96,6 +98,8 @@ ThreadLocalData* GetThreadLocalData() {
} // namespace
+#define GetThreadLocalData GetThreadLocalData_PoissonAllocationSampler
+
PoissonAllocationSamplerStats::PoissonAllocationSamplerStats(
size_t address_cache_hits,
size_t address_cache_misses,
@@ -498,3 +502,6 @@ void PoissonAllocationSampler::RemoveSamplesObserver(
}
} // namespace base
+
+#undef ThreadLocalData
+#undef GetThreadLocalData
diff --git a/base/sampling_heap_profiler/sampling_heap_profiler.cc b/base/sampling_heap_profiler/sampling_heap_profiler.cc
index 60e96b0081..de29c802f6 100644
--- a/base/sampling_heap_profiler/sampling_heap_profiler.cc
+++ b/base/sampling_heap_profiler/sampling_heap_profiler.cc
@@ -35,6 +35,8 @@
#include <sys/prctl.h>
#endif
+#define ThreadLocalData ThreadLocalData_SamplingHeapProfiler
+
namespace base {
constexpr uint32_t kMaxStackEntries = 256;
@@ -45,7 +47,7 @@ struct ThreadLocalData {
const char* thread_name = nullptr;
};
-ThreadLocalData* GetThreadLocalData() {
+ThreadLocalData* ThreadLocalData_GetThreadLocalData() {
#if USE_LOCAL_TLS_EMULATION()
static base::NoDestructor<
base::allocator::dispatcher::ThreadLocalStorage<ThreadLocalData>>
@@ -57,6 +59,8 @@ ThreadLocalData* GetThreadLocalData() {
#endif
}
+#define GetThreadLocalData ThreadLocalData_GetThreadLocalData
+
using StackUnwinder = SamplingHeapProfiler::StackUnwinder;
using base::allocator::dispatcher::AllocationSubsystem;
@@ -334,3 +338,6 @@ SamplingHeapProfiler::MuteHookedSamplesForTesting() {
}
} // namespace base
+
+#undef ThreadLocalData
+#undef GetThreadLocalData
diff --git a/base/task/sequenced_task_runner.cc b/base/task/sequenced_task_runner.cc
index 833b9c5dc6..d46ef2df9b 100644
--- a/base/task/sequenced_task_runner.cc
+++ b/base/task/sequenced_task_runner.cc
@@ -10,6 +10,8 @@
#include "base/task/default_delayed_task_handle_delegate.h"
#include "base/time/time.h"
+#define current_default_handle current_default_handle_sequenced_task_runner
+
namespace base {
namespace {
@@ -138,3 +140,5 @@ OnTaskRunnerDeleter& OnTaskRunnerDeleter::operator=(OnTaskRunnerDeleter&&) =
default;
} // namespace base
+
+#undef current_default_handle
diff --git a/base/task/single_thread_task_runner.cc b/base/task/single_thread_task_runner.cc
index 651267a81a..179bdf2010 100644
--- a/base/task/single_thread_task_runner.cc
+++ b/base/task/single_thread_task_runner.cc
@@ -15,6 +15,8 @@
#include "base/lazy_instance.h"
#include "base/run_loop.h"
+#define current_default_handle current_default_handle_single_thread_task_runner
+
namespace base {
namespace {
@@ -100,3 +102,5 @@ SingleThreadTaskRunner::CurrentHandleOverrideForTesting::
~CurrentHandleOverrideForTesting() = default;
} // namespace base
+
+#undef current_default_handle
diff --git a/cc/cc.gni b/cc/cc.gni
index 090420c902..6b0e76bf21 100644
--- a/cc/cc.gni
+++ b/cc/cc.gni
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/jumbo.gni")
import("//testing/test.gni")
cc_remove_configs = []
@@ -16,7 +17,7 @@ if (!is_debug) {
}
template("cc_component") {
- component(target_name) {
+ jumbo_component(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
if (defined(invoker.configs)) {
configs += invoker.configs
@@ -27,7 +28,7 @@ template("cc_component") {
}
template("cc_test_static_library") {
- static_library(target_name) {
+ jumbo_static_library(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
if (defined(invoker.configs)) {
configs += invoker.configs
diff --git a/components/viz/service/display/occlusion_culler.cc b/components/viz/service/display/occlusion_culler.cc
index f1683759c5..d0c279961b 100644
--- a/components/viz/service/display/occlusion_culler.cc
+++ b/components/viz/service/display/occlusion_culler.cc
@@ -23,6 +23,8 @@
#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/geometry/rect_conversions.h"
+#define kEpsilon kEpsilon_OcclusionCuller
+
namespace viz {
namespace {
@@ -457,3 +459,5 @@ bool OcclusionCuller::CanSplitDrawQuad(
}
} // namespace viz
+
+#undef kEpsilon
diff --git a/components/viz/service/display/overlay_candidate_factory.cc b/components/viz/service/display/overlay_candidate_factory.cc
index a85234ab61..86c3a05767 100644
--- a/components/viz/service/display/overlay_candidate_factory.cc
+++ b/components/viz/service/display/overlay_candidate_factory.cc
@@ -95,6 +95,8 @@ gfx::OverlayTransform GetOverlayTransform(const gfx::Transform& quad_transform,
}
}
+#define kEpsilon kEpsilon_OverlayCandidate
+
constexpr double kEpsilon = 0.0001;
// Determine why the transformation isn't axis aligned. A transform with z
@@ -837,3 +839,5 @@ gfx::RectF OverlayCandidateFactory::GetDamageRect(const DrawQuad* quad) const {
}
} // namespace viz
+
+#undef kEpsilon
diff --git a/components/viz/service/display/skia_renderer.cc b/components/viz/service/display/skia_renderer.cc
index cd99df43f8..5a62f57170 100644
--- a/components/viz/service/display/skia_renderer.cc
+++ b/components/viz/service/display/skia_renderer.cc
@@ -108,6 +108,8 @@
#include "components/viz/service/display/overlay_processor_surface_control.h"
#endif
+#define MakeOpacityFilter MakeOpacityFilter_SkiaRenderer
+
namespace viz {
namespace {
@@ -4517,3 +4519,5 @@ bool SkiaRenderer::OverlayLockKeyEqual::operator()(
#endif
} // namespace viz
+
+#undef MakeOpacityFilter
diff --git a/components/viz/service/display/software_renderer.cc b/components/viz/service/display/software_renderer.cc
index f935227bf9..8b41007c0f 100644
--- a/components/viz/service/display/software_renderer.cc
+++ b/components/viz/service/display/software_renderer.cc
@@ -54,6 +54,8 @@
#include "ui/gfx/geometry/skia_conversions.h"
#include "ui/gfx/geometry/transform.h"
+#define MakeOpacityFilter MakeOpacityFilter_SoftwareRenderer
+
namespace viz {
namespace {
@@ -1106,3 +1108,5 @@ gfx::Rect SoftwareRenderer::GetRenderPassBackingDrawnRect(
}
} // namespace viz
+
+#undef MakeOpacityFilter
diff --git a/components/viz/service/frame_sinks/frame_sink_manager_impl.h b/components/viz/service/frame_sinks/frame_sink_manager_impl.h
index 8abd5ef50a..4201fb4838 100644
--- a/components/viz/service/frame_sinks/frame_sink_manager_impl.h
+++ b/components/viz/service/frame_sinks/frame_sink_manager_impl.h
@@ -5,6 +5,9 @@
#ifndef COMPONENTS_VIZ_SERVICE_FRAME_SINKS_FRAME_SINK_MANAGER_IMPL_H_
#define COMPONENTS_VIZ_SERVICE_FRAME_SINKS_FRAME_SINK_MANAGER_IMPL_H_
+// Macro 'Status' from X11/Xlib.h will cause confliction
+#undef Status
+
#include <stdint.h>
#include <list>
diff --git a/components/viz/viz.gni b/components/viz/viz.gni
index 191ddca368..a4008193b5 100644
--- a/components/viz/viz.gni
+++ b/components/viz/viz.gni
@@ -2,6 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/jumbo.gni")
import("//gpu/vulkan/features.gni")
import("//skia/features.gni")
import("//testing/test.gni")
@@ -33,7 +34,7 @@ if (!is_debug) {
}
template("viz_source_set") {
- source_set(target_name) {
+ jumbo_source_set(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
if (defined(invoker.configs)) {
configs += invoker.configs
@@ -44,7 +45,7 @@ template("viz_source_set") {
}
template("viz_component") {
- component(target_name) {
+ jumbo_component(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
if (defined(invoker.configs)) {
configs += invoker.configs
@@ -55,7 +56,7 @@ template("viz_component") {
}
template("viz_static_library") {
- static_library(target_name) {
+ jumbo_static_library(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
if (defined(invoker.configs)) {
configs += invoker.configs