Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Unified Diff: BUILD.gn

Issue 874393007: Use target_cpu instead of cpu_arch in BUILD.gn (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: updates Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: BUILD.gn
diff --git a/BUILD.gn b/BUILD.gn
index 98a8b382cd805804ccba471efb06c6c3aeecd847..827cd2c366bbdf2a7c4d3cf8792a78b102b7ee2c 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -2,6 +2,10 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build/config/android/config.gni")
+import("//build/config/arm.gni")
+import("//build/config/mips.gni")
+
# Because standalone V8 builds are not supported, assume this is part of a
# Chromium build.
import("//build/module_args/v8.gni")
@@ -18,23 +22,19 @@ v8_interpreted_regexp = false
v8_object_print = false
v8_postmortem_support = false
v8_use_snapshot = true
-
-# TODO(GYP): We should be just target_cpu and not need v8_target_arch.
-v8_target_arch = current_cpu
-
+v8_target_arch = target_cpu
v8_random_seed = "314159265"
v8_toolset_for_d8 = "host"
# The snapshot needs to be compiled for the host, but compiled with
# a toolchain that matches the bit-width of the target.
#
-# TODO(GYP): For now we only support 32-bit little-endian target builds from
-# an x86/x64 Linux host. Eventually we need to support all of the
-# host/target configurations v8 runs on.
-if (target_os == "android" || target_os == "chromeos") {
- assert(host_os == "linux" &&
- (host_cpu == "x86" || host_cpu == "x64") &&
- (target_cpu == "arm" || target_cpu == "mipsel" || target_cpu == "x86"))
+# TODO(GYP): For now we only support 32-bit little-endian target builds from an
+# x64 Linux host. Eventually we need to support all of the host/target
+# configurations v8 runs on.
+if (host_cpu == "x64" &&
+ (target_cpu == "arm" || target_cpu == "mipsel" || target_cpu == "x86")) {
+ assert(host_os == "linux")
Dirk Pranke 2015/03/12 17:53:03 This is definitely simpler and an improvement.
snapshot_toolchain = "//build/toolchain/linux:clang_x86"
} else {
snapshot_toolchain = default_toolchain
@@ -118,29 +118,36 @@ config("toolchain") {
if (v8_target_arch == "arm") {
defines += [ "V8_TARGET_ARCH_ARM" ]
- if (arm_version == 7) {
- defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
- }
- if (arm_fpu == "vfpv3-d16") {
- defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
- }
- if (arm_fpu == "vfpv3") {
- defines += [
- "CAN_USE_VFP3_INSTRUCTIONS",
- "CAN_USE_VFP32DREGS",
- ]
- }
- if (arm_fpu == "neon") {
+ if (current_cpu == "arm") {
+ if (arm_version == 7) {
+ defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
+ }
+ if (arm_fpu == "vfpv3-d16") {
+ defines += [ "CAN_USE_VFP3_INSTRUCTIONS" ]
+ }
+ if (arm_fpu == "vfpv3") {
Dirk Pranke 2015/03/12 17:53:03 nit: I'd probably write lines 128 and 134 as 'else
+ defines += [
+ "CAN_USE_VFP3_INSTRUCTIONS",
+ "CAN_USE_VFP32DREGS",
+ ]
+ }
+ if (arm_fpu == "neon") {
+ defines += [
+ "CAN_USE_VFP3_INSTRUCTIONS",
+ "CAN_USE_VFP32DREGS",
+ "CAN_USE_NEON",
+ ]
+ }
+ } else {
defines += [
Dirk Pranke 2015/03/12 17:53:03 We only get into this branch when building mksnaps
+ "CAN_USE_ARMV7_INSTRUCTIONS",
"CAN_USE_VFP3_INSTRUCTIONS",
"CAN_USE_VFP32DREGS",
- "CAN_USE_NEON",
+ "USE_EABI_HARDFLOAT=0",
]
}
# TODO(jochen): Add support for arm_test_noprobe.
-
- # TODO(jochen): Add support for cpu_arch != v8_target_arch/
}
if (v8_target_arch == "arm64") {
defines += [ "V8_TARGET_ARCH_ARM64" ]
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698