diff --git a/src/build/config/arm.gni b/src/build/config/arm.gni index ddd1c5df82..6b48ad7e36 100644 --- a/src/build/config/arm.gni +++ b/src/build/config/arm.gni @@ -36,6 +36,8 @@ if (current_cpu == "arm" || v8_current_cpu == "arm") { # Thumb is a reduced instruction set available on some ARM processors that # has increased code density. arm_use_thumb = true + + arm_cpu = "" } if (current_os == "android" || target_os == "android") { diff --git a/src/build/config/compiler/BUILD.gn b/src/build/config/compiler/BUILD.gn index ca88e8bdaa..e54052757c 100644 --- a/src/build/config/compiler/BUILD.gn +++ b/src/build/config/compiler/BUILD.gn @@ -782,7 +782,7 @@ config("compiler_cpu_abi") { ] } } else if (current_cpu == "arm") { - if (is_clang && !is_android && !is_nacl) { + if (is_clang && !is_android && !is_nacl && custom_toolchain == "") { cflags += [ "--target=arm-linux-gnueabihf" ] ldflags += [ "--target=arm-linux-gnueabihf" ] } @@ -791,12 +791,16 @@ config("compiler_cpu_abi") { "-march=$arm_arch", "-mfloat-abi=$arm_float_abi", ] + if (arm_cpu != "") { + cflags += [ "-mcpu=$arm_cpu" ] + } + ldflags += [ "-mfloat-abi=$arm_float_abi" ] } if (arm_tune != "") { cflags += [ "-mtune=$arm_tune" ] } } else if (current_cpu == "arm64") { - if (is_clang && !is_android && !is_nacl && !is_fuchsia) { + if (is_clang && !is_android && !is_nacl && !is_fuchsia && custom_toolchain == "") { cflags += [ "--target=aarch64-linux-gnu" ] ldflags += [ "--target=aarch64-linux-gnu" ] }