| Index: BUILD.gn
|
| diff --git a/BUILD.gn b/BUILD.gn
|
| index eaf56dd9db26b4e3733ea3da4c864bfe1d5e1ff3..e5f6ed94f1e0520b47caaaec777f8877ce7a9528 100644
|
| --- a/BUILD.gn
|
| +++ b/BUILD.gn
|
| @@ -19,6 +19,9 @@ v8_object_print = false
|
| v8_postmortem_support = false
|
| v8_use_snapshot = true
|
| v8_target_arch = current_cpu
|
| +if (enable_correct_v8_arch) {
|
| + v8_target_arch = target_cpu
|
| +}
|
| v8_random_seed = "314159265"
|
| v8_toolset_for_d8 = "host"
|
|
|
| @@ -56,6 +59,15 @@ config("external_config") {
|
| include_dirs = [ "include" ]
|
| }
|
|
|
| +declare_args() {
|
| + host_cxx_is_biarch = 0
|
| + if (enable_correct_v8_arch &&
|
| + (host_cpu == "ia32" || host_cpu =="x64" || host_cpu=="ppc" ||
|
| + host_cpu=="ppc64" || is_clang)) {
|
| + host_cxx_is_biarch = 1
|
| + }
|
| +}
|
| +
|
| config("features") {
|
| visibility = [ ":*" ] # Only targets in this file can depend on this.
|
|
|
| @@ -95,6 +107,7 @@ config("toolchain") {
|
|
|
| defines = []
|
| cflags = []
|
| + ldflags = []
|
|
|
| # TODO(jochen): Add support for arm subarchs, mips, mipsel.
|
|
|
| @@ -151,6 +164,21 @@ config("toolchain") {
|
| "OPTIMIZED_DEBUG",
|
| ]
|
| }
|
| +
|
| + if ((current_os == "linux" || current_os == "freebsd" ||
|
| + current_os == "openbsd" || current_os == "solaris" ||
|
| + current_os == "netbsd" || current_os == "mac" ||
|
| + current_os == "android" || current_os == "qnx") &&
|
| + (v8_target_arch == "arm" || v8_target_arch == "ia32" ||
|
| + v8_target_arch == "x87" || v8_target_arch == "mips" ||
|
| + v8_target_arch == "mipsel" || v8_target_arch == "ppc")) {
|
| + if (current_toolchain == host_toolchain) {
|
| + if (host_cxx_is_biarch == 1) {
|
| + cflags += [ "-m32" ]
|
| + ldflags += [ "-m32" ]
|
| + }
|
| + }
|
| + }
|
| }
|
|
|
| ###############################################################################
|
|
|