Index: build/config/compiler/BUILD.gn |
diff --git a/build/config/compiler/BUILD.gn b/build/config/compiler/BUILD.gn |
index 2f107f7d3bc3d83d578a93a1d9cd4a53c1292eb2..92e2dba3128f2c82922b370b95c5f8b3f8673764 100644 |
--- a/build/config/compiler/BUILD.gn |
+++ b/build/config/compiler/BUILD.gn |
@@ -342,7 +342,8 @@ config("compiler") { |
# Gold is the default linker for the bundled binutils so we explicitly |
# enable the bfd linker when use_gold is not set. |
ldflags += [ "-fuse-ld=bfd" ] |
- } else if (is_android && current_cpu == "mipsel" && is_clang) { |
+ } else if (is_android && is_clang && |
+ (current_cpu == "mipsel" || current_cpu == "mips64el")) { |
# Let clang find the ld.bfd in the NDK. |
_rebased_android_toolchain_root = |
rebase_path(android_toolchain_root, root_build_dir) |
@@ -618,11 +619,22 @@ config("compiler_cpu_abi") { |
cflags += [ "-m${mips_float_abi}-float" ] |
} else if (current_cpu == "mips64el") { |
if (mips_arch_variant == "r6") { |
- cflags += [ |
- "-mips64r6", |
- "-Wa,-mips64r6", |
- ] |
- ldflags += [ "-mips64r6" ] |
+ if (is_clang) { |
+ if (is_android) { |
+ cflags += [ |
+ "--target=mips64el-linux-android", |
+ "-march=mips64el", |
+ "-mcpu=mips64r6", |
+ ] |
+ ldflags += [ "--target=mips64el-linux-android" ] |
+ } |
+ } else { |
+ cflags += [ |
+ "-mips64r6", |
+ "-Wa,-mips64r6", |
+ ] |
+ ldflags += [ "-mips64r6" ] |
+ } |
} else if (mips_arch_variant == "r2") { |
cflags += [ |
"-mips64r2", |