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

Unified Diff: build/config/v8_target_cpu.gni

Issue 2116183002: Land chromium-side work to clean up handling of v8_target_cpu in the GN build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix missing import Created 4 years, 5 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 | « build/config/sanitizers/sanitizers.gni ('k') | build/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/config/v8_target_cpu.gni
diff --git a/build/config/v8_target_cpu.gni b/build/config/v8_target_cpu.gni
index 32e53c198820aa658e8a55d1f5c78f91049d1072..6a7c1a3774751a28f126b317c9c3dd03af43ec37 100644
--- a/build/config/v8_target_cpu.gni
+++ b/build/config/v8_target_cpu.gni
@@ -14,20 +14,44 @@ declare_args() {
# This arg is defined here rather than in the v8 project because we want
# some of the common architecture-specific args (like arm_float_abi or
# mips_arch_variant) to be set to their defaults either if the current_cpu
- # applies *or* if the v8_target_cpu applies.
+ # applies *or* if the v8_current_cpu applies.
#
- # TODO(crbug.com/620527) - rework this whole approach so that it isn't
- # v8-specific.
+ # As described below, you can also specify the v8_target_cpu to use
+ # indirectly by specifying a `custom_toolchain` that contains v8_$cpu in the
+ # name after the normal toolchain.
+ #
+ # For example, `gn gen --args="custom_toolchain=...:clang_x64_v8_arm64"`
+ # is equivalent to setting --args=`v8_target_cpu="arm64"`. Setting
+ # `custom_toolchain` is more verbose but makes the toolchain that is
+ # (effectively) being used explicit.
+ #
+ # v8_target_cpu can only be used to target one architecture in a build,
+ # so if you wish to build multiple copies of v8 that are targetting
+ # different architectures, you will need to do something more
+ # complicated involving multiple toolchains along the lines of
+ # custom_toolchain, above.
v8_target_cpu = ""
}
if (v8_target_cpu == "") {
- 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.
+ if (current_toolchain == "//build/toolchain/linux:clang_x64_v8_arm64" ||
+ current_toolchain == "//build/toolchain/linux:x64_v8_arm64") {
+ v8_target_cpu = "arm64"
+ } else if (current_toolchain == "//build/toolchain/linux:clang_x86_v8_arm" ||
+ current_toolchain == "//build/toolchain/linux:x86_v8_arm") {
+ v8_target_cpu = "arm"
+ } else if (is_msan) {
+ # If we're running under a sanitizer, if we configure v8 to generate
+ # code that will be run under a simulator, then the generated code
+ # also gets the benefits of the sanitizer.
v8_target_cpu = "arm64"
} else {
v8_target_cpu = target_cpu
}
}
+
+declare_args() {
+ # This argument is declared here so that it can be overridden in toolchains.
+ # It should never be explicitly set by the user.
+ v8_current_cpu = v8_target_cpu
+}
« no previous file with comments | « build/config/sanitizers/sanitizers.gni ('k') | build/toolchain/gcc_toolchain.gni » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698