From e113a571c9007100e16a348fd4eb4f84891a46b4 Mon Sep 17 00:00:00 2001 From: "cjhopman@chromium.org" Date: Tue, 29 Jul 2014 00:20:58 +0000 Subject: [PATCH] Fix optional neon support On Android, we detect neon support at runtime and switch implementations based on that. This requires that some parts of skia are compiled with -mfpu=neon. To support this, the -mfpu flag is moved out of the 'compiler' config and into its own config. A target can then remove this config and supply its own -mfpu flag (without having to duplicate all the other stuff in the 'compiler' config). BUG=359249 Review URL: https://codereview.chromium.org/371853007 git-svn-id: http://src.chromium.org/svn/trunk/src/build@286038 4ff67af0-8c30-449e-8e8b-ad334ec8d88c --- config/BUILDCONFIG.gn | 1 + config/arm.gni | 2 +- config/compiler/BUILD.gn | 9 ++++++++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/config/BUILDCONFIG.gn b/config/BUILDCONFIG.gn index 79a24cebc..b05247e92 100644 --- a/config/BUILDCONFIG.gn +++ b/config/BUILDCONFIG.gn @@ -310,6 +310,7 @@ _native_compiler_configs = [ "//build/config:feature_flags", "//build/config/compiler:compiler", + "//build/config/compiler:compiler_arm_fpu", "//build/config/compiler:chromium_code", "//build/config/compiler:default_include_dirs", "//build/config/compiler:default_warnings", diff --git a/config/arm.gni b/config/arm.gni index d3ed3c605..65cb160a5 100644 --- a/config/arm.gni +++ b/config/arm.gni @@ -21,7 +21,7 @@ if (cpu_arch == "arm") { if (is_android) { arm_use_neon = false - arm_optionally_use_neon = false + arm_optionally_use_neon = true } else { arm_use_neon = true arm_optionally_use_neon = true diff --git a/config/compiler/BUILD.gn b/config/compiler/BUILD.gn index 456ab1958..09f8e6270 100644 --- a/config/compiler/BUILD.gn +++ b/config/compiler/BUILD.gn @@ -134,7 +134,6 @@ config("compiler") { if (!is_android_webview_build) { cflags += [ "-march=$arm_arch", - "-mfpu=$arm_fpu", "-mfloat-abi=$arm_float_abi", ] if (arm_tune != "") { @@ -314,6 +313,14 @@ config("compiler") { } } +config("compiler_arm_fpu") { + if (cpu_arch == "arm" && !is_android_webview_build) { + cflags = [ + "-mfpu=$arm_fpu", + ] + } +} + # runtime_library ------------------------------------------------------------- # # Sets the runtime library and associated options.