From 10c1312052474419c695464e63081b025784d721 Mon Sep 17 00:00:00 2001 From: Vinay Verma Date: Tue, 21 Jan 2020 14:54:46 +0530 Subject: [PATCH] Guard Compile time metadata information with LOCAL_ABI_CHECKER With this change additional metadata information will only be captured for modules which will have LOCAL_ABI_CHECKER set to true. Trimming of clag data is not needed as we limited scope to particular modules which can be handled in module specific make files. Additionally , resetting abi_checker and include variables to avoid stale information in module_info.json CRs-Fixed: 2580673 Change-Id: Iab0c10c160d67df398add88c9a54a593f78d7d63 --- core/base_rules.mk | 11 ++++++++--- core/prebuilt.mk | 2 ++ core/shared_library.mk | 2 ++ core/static_library.mk | 3 +++ core/tasks/module-info.mk | 1 + 5 files changed, 16 insertions(+), 3 deletions(-) diff --git a/core/base_rules.mk b/core/base_rules.mk index 46a96fd56b..611004418c 100644 --- a/core/base_rules.mk +++ b/core/base_rules.mk @@ -765,6 +765,8 @@ ALL_MODULES += $(my_register_name) # recursively expanded. ALL_MODULES.$(my_register_name).CLASS := \ $(ALL_MODULES.$(my_register_name).CLASS) $(LOCAL_MODULE_CLASS) +ifdef LOCAL_ABI_CHECKER +ifeq ($(LOCAL_ABI_CHECKER),true) ALL_MODULES.$(my_register_name).SRCS := \ $(ALL_MODULES.$(my_register_name).SRCS) $(LOCAL_SRC_FILES) ALL_MODULES.$(my_register_name).STATIC := \ @@ -773,11 +775,14 @@ ALL_MODULES.$(my_register_name).WSTATIC := \ $(ALL_MODULES.$(my_register_name).WSTATIC) $(LOCAL_WHOLE_STATIC_LIBRARIES) ALL_MODULES.$(my_register_name).EXPORT := \ $(ALL_MODULES.$(my_register_name).EXPORT) $(LOCAL_EXPORT_C_INCLUDES) -# TODO(b/147688606): Partial revert of 87a04382bb341636d2103178c3f6a71edf433752 -#ALL_MODULES.$(my_register_name).CFLAGS := \ -# $(ALL_MODULES.$(my_register_name).CFLAGS) $(shell echo '$(LOCAL_CFLAGS)'| tr -d '"\') +ALL_MODULES.$(my_register_name).CFLAGS := \ + $(ALL_MODULES.$(my_register_name).CFLAGS) $(LOCAL_CFLAGS) +ALL_MODULES.$(my_register_name).ABI_CHECKER := \ + $(ALL_MODULES.$(my_register_name).ABI_CHECKER) $(LOCAL_ABI_CHECKER) ALL_MODULES.$(my_register_name).INCS := \ $(ALL_MODULES.$(my_register_name).INCS) $(LOCAL_C_INCLUDES) +endif +endif ALL_MODULES.$(my_register_name).PATH := \ $(ALL_MODULES.$(my_register_name).PATH) $(LOCAL_PATH) ALL_MODULES.$(my_register_name).TAGS := \ diff --git a/core/prebuilt.mk b/core/prebuilt.mk index 721c8b76d1..2f8413ac13 100644 --- a/core/prebuilt.mk +++ b/core/prebuilt.mk @@ -56,3 +56,5 @@ LOCAL_STATIC_LIBRARIES := LOCAL_WHOLE_STATIC_LIBRARIES := LOCAL_EXPORT_C_INCLUDES := LOCAL_CFLAGS := +LOCAL_ABI_CHECKER := +LOCAL_C_INCLUDES := diff --git a/core/shared_library.mk b/core/shared_library.mk index a0c547238b..5e70eaee6f 100644 --- a/core/shared_library.mk +++ b/core/shared_library.mk @@ -67,6 +67,8 @@ LOCAL_STATIC_LIBRARIES := LOCAL_WHOLE_STATIC_LIBRARIES := LOCAL_EXPORT_C_INCLUDES := LOCAL_CFLAGS := +LOCAL_ABI_CHECKER := +LOCAL_C_INCLUDES := ########################################################### ## Copy headers to the install tree diff --git a/core/static_library.mk b/core/static_library.mk index 3c27e699c4..b49968021a 100644 --- a/core/static_library.mk +++ b/core/static_library.mk @@ -53,6 +53,9 @@ LOCAL_STATIC_LIBRARIES := LOCAL_WHOLE_STATIC_LIBRARIES := LOCAL_EXPORT_C_INCLUDES := LOCAL_CFLAGS := +LOCAL_ABI_CHECKER := +LOCAL_C_INCLUDES := + ########################################################### ## Copy headers to the install tree diff --git a/core/tasks/module-info.mk b/core/tasks/module-info.mk index 218514c86c..f505263ba1 100644 --- a/core/tasks/module-info.mk +++ b/core/tasks/module-info.mk @@ -25,6 +25,7 @@ $(MODULE_INFO_JSON): '"wstatic": [$(foreach w,$(sort $(ALL_MODULES.$(m).WSTATIC)),"$(w)", )], ' \ '"export": [$(foreach w,$(sort $(ALL_MODULES.$(m).EXPORT)),"$(w)", )], ' \ '"cflags": [$(foreach w,$(sort $(ALL_MODULES.$(m).CFLAGS)),"$(w)", )], ' \ + '"abi_checker": [$(foreach w,$(sort $(ALL_MODULES.$(m).ABI_CHECKER)),"$(w)", )], ' \ '"srcjars": [$(foreach w,$(sort $(ALL_MODULES.$(m).SRCJARS)),"$(w)", )], ' \ '"classes_jar": [$(foreach w,$(sort $(ALL_MODULES.$(m).CLASSES_JAR)),"$(w)", )], ' \ '},\n' \