From e586c74b8ab5e0692bded43bacfb29b972f4b92d Mon Sep 17 00:00:00 2001 From: Bruno Martins Date: Sat, 7 Sep 2024 14:35:39 +0100 Subject: [PATCH] sm8550-common: Setup ELF checks Co-authored-by: Aaron Kling Co-authored-by: Cosmin Tanislav Co-authored-by: Michael Bestas Change-Id: I17b9c9021155c30c1ec1aa1754c995dae30cb2a7 --- extract-files.sh | 2 ++ proprietary-files.txt | 15 ++++++++++----- setup-makefiles.sh | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 5 deletions(-) diff --git a/extract-files.sh b/extract-files.sh index 667d2d0..09add8f 100755 --- a/extract-files.sh +++ b/extract-files.sh @@ -13,6 +13,8 @@ if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi ANDROID_ROOT="${MY_DIR}/../../.." +export TARGET_ENABLE_CHECKELF=true + # If XML files don't have comments before the XML header, use this flag # Can still be used with broken XML files by using blob_fixup export TARGET_DISABLE_XML_FIXING=true diff --git a/proprietary-files.txt b/proprietary-files.txt index b5d1d7a..00c2b73 100644 --- a/proprietary-files.txt +++ b/proprietary-files.txt @@ -1,5 +1,10 @@ # All unpinned blobs are extracted from S916BXXS6CXHA +# Current blobs with ELF checks disabled: +# libar-pal depends on libagmclient, which is a gnu makefile target +# libqc2audio_hwaudiocodec depends on libpalclient, which is a gnu makefile target +# lowi-server, qms depend on libwpa_client, which is a gnu makefile target + # ADSP vendor/bin/adsprpcd vendor/bin/loadalgo @@ -95,7 +100,7 @@ vendor/lib64/libadm.so vendor/lib64/libar-acdb.so vendor/lib64/libar-gpr.so -vendor/lib64/libar-gsl.so --vendor/lib64/libar-pal.so +-vendor/lib64/libar-pal.so;DISABLE_CHECKELF -vendor/lib64/libats.so vendor/lib64/libaudio_log_utils.so vendor/lib64/libcapiv2svacnnvendor.so @@ -648,7 +653,7 @@ vendor/bin/diag-router vendor/etc/init/vendor.qti.diag.rc vendor/etc/vintf/manifest/vendor.qti.diag.hal.service.xml vendor/lib64/libdiag.so -vendor/lib64/vendor.qti.diaghal@1.0.so +vendor/lib64/vendor.qti.diaghal@1.0.so;MODULE_SUFFIX=_vendor # Display (HDR) vendor/lib64/libhdr_backlight_adapter.so @@ -775,7 +780,7 @@ vendor/lib64/vendor.samsung.hardware.biometrics.fingerprint-V1-ndk.so # GNSS vendor/bin/hw/android.hardware.gnss-aidl-service-qti vendor/bin/loc_launcher -vendor/bin/lowi-server +vendor/bin/lowi-server;DISABLE_CHECKELF vendor/bin/xtra-daemon vendor/etc/batching.conf vendor/etc/gnss_antenna_info.conf @@ -973,7 +978,7 @@ vendor/lib64/libqc2audio_base.so vendor/lib64/libqc2audio_basecodec.so vendor/lib64/libqc2audio_core.so vendor/lib64/libqc2audio_hooks.so -vendor/lib64/libqc2audio_hwaudiocodec.so +vendor/lib64/libqc2audio_hwaudiocodec.so;DISABLE_CHECKELF vendor/lib64/libqc2audio_platform.so vendor/lib64/libqc2audio_swaudiocodec.so vendor/lib64/libqc2audio_utils.so @@ -1104,7 +1109,7 @@ vendor/bin/ipacm-diag vendor/bin/ks vendor/bin/mdm_helper vendor/bin/mdm_helper_proxy -vendor/bin/qms +vendor/bin/qms;DISABLE_CHECKELF vendor/etc/init/ipacm-diag.rc vendor/etc/init/qms.rc vendor/etc/locale/plmn_delta_eng.bin diff --git a/setup-makefiles.sh b/setup-makefiles.sh index e9e0aaf..8b7a0dc 100755 --- a/setup-makefiles.sh +++ b/setup-makefiles.sh @@ -13,6 +13,8 @@ if [[ ! -d "${MY_DIR}" ]]; then MY_DIR="${PWD}"; fi ANDROID_ROOT="${MY_DIR}/../../.." +export TARGET_ENABLE_CHECKELF=true + HELPER="${ANDROID_ROOT}/tools/extract-utils/extract_utils.sh" if [ ! -f "${HELPER}" ]; then echo "Unable to find helper script at ${HELPER}" @@ -20,6 +22,42 @@ if [ ! -f "${HELPER}" ]; then fi source "${HELPER}" +function vendor_imports() { + cat <>"$1" + "device/samsung/sm8550-common", + "hardware/qcom-caf/sm8550", + "hardware/qcom-caf/wlan", + "hardware/samsung", + "vendor/qcom/opensource/commonsys/display", + "vendor/qcom/opensource/commonsys-intf/display", + "vendor/qcom/opensource/dataservices", +EOF +} + +function lib_to_package_fixup_vendor_variants() { + if [ "$2" != "vendor" ]; then + return 1 + fi + + case "$1" in + vendor.qti.diaghal@1.0) + echo "$1_vendor" + ;; + libagmclient | \ + libpalclient | \ + libwpa_client) ;; + *) + return 1 + ;; + esac +} + +function lib_to_package_fixup() { + lib_to_package_fixup_clang_rt_ubsan_standalone "$1" || + lib_to_package_fixup_proto_3_9_1 "$1" || + lib_to_package_fixup_vendor_variants "$@" +} + # Initialize the helper for common setup_vendor "${DEVICE_COMMON}" "${VENDOR_COMMON:-$VENDOR}" "${ANDROID_ROOT}" true