diff options
author | synergydev <synergye@codefi.re> | 2013-08-08 13:08:26 -0700 |
---|---|---|
committer | Synergy Dev <synergye@codefi.re> | 2013-08-09 22:41:46 +0000 |
commit | 6ecf0ef7447adbc1bd2f8b591f62d37bd8164255 (patch) | |
tree | 1cbbe0ed94e36520d50ffd3c1cab1fbbfdfd7616 | |
parent | e58868ab47fc044e9e7985c8357d83fee4df732a (diff) | |
download | platform_build-6ecf0ef7447adbc1bd2f8b591f62d37bd8164255.tar.gz platform_build-6ecf0ef7447adbc1bd2f8b591f62d37bd8164255.tar.bz2 platform_build-6ecf0ef7447adbc1bd2f8b591f62d37bd8164255.zip |
FDO: support linux-x86 target
Change-Id: I4a3a1d298176da109df316cf9128f19e77490bc9
-rw-r--r-- | core/combo/TARGET_linux-x86.mk | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/core/combo/TARGET_linux-x86.mk b/core/combo/TARGET_linux-x86.mk index 5c9a76bb1a..159fbe1b5b 100644 --- a/core/combo/TARGET_linux-x86.mk +++ b/core/combo/TARGET_linux-x86.mk @@ -63,6 +63,8 @@ endif ifneq ($(wildcard $(TARGET_CC)),) TARGET_LIBGCC := \ $(shell $(TARGET_CC) -m32 -print-file-name=libgcc.a) +target_libgcov := $(shell $(TARGET_CC) $(TARGET_GLOBAL_CFLAGS) \ + -print-file-name=libgcov.a) endif TARGET_NO_UNDEFINED_LDFLAGS := -Wl,--no-undefined @@ -72,6 +74,34 @@ libm_root := bionic/libm libstdc++_root := bionic/libstdc++ libthread_db_root := bionic/libthread_db +# Define FDO (Feedback Directed Optimization) options. + +TARGET_FDO_CFLAGS:= +TARGET_FDO_LIB:= + +ifneq ($(strip $(BUILD_FDO_INSTRUMENT)),) + # Set BUILD_FDO_INSTRUMENT=true to turn on FDO instrumentation. + # The profile will be generated on /data/local/tmp/profile on the device. + TARGET_FDO_CFLAGS := -fprofile-generate=/data/local/tmp/profile -DANDROID_FDO + TARGET_FDO_LIB := $(target_libgcov) +else + # If BUILD_FDO_INSTRUMENT is turned off, then consider doing the FDO optimizations. + # Set TARGET_FDO_PROFILE_PATH to set a custom profile directory for your build. + ifeq ($(strip $(TARGET_FDO_PROFILE_PATH)),) + TARGET_FDO_PROFILE_PATH := fdo/profiles/$(TARGET_ARCH)/$(TARGET_ARCH_VARIANT) + else + ifeq ($(strip $(wildcard $(TARGET_FDO_PROFILE_PATH))),) + $(warning Custom TARGET_FDO_PROFILE_PATH supplied, but directory does not exist. Turn off FDO.) + endif + endif + + # If the FDO profile directory can't be found, then FDO is off. + ifneq ($(strip $(wildcard $(TARGET_FDO_PROFILE_PATH))),) + TARGET_FDO_CFLAGS := -fprofile-use=$(TARGET_FDO_PROFILE_PATH) -DANDROID_FDO + TARGET_FDO_LIB := $(target_libgcov) + endif +endif + # unless CUSTOM_KERNEL_HEADERS is defined, we're going to use # symlinks located in out/ to point to the appropriate kernel # headers. see 'config/kernel_headers.make' for more details @@ -191,6 +221,7 @@ $(hide) $(PRIVATE_CXX) \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \ $(PRIVATE_TARGET_LIBGCC) \ + $(PRIVATE_TARGET_FDO_LIB) \ $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ -o $@ \ $(PRIVATE_LDFLAGS) \ @@ -216,6 +247,7 @@ $(hide) $(PRIVATE_CXX) \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ $(if $(PRIVATE_GROUP_STATIC_LIBRARIES),-Wl$(comma)--end-group) \ $(PRIVATE_TARGET_LIBGCC) \ + $(PRIVATE_TARGET_FDO_LIB) \ $(call normalize-target-libraries,$(PRIVATE_ALL_SHARED_LIBRARIES)) \ -o $@ \ $(PRIVATE_LDFLAGS) \ @@ -237,6 +269,7 @@ $(hide) $(PRIVATE_CXX) \ -Wl,--no-whole-archive \ -Wl,--start-group \ $(call normalize-target-libraries,$(PRIVATE_ALL_STATIC_LIBRARIES)) \ + $(PRIVATE_TARGET_FDO_LIB) \ $(PRIVATE_TARGET_LIBGCC) \ -Wl,--end-group \ $(if $(filter true,$(PRIVATE_NO_CRT)),,$(PRIVATE_TARGET_CRTEND_O)) |