From 0c0795944c6bb6a7f1d0e6d98a208051fd9b68ad Mon Sep 17 00:00:00 2001 From: Kiyoung Kim Date: Thu, 1 Dec 2022 10:15:10 +0900 Subject: [PATCH] Append LLNDK libraries in the APEX to the system linker config Some of the LLNDK libraries are in the APEX, and those should be marked as required libs of system image, so system namespaces can link to the APEX namespace properly. This change automates the process instead of adding APEX LLNDKs to linker.config.json manually. Bug: 251782700 Test: Cuttlefish build and boot succeeded Change-Id: I538a619caa67e64e6432517e1de87f3007bccbde --- core/Makefile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/Makefile b/core/Makefile index 955b3601f6..b6edf39b9d 100644 --- a/core/Makefile +++ b/core/Makefile @@ -3069,12 +3069,15 @@ ifdef BUILDING_SYSTEM_IMAGE # Install system linker configuration # Collect all available stub libraries installed in system and install with predefined linker configuration +# Also append LLNDK libraries in the APEX as required libs SYSTEM_LINKER_CONFIG := $(TARGET_OUT)/etc/linker.config.pb SYSTEM_LINKER_CONFIG_SOURCE := $(call intermediates-dir-for,ETC,system_linker_config)/system_linker_config $(SYSTEM_LINKER_CONFIG): PRIVATE_SYSTEM_LINKER_CONFIG_SOURCE := $(SYSTEM_LINKER_CONFIG_SOURCE) $(SYSTEM_LINKER_CONFIG) : $(INTERNAL_SYSTEMIMAGE_FILES) $(SYSTEM_LINKER_CONFIG_SOURCE) | conv_linker_config $(HOST_OUT_EXECUTABLES)/conv_linker_config systemprovide --source $(PRIVATE_SYSTEM_LINKER_CONFIG_SOURCE) \ --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)" $(call declare-1p-target,$(SYSTEM_LINKER_CONFIG),) $(call declare-license-deps,$(SYSTEM_LINKER_CONFIG),$(INTERNAL_SYSTEMIMAGE_FILES) $(SYSTEM_LINKER_CONFIG_SOURCE))