From f0f939409d0c5a011d74a0130ff74790d416e281 Mon Sep 17 00:00:00 2001 From: Ashutosh Agarwal Date: Wed, 18 Sep 2024 14:24:05 +0000 Subject: [PATCH] Update core/Makefile to add variable PRODUCT_EXTRA_STUB_LIBRARIES. This allows products to specify additional device-specific stub libraries that should be included in the system_linker_config. This is useful for products that need to include additional stub libraries that are not picked up by Soong automatically. Bug: 361441210 Change-Id: Ia18c476e249ac5b14b43819fa0a4f0059dc620de --- core/Makefile | 2 ++ core/product.mk | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/core/Makefile b/core/Makefile index b0392cdc8b..49b1432266 100644 --- a/core/Makefile +++ b/core/Makefile @@ -3511,6 +3511,8 @@ $(SYSTEM_LINKER_CONFIG): $(INTERNAL_SYSTEMIMAGE_FILES) $(SYSTEM_LINKER_CONFIG_SO --output $@ --value "$(STUB_LIBRARIES)" --system "$(TARGET_OUT)" $(HOST_OUT_EXECUTABLES)/conv_linker_config append --source $@ --output $@ --key requireLibs \ --value "$(foreach lib,$(LLNDK_MOVED_TO_APEX_LIBRARIES), $(lib).so)" + $(HOST_OUT_EXECUTABLES)/conv_linker_config append --source $@ --output $@ --key provideLibs \ + --value "$(foreach lib,$(PRODUCT_EXTRA_STUB_LIBRARIES), $(lib).so)" $(call declare-1p-target,$(SYSTEM_LINKER_CONFIG),) $(call declare-license-deps,$(SYSTEM_LINKER_CONFIG),$(INTERNAL_SYSTEMIMAGE_FILES) $(SYSTEM_LINKER_CONFIG_SOURCE)) diff --git a/core/product.mk b/core/product.mk index 4c23e5dfdd..b07e6e0dc4 100644 --- a/core/product.mk +++ b/core/product.mk @@ -499,6 +499,10 @@ _product_single_value_vars += PRODUCT_BUILD_APPS_WITH_BUILD_NUMBER # If set, build would generate system image from Soong-defined module. _product_single_value_vars += PRODUCT_SOONG_DEFINED_SYSTEM_IMAGE +# List of stub libraries specific to the product that are already present in the system image and +# should be included in the system_linker_config. +_product_list_vars += PRODUCT_EXTRA_STUB_LIBRARIES + .KATI_READONLY := _product_single_value_vars _product_list_vars _product_var_list :=$= $(_product_single_value_vars) $(_product_list_vars)