FDO: do not support host modules
Summary:
If built with BUILD_FDO_INSTRUMENT alone, host modules will fail at runtime (during build)
due to failing to create /data in most standard unix user permission cases. If the user does
have full permission to /, /data/profile/ will be created and profiles will be generated there.
Any file generation in the Android Build System should be kept to $OUT.
This commit fixes this bug.
Test Plan:
Build with BUILD_FDO_INSTRUMENT without additional configuration, and host modules will no longer generate profiles
at their runtime.
diff --git a/core/binary.mk b/core/binary.mk
index 10d4927..3893d03 100644
--- a/core/binary.mk
+++ b/core/binary.mk
@@ -115,9 +115,11 @@
## Add FDO flags if FDO is turned on and supported
####################################################
ifeq ($(strip $(LOCAL_NO_FDO_SUPPORT)),)
- LOCAL_CFLAGS += $(TARGET_FDO_CFLAGS)
- LOCAL_CPPFLAGS += $(TARGET_FDO_CFLAGS)
- LOCAL_LDFLAGS += $(TARGET_FDO_CFLAGS)
+ ifeq ($(strip $(LOCAL_IS_HOST_MODULE)),)
+ LOCAL_CFLAGS += $(TARGET_FDO_CFLAGS)
+ LOCAL_CPPFLAGS += $(TARGET_FDO_CFLAGS)
+ LOCAL_LDFLAGS += $(TARGET_FDO_CFLAGS)
+ endif
endif
####################################################