ANDROID: GKI: Multi arch exports protection support

ABI is being implemented for x86_64, making it necessary
to support protected exports header file generation for
the GKI modules for multiple architecture.

Enable support to select required inputs based on the ARCH
to generate gki_module_protected_exports.h during kernel
build.

Inputs for generating gki_module_protected_exports.h are:

ARCH = arm64:
ABI Protected exports list: abi_gki_protected_exports_aarch64
Protected GKI modules list: gki_aarch64_protected_modules

ARCH = x86_64:
ABI Protected exports list: abi_gki_protected_exports_x86_64
Protected GKI modules list: gki_x86_64_protected_modules

Test: TH
Test: Manual verification of the generated header file
Test: bazel run //common:kernel_aarch64_abi_update_protected_exports
Bug: 151893768
Change-Id: Ic4bcb2732199b71a7973b5ce4c852bcd95d37131
Signed-off-by: Ramji Jiyani <ramjiyani@google.com>
This commit is contained in:
Ramji Jiyani 2023-03-21 22:49:31 +00:00
parent cf6897ede5
commit 0d5b95acb6
7 changed files with 611 additions and 9 deletions

View file

@ -100,10 +100,15 @@ if [ "$(basename "${TARGET}")" = "gki_module_unprotected.h" ]; then
generate_header "${TARGET}" "${GKI_VENDOR_SYMBOLS}" "unprotected"
else
# Sorted list of exported symbols
GKI_EXPORTED_SYMBOLS="${objtree}/protected_exports"
GKI_EXPORTED_SYMBOLS="${objtree}/abi_gki_protected_exports"
# Make a temp copy to avoid changing source during pre-processing
cp -f "${SYMBOL_LIST}" "${GKI_EXPORTED_SYMBOLS}"
if [ -z "${SYMBOL_LIST}" ]; then
# Create empty list if ARCH doesn't have protected exports
touch "${GKI_EXPORTED_SYMBOLS}"
else
# Make a temp copy to avoid changing source during pre-processing
cp -f "${SYMBOL_LIST}" "${GKI_EXPORTED_SYMBOLS}"
fi
generate_header "${TARGET}" "${GKI_EXPORTED_SYMBOLS}" "protected_exports"
fi