mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-09 11:27:32 -03:00
arm updates
This commit is contained in:
parent
e4245f71d4
commit
064ca36ba5
2 changed files with 25 additions and 197 deletions
|
@ -1,184 +0,0 @@
|
|||
# Copyright 2024 The Chromium Authors and Alex313031.
|
||||
# Use of this source code is governed by a BSD-style license that can be
|
||||
# found in the LICENSE file.
|
||||
|
||||
import("//build/config/chromeos/ui_mode.gni")
|
||||
import("//build/config/v8_target_cpu.gni")
|
||||
|
||||
# These are primarily relevant in current_cpu == "arm" contexts, where
|
||||
# ARM code is being compiled. But they can also be relevant in the
|
||||
# other contexts when the code will change its behavior based on the
|
||||
# cpu it wants to generate code for.
|
||||
if (current_cpu == "arm" || v8_current_cpu == "arm") {
|
||||
declare_args() {
|
||||
# Version of the ARM processor when compiling on ARM. Ignored on non-ARM
|
||||
# platforms.
|
||||
arm_version = 7
|
||||
|
||||
# The ARM architecture. This will be a string like "armv6" or "armv7-a".
|
||||
# An empty string means to use the default for the arm_version.
|
||||
arm_arch = ""
|
||||
|
||||
# The ARM floating point hardware. This will be a string like "neon" or
|
||||
# "vfpv3". An empty string means to use the default for the arm_version.
|
||||
arm_fpu = ""
|
||||
|
||||
# The ARM variant-specific tuning mode. This will be a string like "armv6"
|
||||
# or "cortex-a15". An empty string means to use the default for the
|
||||
# arm_version.
|
||||
arm_tune = ""
|
||||
|
||||
# Whether to use the neon FPU instruction set or not.
|
||||
arm_use_neon = ""
|
||||
|
||||
# Whether to enable optional NEON code paths.
|
||||
arm_optionally_use_neon = false
|
||||
|
||||
# Thumb is a reduced instruction set available on some ARM processors that
|
||||
# has increased code density.
|
||||
arm_use_thumb = true
|
||||
}
|
||||
|
||||
# For lacros build, we use ARM v8 by default.
|
||||
if (is_chromeos_lacros && arm_arch == "") {
|
||||
# TODO(crbug.com/1467681) Enable i8mm and dotprod instructions for ffmpeg
|
||||
# if ever we update to a version of arm that supports these instructions.
|
||||
arm_version = 8
|
||||
arm_arch = "armv8-a+crc"
|
||||
}
|
||||
|
||||
if (current_os == "android" || target_os == "android") {
|
||||
arm_float_abi = "softfp"
|
||||
} else {
|
||||
declare_args() {
|
||||
# The ARM floating point mode. This is either the string "hard", "soft",
|
||||
# or "softfp". An empty string means to use the default one for the
|
||||
# arm_version.
|
||||
arm_float_abi = ""
|
||||
}
|
||||
}
|
||||
assert(arm_float_abi == "" || arm_float_abi == "hard" ||
|
||||
arm_float_abi == "soft" || arm_float_abi == "softfp")
|
||||
|
||||
if (arm_use_neon == "") {
|
||||
if (current_os == "linux" && target_cpu != v8_target_cpu) {
|
||||
# Don't use neon on V8 simulator builds as a default.
|
||||
arm_use_neon = false
|
||||
} else {
|
||||
arm_use_neon = true
|
||||
}
|
||||
}
|
||||
|
||||
if (arm_version == 6) {
|
||||
if (arm_arch == "") {
|
||||
# v8 can still with version 6 but only with the armv6k extension.
|
||||
arm_arch = "armv6k"
|
||||
}
|
||||
if (arm_tune != "") {
|
||||
arm_tune = ""
|
||||
}
|
||||
if (arm_float_abi == "") {
|
||||
arm_float_abi = "softfp"
|
||||
}
|
||||
if (arm_fpu == "") {
|
||||
arm_fpu = "vfp"
|
||||
}
|
||||
arm_use_thumb = false
|
||||
arm_use_neon = false
|
||||
} else if (arm_version == 7) {
|
||||
if (arm_arch == "") {
|
||||
arm_arch = "armv7-a"
|
||||
}
|
||||
|
||||
if (arm_float_abi == "") {
|
||||
if (current_os == "linux" && target_cpu != v8_target_cpu) {
|
||||
# Default to the same as Android for V8 simulator builds.
|
||||
arm_float_abi = "softfp"
|
||||
} else {
|
||||
arm_float_abi = "hard"
|
||||
}
|
||||
}
|
||||
|
||||
if (arm_fpu == "") {
|
||||
if (arm_use_neon) {
|
||||
arm_fpu = "neon"
|
||||
} else {
|
||||
arm_fpu = "vfpv3-d16"
|
||||
}
|
||||
}
|
||||
} else if (arm_version == 8) {
|
||||
if (arm_arch == "") {
|
||||
arm_arch = "armv8-a"
|
||||
}
|
||||
if (arm_tune == "") {
|
||||
arm_tune = "generic-armv8-a"
|
||||
}
|
||||
|
||||
if (arm_float_abi == "") {
|
||||
arm_float_abi = "hard"
|
||||
}
|
||||
|
||||
if (arm_fpu == "") {
|
||||
if (arm_use_neon) {
|
||||
arm_fpu = "neon"
|
||||
} else {
|
||||
arm_fpu = "vfpv3-d16"
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (current_cpu == "arm64" || v8_current_cpu == "arm64") {
|
||||
declare_args() {
|
||||
# Enables the new Armv8 branch protection features. Valid strings are:
|
||||
# - "pac": Enables Pointer Authentication Code (PAC, featured in Armv8.3)
|
||||
# - "standard": Enables both PAC and Branch Target Identification (Armv8.5).
|
||||
# - "none": No branch protection.
|
||||
arm_control_flow_integrity = "none"
|
||||
|
||||
# Version of the ARM processor when compiling on ARM. Ignored on non-ARM
|
||||
# platforms.
|
||||
arm_version = 8
|
||||
|
||||
# arm64 supports only "hard".
|
||||
arm_float_abi = "hard"
|
||||
|
||||
# The ARM64 architecture. This will be a string like "armv8-a" or "armv8.5-a.
|
||||
# An empty string means to use the default for the arm_version.
|
||||
arm_arch = "armv8-a"
|
||||
|
||||
# The ARM variant-specific tuning mode. This will be a string like "armv6"
|
||||
# or "cortex-a15". An empty string means to use the default for the
|
||||
# arm_version.
|
||||
arm_tune = "generic-armv8-a"
|
||||
|
||||
# The ARM64 floating point hardware. This will be a string like "neon" or
|
||||
# "vfpv3-d16". An empty string means to use the default for the arm_version.
|
||||
arm_fpu = "neon"
|
||||
|
||||
# Whether to use the neon FPU instruction set or not.
|
||||
arm_use_neon = "true"
|
||||
|
||||
# Whether to enable optional NEON code paths.
|
||||
arm_optionally_use_neon = false
|
||||
|
||||
# Thumb is a reduced instruction set available on some ARM processors that
|
||||
# has increased code density.
|
||||
arm_use_thumb = true
|
||||
|
||||
if ((is_android || is_linux) && target_cpu == "arm64") {
|
||||
# Enable PAC and BTI on AArch64 Linux/Android systems.
|
||||
# target_cpu == "arm64" filters out some cases (e.g. the ChromeOS x64
|
||||
# MSAN build) where the target platform is x64, but V8 is configured to
|
||||
# use the arm64 simulator.
|
||||
arm_control_flow_integrity = "standard"
|
||||
}
|
||||
}
|
||||
# Initial values from upstream.
|
||||
arm_version = 8
|
||||
arm_float_abi = "hard"
|
||||
arm_use_neon = true
|
||||
|
||||
assert(arm_control_flow_integrity == "none" ||
|
||||
arm_control_flow_integrity == "standard" ||
|
||||
arm_control_flow_integrity == "pac",
|
||||
"Invalid ARM branch protection option.")
|
||||
}
|
38
setup.sh
38
setup.sh
|
@ -23,12 +23,16 @@ displayHelp () {
|
|||
printf "${bold}${YEL}Use the --raspi flag for Raspberry Pi builds.${c0}\n" &&
|
||||
printf "${bold}${YEL}Use the --woa flag for Windows on ARM builds.${c0}\n" &&
|
||||
printf "${bold}${YEL}Use the --avx2 flag for AVX2 Builds.${c0}\n" &&
|
||||
printf "${bold}${YEL}Use the --sse4 flag for SSE4.1 Builds.${c0}\n" &&
|
||||
printf "${bold}${YEL}Use the --sse3 flag for SSE3 Builds.${c0}\n" &&
|
||||
printf "${bold}${YEL}Use the --sse2 flag for 32 bit SSE2 Builds.${c0}\n" &&
|
||||
printf "${bold}${YEL}Use the --android flag for Android Builds.${c0}\n" &&
|
||||
printf "${bold}${YEL}Use the --cros flag for ChromiumOS Builds.${c0}\n" &&
|
||||
printf "${bold}${YEL}IMPORTANT: For Polly builds, first run build_polly.sh in Thorium/infra, then use the setup_polly.sh${c0}\n" &&
|
||||
printf "${bold}${YEL}script in Thorium/other/Polly. Both of these actions should be taken AFTER running this script!${c0}\n" &&
|
||||
printf "${bold}${YEL}IMPORTANT: For Polly builds, first run build_polly.sh in ./infra before building.${c0}\n" &&
|
||||
printf "${bold}${YEL} This should be done AFTER running this setup.sh script!${c0}\n" &&
|
||||
printf "\n"
|
||||
printf "${bold}${YEL}NOTE: The \`CR_DIR\` env variable can be used to override the location of \"chromium/src\".${c0}\n" &&
|
||||
printf "${bold}${YEL} The default is $HOME/chromium/src${c0}\n" &&
|
||||
printf "\n"
|
||||
}
|
||||
case $1 in
|
||||
|
@ -79,8 +83,8 @@ cp -v infra/thor_ver ${CR_SRC_DIR}/out/thorium/ &&
|
|||
copyMacOS () {
|
||||
printf "\n" &&
|
||||
printf "${YEL}Copying files for MacOS...${c0}\n" &&
|
||||
cp -r -v arm/mac_arm.gni ${CR_SRC_DIR}/build/config/arm.gni &&
|
||||
cp -r -v other/AVX2/build/config/compiler/BUILD.gn ${CR_SRC_DIR}/build/config/compiler/ &&
|
||||
cp -v arm/mac_arm.gni ${CR_SRC_DIR}/build/config/arm.gni &&
|
||||
cp -v other/AVX2/build/config/compiler/BUILD.gn ${CR_SRC_DIR}/build/config/compiler/ &&
|
||||
cp -r -v arm/third_party/* ${CR_SRC_DIR}/third_party/ &&
|
||||
printf "\n"
|
||||
}
|
||||
|
@ -97,7 +101,6 @@ copyRaspi () {
|
|||
cp -r -v arm/raspi/* ${CR_SRC_DIR}/ &&
|
||||
cp -v pak_src/binaries/pak_arm64 ${CR_SRC_DIR}/out/thorium/pak &&
|
||||
#./infra/fix_libaom.sh &&
|
||||
cp -r -v arm/build/config/* ${CR_SRC_DIR}/build/config/ &&
|
||||
printf "\n" &&
|
||||
cp -r -v arm/raspi/build/config/* ${CR_SRC_DIR}/build/config/ &&
|
||||
printf "\n" &&
|
||||
|
@ -112,9 +115,9 @@ esac
|
|||
copyWOA () {
|
||||
printf "\n" &&
|
||||
printf "${YEL}Copying Windows on ARM build files...${c0}\n" &&
|
||||
cp -r -v arm/build/config/* ${CR_SRC_DIR}/build/config/ &&
|
||||
cp -r -v arm/third_party/* ${CR_SRC_DIR}/third_party/ &&
|
||||
cp -r -v arm/woa_arm.gni ${CR_SRC_DIR}/build/config/arm.gni &&
|
||||
# Use regular arm.gni from src, pending further testing
|
||||
# cp -v arm/woa_arm.gni ${CR_SRC_DIR}/build/config/arm.gni &&
|
||||
printf "\n"
|
||||
}
|
||||
case $1 in
|
||||
|
@ -126,22 +129,32 @@ copyAVX2 () {
|
|||
printf "\n" &&
|
||||
printf "${YEL}Copying AVX2 build files...${c0}\n" &&
|
||||
cp -r -v other/AVX2/build/config/* ${CR_SRC_DIR}/build/config/ &&
|
||||
cp -r -v other/AVX2/v8/* ${CR_SRC_DIR}/v8/ &&
|
||||
cp -r -v other/AVX2/third_party/* ${CR_SRC_DIR}/third_party/ &&
|
||||
cp -r -v other/AVX2/thor_ver ${CR_SRC_DIR}/out/thorium/ &&
|
||||
cp -v other/AVX2/thor_ver ${CR_SRC_DIR}/out/thorium/ &&
|
||||
printf "\n"
|
||||
}
|
||||
case $1 in
|
||||
--avx2) copyAVX2;
|
||||
esac
|
||||
|
||||
# Copy SSE4.1 files
|
||||
copySSE4 () {
|
||||
printf "\n" &&
|
||||
printf "${YEL}Copying SSE4.1 build files...${c0}\n" &&
|
||||
cp -r -v other/SSE4.1/build/config/* ${CR_SRC_DIR}/build/config/ &&
|
||||
cp -v other/SSE4.1/thor_ver ${CR_SRC_DIR}/out/thorium/ &&
|
||||
printf "\n"
|
||||
}
|
||||
case $1 in
|
||||
--sse4) copySSE4;
|
||||
esac
|
||||
|
||||
# Copy SSE3 files
|
||||
copySSE3 () {
|
||||
printf "\n" &&
|
||||
printf "${YEL}Copying SSE3 build files...${c0}\n" &&
|
||||
cp -r -v other/SSE3/build/config/* ${CR_SRC_DIR}/build/config/ &&
|
||||
cp -r -v other/SSE3/v8/* ${CR_SRC_DIR}/v8/ &&
|
||||
cp -r -v other/SSE3/thor_ver ${CR_SRC_DIR}/out/thorium/ &&
|
||||
cp -v other/SSE3/thor_ver ${CR_SRC_DIR}/out/thorium/ &&
|
||||
printf "\n"
|
||||
}
|
||||
case $1 in
|
||||
|
@ -153,7 +166,7 @@ copySSE2 () {
|
|||
printf "\n" &&
|
||||
printf "${YEL}Copying SSE2 (32-bit) build files...${c0}\n" &&
|
||||
cp -r -v other/SSE2/build/config/* ${CR_SRC_DIR}/build/config/ &&
|
||||
cp -r -v other/SSE2/thor_ver ${CR_SRC_DIR}/out/thorium/ &&
|
||||
cp -v other/SSE2/thor_ver ${CR_SRC_DIR}/out/thorium/ &&
|
||||
printf "\n"
|
||||
}
|
||||
case $1 in
|
||||
|
@ -164,7 +177,6 @@ esac
|
|||
copyAndroid () {
|
||||
printf "\n" &&
|
||||
printf "${YEL}Copying Android (ARM64 and ARM32) build files...${c0}\n" &&
|
||||
cp -r -v arm/build/config/* ${CR_SRC_DIR}/build/config/ &&
|
||||
cp -r -v arm/media/* ${CR_SRC_DIR}/media/ &&
|
||||
cp -r -v arm/third_party/* ${CR_SRC_DIR}/third_party/ &&
|
||||
printf "\n" &&
|
||||
|
|
Loading…
Reference in a new issue