mirror of
https://github.com/Alex313031/thorium.git
synced 2025-01-10 11:57:48 -03:00
Add arm.gni for arm builds for armv8.5-a
This commit is contained in:
parent
86c569af6f
commit
912ea3ed08
1 changed files with 137 additions and 0 deletions
137
build/config/arm.gni
Normal file
137
build/config/arm.gni
Normal file
|
@ -0,0 +1,137 @@
|
|||
# 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/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 = 8
|
||||
|
||||
# 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 = "armv8.5-a"
|
||||
|
||||
# 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 = "armv8.5-a"
|
||||
|
||||
# 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
|
||||
}
|
||||
|
||||
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 == "") {
|
||||
arm_arch = "armv6"
|
||||
}
|
||||
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_tune == "") {
|
||||
arm_tune = "generic-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") {
|
||||
# arm64 supports only "hard".
|
||||
arm_float_abi = "hard"
|
||||
arm_use_neon = true
|
||||
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"
|
||||
}
|
||||
assert(arm_control_flow_integrity == "none" ||
|
||||
arm_control_flow_integrity == "standard" ||
|
||||
arm_control_flow_integrity == "pac",
|
||||
"Invalid branch protection option")
|
||||
}
|
Loading…
Reference in a new issue