Commit 8756f6e9 authored by dpranke's avatar dpranke Committed by Commit bot

Update GN build to use v8_target_cpu instead of v8_target_arch.

R=jochen@chromium.org, machenbach@chromium.org, thakis@chromium.org
BUG=chromium:619503

Review-Url: https://codereview.chromium.org/2074003002
Cr-Commit-Position: refs/heads/master@{#37048}
parent d5f2ac5e
...@@ -165,7 +165,7 @@ config("toolchain") { ...@@ -165,7 +165,7 @@ config("toolchain") {
defines = [] defines = []
cflags = [] cflags = []
if (v8_target_arch == "arm") { if (v8_target_cpu == "arm") {
defines += [ "V8_TARGET_ARCH_ARM" ] defines += [ "V8_TARGET_ARCH_ARM" ]
if (arm_version == 7) { if (arm_version == 7) {
defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ] defines += [ "CAN_USE_ARMV7_INSTRUCTIONS" ]
...@@ -196,12 +196,12 @@ config("toolchain") { ...@@ -196,12 +196,12 @@ config("toolchain") {
} }
} }
} }
if (v8_target_arch == "arm64") { if (v8_target_cpu == "arm64") {
defines += [ "V8_TARGET_ARCH_ARM64" ] defines += [ "V8_TARGET_ARCH_ARM64" ]
} }
# TODO(jochen): Add support for mips. # TODO(jochen): Add support for mips.
if (v8_target_arch == "mipsel") { if (v8_target_cpu == "mipsel") {
defines += [ "V8_TARGET_ARCH_MIPS" ] defines += [ "V8_TARGET_ARCH_MIPS" ]
if (v8_can_use_fpu_instructions) { if (v8_can_use_fpu_instructions) {
defines += [ "CAN_USE_FPU_INSTRUCTIONS" ] defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
...@@ -236,7 +236,7 @@ config("toolchain") { ...@@ -236,7 +236,7 @@ config("toolchain") {
} }
# TODO(jochen): Add support for mips64. # TODO(jochen): Add support for mips64.
if (v8_target_arch == "mips64el") { if (v8_target_cpu == "mips64el") {
defines += [ "V8_TARGET_ARCH_MIPS64" ] defines += [ "V8_TARGET_ARCH_MIPS64" ]
if (v8_can_use_fpu_instructions) { if (v8_can_use_fpu_instructions) {
defines += [ "CAN_USE_FPU_INSTRUCTIONS" ] defines += [ "CAN_USE_FPU_INSTRUCTIONS" ]
...@@ -258,19 +258,19 @@ config("toolchain") { ...@@ -258,19 +258,19 @@ config("toolchain") {
defines += [ "_MIPS_ARCH_MIPS64R2" ] defines += [ "_MIPS_ARCH_MIPS64R2" ]
} }
} }
if (v8_target_arch == "s390" || v8_target_arch == "s390x") { if (v8_target_cpu == "s390" || v8_target_cpu == "s390x") {
defines += [ "V8_TARGET_ARCH_S390" ] defines += [ "V8_TARGET_ARCH_S390" ]
if (v8_target_arch == "s390x") { if (v8_target_cpu == "s390x") {
defines += [ "V8_TARGET_ARCH_S390X" ] defines += [ "V8_TARGET_ARCH_S390X" ]
} }
if (host_cpu == "x64" || host_cpu == "x86") { if (host_cpu == "x64" || host_cpu == "x86") {
defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ] defines += [ "V8_TARGET_ARCH_S390_LE_SIM" ]
} }
} }
if (v8_target_arch == "x86") { if (v8_target_cpu == "x86") {
defines += [ "V8_TARGET_ARCH_IA32" ] defines += [ "V8_TARGET_ARCH_IA32" ]
} }
if (v8_target_arch == "x64") { if (v8_target_cpu == "x64") {
defines += [ "V8_TARGET_ARCH_X64" ] defines += [ "V8_TARGET_ARCH_X64" ]
} }
...@@ -1499,7 +1499,7 @@ v8_source_set("v8_base") { ...@@ -1499,7 +1499,7 @@ v8_source_set("v8_base") {
"src/zone.h", "src/zone.h",
] ]
if (v8_target_arch == "x86") { if (v8_target_cpu == "x86") {
sources += [ sources += [
"src/compiler/ia32/code-generator-ia32.cc", "src/compiler/ia32/code-generator-ia32.cc",
"src/compiler/ia32/instruction-codes-ia32.h", "src/compiler/ia32/instruction-codes-ia32.h",
...@@ -1537,7 +1537,7 @@ v8_source_set("v8_base") { ...@@ -1537,7 +1537,7 @@ v8_source_set("v8_base") {
"src/regexp/ia32/regexp-macro-assembler-ia32.cc", "src/regexp/ia32/regexp-macro-assembler-ia32.cc",
"src/regexp/ia32/regexp-macro-assembler-ia32.h", "src/regexp/ia32/regexp-macro-assembler-ia32.h",
] ]
} else if (v8_target_arch == "x64") { } else if (v8_target_cpu == "x64") {
sources += [ sources += [
"src/compiler/x64/code-generator-x64.cc", "src/compiler/x64/code-generator-x64.cc",
"src/compiler/x64/instruction-codes-x64.h", "src/compiler/x64/instruction-codes-x64.h",
...@@ -1575,7 +1575,7 @@ v8_source_set("v8_base") { ...@@ -1575,7 +1575,7 @@ v8_source_set("v8_base") {
"src/x64/macro-assembler-x64.cc", "src/x64/macro-assembler-x64.cc",
"src/x64/macro-assembler-x64.h", "src/x64/macro-assembler-x64.h",
] ]
} else if (v8_target_arch == "arm") { } else if (v8_target_cpu == "arm") {
sources += [ sources += [
"src/arm/assembler-arm-inl.h", "src/arm/assembler-arm-inl.h",
"src/arm/assembler-arm.cc", "src/arm/assembler-arm.cc",
...@@ -1618,7 +1618,7 @@ v8_source_set("v8_base") { ...@@ -1618,7 +1618,7 @@ v8_source_set("v8_base") {
"src/regexp/arm/regexp-macro-assembler-arm.cc", "src/regexp/arm/regexp-macro-assembler-arm.cc",
"src/regexp/arm/regexp-macro-assembler-arm.h", "src/regexp/arm/regexp-macro-assembler-arm.h",
] ]
} else if (v8_target_arch == "arm64") { } else if (v8_target_cpu == "arm64") {
sources += [ sources += [
"src/arm64/assembler-arm64-inl.h", "src/arm64/assembler-arm64-inl.h",
"src/arm64/assembler-arm64.cc", "src/arm64/assembler-arm64.cc",
...@@ -1674,7 +1674,7 @@ v8_source_set("v8_base") { ...@@ -1674,7 +1674,7 @@ v8_source_set("v8_base") {
"src/regexp/arm64/regexp-macro-assembler-arm64.cc", "src/regexp/arm64/regexp-macro-assembler-arm64.cc",
"src/regexp/arm64/regexp-macro-assembler-arm64.h", "src/regexp/arm64/regexp-macro-assembler-arm64.h",
] ]
} else if (v8_target_arch == "mipsel") { } else if (v8_target_cpu == "mipsel") {
sources += [ sources += [
"src/compiler/mips/code-generator-mips.cc", "src/compiler/mips/code-generator-mips.cc",
"src/compiler/mips/instruction-codes-mips.h", "src/compiler/mips/instruction-codes-mips.h",
...@@ -1716,7 +1716,7 @@ v8_source_set("v8_base") { ...@@ -1716,7 +1716,7 @@ v8_source_set("v8_base") {
"src/regexp/mips/regexp-macro-assembler-mips.cc", "src/regexp/mips/regexp-macro-assembler-mips.cc",
"src/regexp/mips/regexp-macro-assembler-mips.h", "src/regexp/mips/regexp-macro-assembler-mips.h",
] ]
} else if (v8_target_arch == "mips64el") { } else if (v8_target_cpu == "mips64el") {
sources += [ sources += [
"src/compiler/mips64/code-generator-mips64.cc", "src/compiler/mips64/code-generator-mips64.cc",
"src/compiler/mips64/instruction-codes-mips64.h", "src/compiler/mips64/instruction-codes-mips64.h",
...@@ -1758,7 +1758,7 @@ v8_source_set("v8_base") { ...@@ -1758,7 +1758,7 @@ v8_source_set("v8_base") {
"src/regexp/mips64/regexp-macro-assembler-mips64.cc", "src/regexp/mips64/regexp-macro-assembler-mips64.cc",
"src/regexp/mips64/regexp-macro-assembler-mips64.h", "src/regexp/mips64/regexp-macro-assembler-mips64.h",
] ]
} else if (v8_target_arch == "s390" || v8_target_arch == "s390x") { } else if (v8_target_cpu == "s390" || v8_target_cpu == "s390x") {
sources += [ sources += [
"src/compiler/s390/code-generator-s390.cc", "src/compiler/s390/code-generator-s390.cc",
"src/compiler/s390/instruction-codes-s390.h", "src/compiler/s390/instruction-codes-s390.h",
......
...@@ -4,17 +4,18 @@ ...@@ -4,17 +4,18 @@
import("//build/config/features.gni") import("//build/config/features.gni")
import("//build/config/ui.gni") import("//build/config/ui.gni")
import("//build/config/v8_target_cpu.gni")
import("//gni/v8.gni") import("//gni/v8.gni")
if (is_android) { if (is_android) {
import("//build/config/android/config.gni") import("//build/config/android/config.gni")
} }
if (((v8_target_arch == "ia32" || if (((v8_target_cpu == "ia32" ||
v8_target_arch == "x64" || v8_target_cpu == "x64" ||
v8_target_arch=="x87") && v8_target_cpu=="x87") &&
(is_linux || is_mac)) || (is_linux || is_mac)) ||
(v8_target_arch == "ppc64" && is_linux)) { (v8_target_cpu == "ppc64" && is_linux)) {
v8_enable_gdbjit = true v8_enable_gdbjit = true
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
import("//build/config/sanitizers/sanitizers.gni") import("//build/config/v8_target_cpu.gni")
declare_args() { declare_args() {
# Turns on compiler optimizations in V8 in Debug build. # Turns on compiler optimizations in V8 in Debug build.
...@@ -15,21 +15,6 @@ declare_args() { ...@@ -15,21 +15,6 @@ declare_args() {
# Use external files for startup data blobs: # Use external files for startup data blobs:
# the JS builtins sources and the start snapshot. # the JS builtins sources and the start snapshot.
v8_use_external_startup_data = !is_ios v8_use_external_startup_data = !is_ios
# V8 generates code for this architecture. If v8_target_arch differs from
# target_cpu, a simulator will be run.
v8_target_arch = ""
}
if (v8_target_arch == "") {
if (is_msan) {
# Running the V8-generated code on an ARM simulator is a powerful hack that
# allows the tool to see the memory accesses from JITted code. Without this
# flag, JS code causes false positive reports from MSan.
v8_target_arch = "arm64"
} else {
v8_target_arch = target_cpu
}
} }
############################################################################### ###############################################################################
......
...@@ -173,7 +173,7 @@ v8_executable("cctest") { ...@@ -173,7 +173,7 @@ v8_executable("cctest") {
"wasm/wasm-run-utils.h", "wasm/wasm-run-utils.h",
] ]
if (v8_target_arch == "arm") { if (v8_target_cpu == "arm") {
sources += [ sources += [
"test-assembler-arm.cc", "test-assembler-arm.cc",
"test-code-stubs-arm.cc", "test-code-stubs-arm.cc",
...@@ -182,7 +182,7 @@ v8_executable("cctest") { ...@@ -182,7 +182,7 @@ v8_executable("cctest") {
"test-macro-assembler-arm.cc", "test-macro-assembler-arm.cc",
"test-run-wasm-relocation-arm.cc", "test-run-wasm-relocation-arm.cc",
] ]
} else if (v8_target_arch == "arm64") { } else if (v8_target_cpu == "arm64") {
sources += [ sources += [
"test-assembler-arm64.cc", "test-assembler-arm64.cc",
"test-code-stubs-arm64.cc", "test-code-stubs-arm64.cc",
...@@ -194,7 +194,7 @@ v8_executable("cctest") { ...@@ -194,7 +194,7 @@ v8_executable("cctest") {
"test-run-wasm-relocation-arm64.cc", "test-run-wasm-relocation-arm64.cc",
"test-utils-arm64.cc", "test-utils-arm64.cc",
] ]
} else if (v8_target_arch == "x86") { } else if (v8_target_cpu == "x86") {
sources += [ sources += [
"test-assembler-ia32.cc", "test-assembler-ia32.cc",
"test-code-stubs-ia32.cc", "test-code-stubs-ia32.cc",
...@@ -204,7 +204,7 @@ v8_executable("cctest") { ...@@ -204,7 +204,7 @@ v8_executable("cctest") {
"test-macro-assembler-ia32.cc", "test-macro-assembler-ia32.cc",
"test-run-wasm-relocation-ia32.cc", "test-run-wasm-relocation-ia32.cc",
] ]
} else if (v8_target_arch == "mips") { } else if (v8_target_cpu == "mips") {
sources += [ sources += [
"test-assembler-mips.cc", "test-assembler-mips.cc",
"test-code-stubs-mips.cc", "test-code-stubs-mips.cc",
...@@ -212,7 +212,7 @@ v8_executable("cctest") { ...@@ -212,7 +212,7 @@ v8_executable("cctest") {
"test-disasm-mips.cc", "test-disasm-mips.cc",
"test-macro-assembler-mips.cc", "test-macro-assembler-mips.cc",
] ]
} else if (v8_target_arch == "mipsel") { } else if (v8_target_cpu == "mipsel") {
sources += [ sources += [
"test-assembler-mips.cc", "test-assembler-mips.cc",
"test-code-stubs-mips.cc", "test-code-stubs-mips.cc",
...@@ -220,7 +220,7 @@ v8_executable("cctest") { ...@@ -220,7 +220,7 @@ v8_executable("cctest") {
"test-disasm-mips.cc", "test-disasm-mips.cc",
"test-macro-assembler-mips.cc", "test-macro-assembler-mips.cc",
] ]
} else if (v8_target_arch == "mips64") { } else if (v8_target_cpu == "mips64") {
sources += [ sources += [
"test-assembler-mips64.cc", "test-assembler-mips64.cc",
"test-code-stubs-mips64.cc", "test-code-stubs-mips64.cc",
...@@ -228,7 +228,7 @@ v8_executable("cctest") { ...@@ -228,7 +228,7 @@ v8_executable("cctest") {
"test-disasm-mips64.cc", "test-disasm-mips64.cc",
"test-macro-assembler-mips64.cc", "test-macro-assembler-mips64.cc",
] ]
} else if (v8_target_arch == "mips64el") { } else if (v8_target_cpu == "mips64el") {
sources += [ sources += [
"test-assembler-mips64.cc", "test-assembler-mips64.cc",
"test-code-stubs-mips64.cc", "test-code-stubs-mips64.cc",
...@@ -236,7 +236,7 @@ v8_executable("cctest") { ...@@ -236,7 +236,7 @@ v8_executable("cctest") {
"test-disasm-mips64.cc", "test-disasm-mips64.cc",
"test-macro-assembler-mips64.cc", "test-macro-assembler-mips64.cc",
] ]
} else if (v8_target_arch == "x64") { } else if (v8_target_cpu == "x64") {
sources += [ sources += [
"test-assembler-x64.cc", "test-assembler-x64.cc",
"test-code-stubs-x64.cc", "test-code-stubs-x64.cc",
...@@ -246,7 +246,7 @@ v8_executable("cctest") { ...@@ -246,7 +246,7 @@ v8_executable("cctest") {
"test-macro-assembler-x64.cc", "test-macro-assembler-x64.cc",
"test-run-wasm-relocation-x64.cc", "test-run-wasm-relocation-x64.cc",
] ]
} else if (v8_target_arch == "x87") { } else if (v8_target_cpu == "x87") {
sources += [ sources += [
"test-assembler-x87.cc", "test-assembler-x87.cc",
"test-code-stubs-x87.cc", "test-code-stubs-x87.cc",
...@@ -256,13 +256,13 @@ v8_executable("cctest") { ...@@ -256,13 +256,13 @@ v8_executable("cctest") {
"test-macro-assembler-x87.cc", "test-macro-assembler-x87.cc",
"test-run-wasm-relocation-x87.cc", "test-run-wasm-relocation-x87.cc",
] ]
} else if (v8_target_arch == "ppc" || v8_target_arch == "ppc64") { } else if (v8_target_cpu == "ppc" || v8_target_cpu == "ppc64") {
sources += [ sources += [
"test-assembler-ppc.cc", "test-assembler-ppc.cc",
"test-code-stubs.cc", "test-code-stubs.cc",
"test-disasm-ppc.cc", "test-disasm-ppc.cc",
] ]
} else if (v8_target_arch == "s390" || v8_target_arch == "s390x") { } else if (v8_target_cpu == "s390" || v8_target_cpu == "s390x") {
sources += [ sources += [
"test-assembler-s390.cc", "test-assembler-s390.cc",
"test-code-stubs.cc", "test-code-stubs.cc",
...@@ -290,9 +290,9 @@ v8_executable("cctest") { ...@@ -290,9 +290,9 @@ v8_executable("cctest") {
] ]
# TODO(machenbach): Translate from gyp. # TODO(machenbach): Translate from gyp.
#['v8_target_arch=="ppc" or v8_target_arch=="ppc64" \ #['v8_target_cpu=="ppc" or v8_target_cpu=="ppc64" \
# or v8_target_arch=="arm" or v8_target_arch=="arm64" \ # or v8_target_cpu=="arm" or v8_target_cpu=="arm64" \
# or v8_target_arch=="s390" or v8_target_arch=="s390x"', { # or v8_target_cpu=="s390" or v8_target_cpu=="s390x"', {
# # disable fmadd/fmsub so that expected results match generated code in # # disable fmadd/fmsub so that expected results match generated code in
# # RunFloat64MulAndFloat64Add1 and friends. # # RunFloat64MulAndFloat64Add1 and friends.
# 'cflags': ['-ffp-contract=off'], # 'cflags': ['-ffp-contract=off'],
......
...@@ -118,21 +118,21 @@ v8_executable("unittests") { ...@@ -118,21 +118,21 @@ v8_executable("unittests") {
"wasm/wasm-macro-gen-unittest.cc", "wasm/wasm-macro-gen-unittest.cc",
] ]
if (v8_target_arch == "arm") { if (v8_target_cpu == "arm") {
sources += [ "compiler/arm/instruction-selector-arm-unittest.cc" ] sources += [ "compiler/arm/instruction-selector-arm-unittest.cc" ]
} else if (v8_target_arch == "arm64") { } else if (v8_target_cpu == "arm64") {
sources += [ "compiler/arm64/instruction-selector-arm64-unittest.cc" ] sources += [ "compiler/arm64/instruction-selector-arm64-unittest.cc" ]
} else if (v8_target_arch == "x86") { } else if (v8_target_cpu == "x86") {
sources += [ "compiler/ia32/instruction-selector-ia32-unittest.cc" ] sources += [ "compiler/ia32/instruction-selector-ia32-unittest.cc" ]
} else if (v8_target_arch == "mips" || v8_target_arch == "mipsel") { } else if (v8_target_cpu == "mips" || v8_target_cpu == "mipsel") {
sources += [ "compiler/mips/instruction-selector-mips-unittest.cc" ] sources += [ "compiler/mips/instruction-selector-mips-unittest.cc" ]
} else if (v8_target_arch == "mips64" || v8_target_arch == "mips64el") { } else if (v8_target_cpu == "mips64" || v8_target_cpu == "mips64el") {
sources += [ "compiler/mips64/instruction-selector-mips64-unittest.cc" ] sources += [ "compiler/mips64/instruction-selector-mips64-unittest.cc" ]
} else if (v8_target_arch == "x64") { } else if (v8_target_cpu == "x64") {
sources += [ "compiler/x64/instruction-selector-x64-unittest.cc" ] sources += [ "compiler/x64/instruction-selector-x64-unittest.cc" ]
} else if (v8_target_arch == "ppc" || v8_target_arch == "ppc64") { } else if (v8_target_cpu == "ppc" || v8_target_cpu == "ppc64") {
sources += [ "compiler/ppc/instruction-selector-ppc-unittest.cc" ] sources += [ "compiler/ppc/instruction-selector-ppc-unittest.cc" ]
} else if (v8_target_arch == "s390" || v8_target_arch == "s390x") { } else if (v8_target_cpu == "s390" || v8_target_cpu == "s390x") {
sources += [ "compiler/s390/instruction-selector-s390-unittest.cc" ] sources += [ "compiler/s390/instruction-selector-s390-unittest.cc" ]
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment