From 0c59dab590bf7baebcc384d3e04f6c282d720286 Mon Sep 17 00:00:00 2001 From: Jiyong Park Date: Mon, 3 Jul 2017 13:14:52 +0900 Subject: [PATCH] Device-specific kernel headers are accessbile again Device-specific kernel headers (TARGET_PROJECT_SYSTEM_INCLUDES) have been added to the global include paths. However, since global include paths are no longer provided when a lib is built for vendors, the device-specific kernel headers becomes inaccessible. To solve this problem, a pseudo header library 'device_kernel_headers' is defined and it is added to all Android.mk defined lib/bins. Also, in order to give this info to the soong world, TARGET_PROJECT_SYSTEM_INCLUDES is exported as a new product config DeviceKernelHeaders. Bug: 62939405 Test: choosecombo to aosp_sailfish (or any other Pixel/Nexus targets) BOARD_VNDK_VERSION=current m -j gralloc.msm8996 (or any other vendor libs using vendor-specific kernel headers) Change-Id: I3f0a2b893cc9352d6c13f3151e8834477d15c07b --- core/binary.mk | 2 ++ core/soong_config.mk | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/core/binary.mk b/core/binary.mk index 6b2bf71e7..502f79e20 100644 --- a/core/binary.mk +++ b/core/binary.mk @@ -1374,6 +1374,8 @@ endif #################################################### import_includes := $(intermediates)/import_includes import_includes_deps := $(strip \ + $(if $(LOCAL_USE_VNDK),\ + $(call intermediates-dir-for,HEADER_LIBRARIES,device_kernel_headers,$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))/export_includes) \ $(foreach l, $(installed_shared_library_module_names), \ $(call intermediates-dir-for,SHARED_LIBRARIES,$(l),$(my_kind),,$(LOCAL_2ND_ARCH_VAR_PREFIX),$(my_host_cross))/export_includes) \ $(foreach l, $(my_static_libraries) $(my_whole_static_libraries), \ diff --git a/core/soong_config.mk b/core/soong_config.mk index 472a90cfb..54a30ea67 100644 --- a/core/soong_config.mk +++ b/core/soong_config.mk @@ -86,7 +86,9 @@ $(SOONG_VARIABLES): FORCE echo ''; \ echo ' "ArtUseReadBarrier": $(if $(filter false,$(PRODUCT_ART_USE_READ_BARRIER)),false,true),'; \ echo ''; \ - echo ' "BtConfigIncludeDir": "$(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR)"'; \ + echo ' "BtConfigIncludeDir": "$(BOARD_BLUETOOTH_BDROID_BUILDCFG_INCLUDE_DIR)",'; \ + echo ''; \ + echo ' "DeviceKernelHeaders": $(call json_list,$(strip $(TARGET_PROJECT_SYSTEM_INCLUDES)))'; \ echo '}') > $(SOONG_VARIABLES_TMP); \ if ! cmp -s $(SOONG_VARIABLES_TMP) $(SOONG_VARIABLES); then \ mv $(SOONG_VARIABLES_TMP) $(SOONG_VARIABLES); \