vendor/etc/linker.config.pb from multiple input files

When we have dedicated .mk files for each modules (e.g. usb, drm, etc)
and those modules have their own linker configuration requirements, it
would make more sense to have "fragments" for linker configuration.

This change introduces a new list variable to store the list of linker
configuration fragments. When it's set, vendor/etc/linker.config.pb is
generated from the list of input fragments.

Bug: 264330513
Test: set PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS
Test: m vendorimage (generates vendor/etc/linker.config.pb)
Change-Id: I9eed0f90add0191885b7195efdab94b5b1a4a62d
This commit is contained in:
Jooyung Han
2023-01-09 16:26:23 +09:00
parent 5c35eed416
commit da2d4a29bf
2 changed files with 15 additions and 0 deletions

View File

@@ -3492,6 +3492,18 @@ ifdef BOARD_USES_VENDOR_DLKMIMAGE
INTERNAL_VENDORIMAGE_FILES += $(call create-partition-compat-symlink,$(TARGET_OUT_VENDOR)/lib/modules,/vendor_dlkm/lib/modules,vendor_dlkm.img)
endif
# Install vendor/etc/linker.config.pb when PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS is set
ifneq ($(strip $(PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS)),)
vendor_linker_config_file := $(TARGET_OUT_VENDOR)/etc/linker.config.pb
$(vendor_linker_config_file): private_linker_config_fragments := $(PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS)
$(vendor_linker_config_file): $(PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS) | $(HOST_OUT_EXECUTABLES)/conv_linker_config
$(HOST_OUT_EXECUTABLES)/conv_linker_config proto \
--source $(call normalize-path-list,$(private_linker_config_fragments)) \
--output $@
$(call define declare-0p-target,$(vendor_linker_config_file),)
INTERNAL_VENDORIMAGE_FILES += $(vendor_linker_config_file)
endif
INSTALLED_FILES_FILE_VENDOR := $(PRODUCT_OUT)/installed-files-vendor.txt
INSTALLED_FILES_JSON_VENDOR := $(INSTALLED_FILES_FILE_VENDOR:.txt=.json)
$(INSTALLED_FILES_FILE_VENDOR): .KATI_IMPLICIT_OUTPUTS := $(INSTALLED_FILES_JSON_VENDOR)

View File

@@ -373,6 +373,9 @@ _product_single_value_vars += PRODUCT_MODULE_BUILD_FROM_SOURCE
# If true, installs a full version of com.android.virt APEX.
_product_single_value_vars += PRODUCT_AVF_ENABLED
# List of .json files to be merged/compiled into vendor/etc/linker.config.pb
_product_list_vars += PRODUCT_VENDOR_LINKER_CONFIG_FRAGMENTS
# Whether to use userfaultfd GC.
# Possible values are:
# - "default" or empty: both the build system and the runtime determine whether to use userfaultfd