diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn index 942605e38..f354f17b0 100644 --- a/config/BUILDCONFIG.gn +++ b/config/BUILDCONFIG.gn @@ -471,6 +471,7 @@ default_compiler_configs = [ "//build/config/compiler:compiler", "//build/config/compiler:clang_stackrealign", "//build/config/compiler:compiler_arm_fpu", + "//build/config/compiler:compiler_arm_thumb", "//build/config/compiler:chromium_code", "//build/config/compiler:default_include_dirs", "//build/config/compiler:default_optimization", diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn index 1eaa390c1..c4d61e228 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn @@ -534,13 +534,6 @@ config("compiler_cpu_abi") { "-march=$arm_arch", "-mfloat-abi=$arm_float_abi", ] - if (arm_use_thumb) { - cflags += [ "-mthumb" ] - if (is_android && !is_clang) { - # Clang doesn't support this option. - cflags += [ "-mthumb-interwork" ] - } - } } if (arm_tune != "") { cflags += [ "-mtune=$arm_tune" ] @@ -765,6 +758,17 @@ config("compiler_arm_fpu") { } } +config("compiler_arm_thumb") { + if (current_cpu == "arm" && arm_use_thumb && is_posix && + !(is_mac || is_ios || is_nacl)) { + cflags = [ "-mthumb" ] + if (is_android && !is_clang) { + # Clang doesn't support this option. + cflags += [ "-mthumb-interwork" ] + } + } +} + # runtime_library ------------------------------------------------------------- # # Sets the runtime library and associated options.