Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1193)

Unified Diff: pylib/gyp/generator/android.py

Issue 509383002: Make gyp tool to emit FDO Support for android. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/generator/android.py
diff --git a/pylib/gyp/generator/android.py b/pylib/gyp/generator/android.py
index d7aa9029deae81f1db4002ab1e3f689cccb1bcbe..34db9800f938aefd379555598d45006a861487fb 100644
--- a/pylib/gyp/generator/android.py
+++ b/pylib/gyp/generator/android.py
@@ -503,9 +503,29 @@ class AndroidMkWriter(object):
self.WriteLn('\n# Flags passed to only C++ (and not C) files.')
self.WriteList(config.get('cflags_cc'), 'LOCAL_CPPFLAGS_%s' % configname)
+ if int(config.get('android_enable_fdo', 0)):
+ use_fdo = 'true'
+ else:
+ use_fdo = 'false'
+ self.WriteLn('\nLOCAL_FDO_SUPPORT_%s := %s' % (configname, use_fdo))
self.WriteLn('\nLOCAL_CFLAGS := $(MY_CFLAGS_$(GYP_CONFIGURATION)) '
'$(MY_DEFS_$(GYP_CONFIGURATION))')
+ self.WriteLn(
+ 'LOCAL_FDO_SUPPORT := $(LOCAL_FDO_SUPPORT_$(GYP_CONFIGURATION))')
+
+ self.WriteLn('\nifneq ($(strip $(TARGET_FDO_CFLAGS)),)')
+ self.WriteLn(' ifeq ($(strip $(LOCAL_FDO_SUPPORT)), true)')
+ self.WriteLn(
+ ' LOCAL_CFLAGS := $(patsubst -Os,-O2,$(LOCAL_CFLAGS))')
+ self.WriteLn(
+ ' fdo_incompatible_flags=-fno-early-inlining -finline-limit=%')
+ self.WriteLn(
+ ' LOCAL_CFLAGS := $(filter-out $(fdo_incompatible_flags),'
+ '$(LOCAL_CFLAGS))')
+ self.WriteLn(' endif')
+ self.WriteLn('endif\n')
+
# Undefine ANDROID for host modules
# TODO: the source code should not use macro ANDROID to tell if it's host
# or target module.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698