aboutsummaryrefslogtreecommitdiffhomepage
path: root/platform_tools
diff options
context:
space:
mode:
authorGravatar djsollen <djsollen@google.com>2014-08-21 07:38:31 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-08-21 07:38:31 -0700
commit6bf35c21003b8d1c8286c90a53c0b3091f5aa85a (patch)
tree90dab27db6658f65bc689a432ca34b721e2fc591 /platform_tools
parent729776c81099046dea00ba76d8299802fef8685f (diff)
Update FDO options to match what is needed by the framework
R=tomhudson@google.com Author: djsollen@google.com Review URL: https://codereview.chromium.org/497503003
Diffstat (limited to 'platform_tools')
-rw-r--r--platform_tools/android/gyp_gen/makefile_writer.py9
-rw-r--r--platform_tools/android/tests/expectations/Android.mk5
2 files changed, 14 insertions, 0 deletions
diff --git a/platform_tools/android/gyp_gen/makefile_writer.py b/platform_tools/android/gyp_gen/makefile_writer.py
index ddd584e9a2..55a71d00ca 100644
--- a/platform_tools/android/gyp_gen/makefile_writer.py
+++ b/platform_tools/android/gyp_gen/makefile_writer.py
@@ -194,7 +194,16 @@ def write_android_mk(target_dir, common, deviations_from_common):
f.write(DEBUGGING_HELP)
write_clear_vars(f)
+
+ # need flags to enable feedback driven optimization (FDO) when requested
+ # by the build system.
f.write('LOCAL_FDO_SUPPORT := true\n')
+ f.write(
+ 'ifneq ($(strip $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_CFLAGS)),)\n')
+ f.write('\t# This should be the last -Oxxx specified in LOCAL_CFLAGS\n')
+ f.write('\tLOCAL_CFLAGS += -O2\n')
+ f.write('endif\n\n')
+
f.write('LOCAL_ARM_MODE := thumb\n')
# need a flag to tell the C side when we're on devices with large memory
diff --git a/platform_tools/android/tests/expectations/Android.mk b/platform_tools/android/tests/expectations/Android.mk
index 854fa6b7e0..f9af5af9ff 100644
--- a/platform_tools/android/tests/expectations/Android.mk
+++ b/platform_tools/android/tests/expectations/Android.mk
@@ -34,6 +34,11 @@ LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)
LOCAL_FDO_SUPPORT := true
+ifneq ($(strip $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_FDO_CFLAGS)),)
+ # This should be the last -Oxxx specified in LOCAL_CFLAGS
+ LOCAL_CFLAGS += -O2
+endif
+
LOCAL_ARM_MODE := thumb
ifeq ($(TARGET_ARCH),arm)
ifeq ($(ARCH_ARM_HAVE_VFP),true)