Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index f129035e796bb80e037ce33e88c7ace0495fe2cc..792b47c2a8750e44470a4eff5eed88c2257401e9 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -13,7 +13,8 @@ import("//build_overrides/build.gni") |
if (current_cpu == "arm" || current_cpu == "arm64") { |
import("//build/config/arm.gni") |
} |
-if (current_cpu == "mipsel" || current_cpu == "mips64el") { |
+if (current_cpu == "mipsel" || current_cpu == "mips64el" || |
+ current_cpu == "mips" || current_cpu == "mips64") { |
import("//build/config/mips.gni") |
} |
if (is_mac) { |
@@ -700,6 +701,40 @@ config("compiler_cpu_abi") { |
} |
cflags += [ "-m${mips_float_abi}-float" ] |
+ } else if (current_cpu == "mips" && !is_nacl) { |
+ if (mips_arch_variant == "r6") { |
+ cflags += [ |
+ "-mips32r6", |
+ "-Wa,-mips32r6", |
+ ] |
+ if (mips_use_msa == true) { |
+ cflags += [ |
+ "-mmsa", |
+ "-mfp64", |
+ ] |
+ } |
+ } else if (mips_arch_variant == "r2") { |
+ cflags += [ |
+ "-mips32r2", |
+ "-Wa,-mips32r2", |
+ ] |
+ if (mips_float_abi == "hard" && mips_fpu_mode != "") { |
+ cflags += [ "-m$mips_fpu_mode" ] |
+ } |
+ } else if (mips_arch_variant == "r1") { |
+ cflags += [ |
+ "-mips32", |
+ "-Wa,-mips32", |
+ ] |
+ } |
+ |
+ if (mips_dsp_rev == 1) { |
+ cflags += [ "-mdsp" ] |
+ } else if (mips_dsp_rev == 2) { |
+ cflags += [ "-mdspr2" ] |
+ } |
+ |
+ cflags += [ "-m${mips_float_abi}-float" ] |
} else if (current_cpu == "mips64el") { |
if (mips_arch_variant == "r6") { |
if (is_clang) { |
@@ -731,6 +766,26 @@ config("compiler_cpu_abi") { |
] |
ldflags += [ "-mips64r2" ] |
} |
+ } else if (current_cpu == "mips64") { |
+ if (mips_arch_variant == "r6") { |
+ cflags += [ |
+ "-mips64r6", |
+ "-Wa,-mips64r6", |
+ ] |
+ ldflags += [ "-mips64r6" ] |
+ if (mips_use_msa == true) { |
+ cflags += [ |
+ "-mmsa", |
+ "-mfp64", |
+ ] |
+ } |
+ } else if (mips_arch_variant == "r2") { |
+ cflags += [ |
+ "-mips64r2", |
+ "-Wa,-mips64r2", |
+ ] |
+ ldflags += [ "-mips64r2" ] |
+ } |
} else if (current_cpu == "pnacl" && is_nacl_nonsfi) { |
if (target_cpu == "x86" || target_cpu == "x64") { |
cflags += [ |
@@ -1179,7 +1234,8 @@ config("chromium_code") { |
if (!is_debug && !using_sanitizer && |
(!is_linux || !is_clang || is_official_build) && |
current_cpu != "s390x" && current_cpu != "s390" && |
- current_cpu != "ppc64" && current_cpu != "ppc64") { |
+ current_cpu != "ppc64" && current_cpu != "ppc64" && |
+ current_cpu != "mips" && current_cpu != "mips64") { |
# _FORTIFY_SOURCE isn't really supported by Clang now, see |
# http://llvm.org/bugs/show_bug.cgi?id=16821. |
# It seems to work fine with Ubuntu 12 headers though, so use it in |