Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index bd1067f8fc37e5fb42b2ef8abd05e2f624bd66b1..6923a32f1dd4c5f8e7a02b236df2251ebcd57615 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -425,29 +425,93 @@ config("compiler_cpu_abi") { |
} |
} else if (current_cpu == "mipsel") { |
if (mips_arch_variant == "r6") { |
- cflags += [ |
- "-mips32r6", |
- "-Wa,-mips32r6", |
- ] |
- if (is_android) { |
+ if (is_clang) { |
+ cflags += [ |
+ "-target", |
+ "mipsel-linux-gnu", |
+ "-march=mips32r6", |
+ ] |
ldflags += [ |
+ "-target", |
+ "mipsel-linux-gnu", |
+ ] |
+ } else { |
+ cflags += [ |
"-mips32r6", |
- "-Wl,-melf32ltsmip", |
+ "-Wa,-mips32r6", |
] |
+ if (is_android) { |
+ ldflags += [ |
+ "-mips32r6", |
+ "-Wl,-melf32ltsmip", |
+ ] |
+ } |
} |
} else if (mips_arch_variant == "r2") { |
- cflags += [ |
- "-mips32r2", |
- "-Wa,-mips32r2", |
- ] |
- if (mips_float_abi == "hard" && mips_fpu_mode != "") { |
- cflags += [ "-m$mips_fpu_mode" ] |
+ if (is_clang) { |
+ if (is_android) { |
+ cflags += [ |
+ "-target", |
+ "mipsel-linux-android", |
+ "-march=mipsel", |
+ "-mcpu=mips32r2", |
+ ] |
+ ldflags += [ |
+ "-target", |
+ "mipsel-linux-android", |
+ ] |
+ } else { |
+ cflags += [ |
+ "-target", |
+ "mipsel-linux-gnu", |
+ "-march=mipsel", |
+ "-mcpu=mips32r2", |
+ ] |
+ ldflags += [ |
+ "-target", |
+ "mipsel-linux-gnu", |
+ ] |
+ } |
+ } else { |
+ 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 (is_clang) { |
+ if (is_android) { |
+ cflags += [ |
+ "-target", |
+ "mipsel-linux-android", |
+ "-march=mipsel", |
+ "-mcpu=mips32", |
+ ] |
+ ldflags += [ |
+ "-target", |
+ "mipsel-linux-android", |
+ ] |
+ } else { |
+ cflags += [ |
+ "-target", |
+ "mipsel-linux-gnu", |
+ "-march=mipsel", |
+ "-mcpu=mips32", |
+ ] |
+ ldflags += [ |
+ "-target", |
+ "mipsel-linux-gnu", |
+ ] |
+ } |
+ } else { |
+ cflags += [ |
+ "-mips32", |
+ "-Wa,-mips32", |
+ ] |
+ } |
} |
if (mips_dsp_rev == 1) { |