From 6e702f8db52831ee8be6e2f2d5b076b3d6b3422f Mon Sep 17 00:00:00 2001 From: klzgrad Date: Sun, 1 Dec 2019 03:01:21 +0800 Subject: [PATCH] build: Support MIPS -mtune= flag --- src/build/config/compiler/BUILD.gn | 6 ++++++ src/build/config/mips.gni | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/build/config/compiler/BUILD.gn b/src/build/config/compiler/BUILD.gn index 0174fe3cec..6f44a5e65a 100644 --- a/src/build/config/compiler/BUILD.gn +++ b/src/build/config/compiler/BUILD.gn @@ -1016,6 +1016,9 @@ config("compiler_cpu_abi") { } cflags += [ "-m${mips_float_abi}-float" ] + if (mips_tune != "") { + cflags += [ "-mtune=${mips_tune}" ] + } } else if (current_cpu == "mips" && !is_nacl) { ldflags += [ "-Wl,--hash-style=sysv" ] if (custom_toolchain == "") { @@ -1061,6 +1064,9 @@ config("compiler_cpu_abi") { } cflags += [ "-m${mips_float_abi}-float" ] + if (mips_tune != "") { + cflags += [ "-mtune=${mips_tune}" ] + } } else if (current_cpu == "mips64el") { cflags += [ "-D__SANE_USERSPACE_TYPES__" ] ldflags += [ "-Wl,--hash-style=sysv" ] diff --git a/src/build/config/mips.gni b/src/build/config/mips.gni index 6365088b14..a796232cc6 100644 --- a/src/build/config/mips.gni +++ b/src/build/config/mips.gni @@ -11,6 +11,7 @@ import("//build/config/v8_target_cpu.gni") declare_args() { # MIPS MultiMedia Instruction compilation flag. mips_use_mmi = false + } if (current_cpu == "mipsel" || v8_current_cpu == "mipsel" || @@ -42,6 +43,9 @@ if (current_cpu == "mipsel" || v8_current_cpu == "mipsel" || # "fp64": sets the GCC -mfp64 option. # "fpxx": sets the GCC -mfpxx option. mips_fpu_mode = "fp32" + + # Examples: "24kc", "74kc" + mips_tune = "" } } else if (current_cpu == "mips64el" || v8_current_cpu == "mips64el" || current_cpu == "mips64" || v8_current_cpu == "mips64") {