I have been following the steps detailed in the page below to cross compile and build chromium (v87) for a Linux ARM device: https://chromium.googlesource.com/chromium/src/+/master/docs/linux/build_instructions.md
I have successfully built the chrome binary for an ARM target, but my goal now is to try and reduce the size of the chrome binary output which is given after a successful build. At the moment the chrome binary is sized at 190mb which is too large considering the previous chromium (v70) build which was performed years ago had the chrome binary output sized at ~80mb.
I believe the drastic size increase could be due to the large amount of dependencies included in the newer chromium release meaning additional deps files generated by gn gen out/***
or gn args out/***
and I have been looking for ways to try and cut out unneeded libraries to generate a smaller chrome binary. I attempted to modify the root file BUILD.GN
found in the root of the chromium directory, to set certain vars to false in an attempt to stop the gn command from adding unwanted library/dependency deps files, however this still causes the same number of dependency files to be placed in my build output folder and performing autoninja -C out/*** chrome
to build chrome results in a large chrome binary (190mb) to be given again:
# Copyright (c) 2013 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.
# This is the root build file for GN. GN will start processing by loading this
# file, and recursively load all dependencies until all dependencies are either
# resolved or known not to exist (which will cause the build to fail). So if
# you add a new build file, there must be some path of dependencies from this
# file to your new one or GN won't know about it.
import("//build/config/chromeos/ui_mode.gni")
import("//build/config/compiler/compiler.gni")
import("//build/config/features.gni")
import("//build/config/sanitizers/sanitizers.gni")
import("//build/config/ui.gni")
import("//build/gn_logs.gni")
import("//build/util/generate_wrapper.gni")
import("//chrome/browser/buildflags.gni")
import("//chrome/browser/media/router/features.gni")
import("//components/nacl/features.gni")
import("//device/vr/buildflags/buildflags.gni")
import("//extensions/buildflags/buildflags.gni")
import("//gpu/vulkan/features.gni")
import("//media/gpu/args.gni")
import("//media/media_options.gni")
import("//remoting/remoting_enable.gni")
import("//third_party/closure_compiler/compile_js.gni")
import("//third_party/openh264/openh264_args.gni")
import("//tools/ipc_fuzzer/ipc_fuzzer.gni")
import("//ui/base/ui_features.gni")
import("//ui/gl/features.gni")
import("//v8/gni/snapshot_toolchain.gni")
import("//v8/gni/v8.gni")
#Variable declarations in an attempt to stop building certain dependencies/packages:
#enable_openscreen = false
#enable_remoting = false
#enable_nacl = false
#media_use_ffmpeg = false
#use_openh264 = false
#enable_vulkan = false
#enable_ipc_fuzzer = false
#enable_vr = false
Below is my args.gn parameters which I have used to build the 190mb chromium binary:
target_cpu="arm"
arm_version=7
target_os="linux"
arm_arch="armv7-a"
arm_float_abi="hard"
arm_fpu="neon"
arm_tune="cortex-a9"
arm_use_neon=true
arm_use_thumb=true
use_alsa=false
use_jumbo_build=true
use_gnome_keyring=false
is_debug = false
symbol_level = 0
enable_nacl = false
blink_symbol_level=0
# Set build arguments here. See `gn help buildargs`.
Any help or guidance on how I can reduce the size of the chrome output file would be greatly appreciated.