extract_utils: Implement versioned patchelf and patchelf 0.8

* Result of patchelf v0.9:
E dlopen failed: "/vendor/lib64/libvendor.goodix.hardware.fingerprint@1.0-service.so" loaded phdr 0x70d4cd6000 not in loadable segment
* While searching up this issue, I found a LineageOS Gerrit change (Ibeb09b6ec37ef62b6a5abe40bae1e8bd8d92e7af) with the same error
* Hamsi2k mentioned in the change that patchelf v0.8 is needed to fix the issue
* Building patchelf v0.8 and trying to patch the blobs works
* Implement versioned patchelf logic, allowing the script to both select the default patchelf and a specific patchelf version only for some files
* Leave 0.9 as the default version to not change the default behaviour

Change-Id: I6c0cbe76baf241233fdd125f5ed1eccbd5855124
This commit is contained in:
Sebastiano Barezzi
2021-01-17 02:26:08 +01:00
parent 55ec886933
commit 7f0c788e9c

View File

@@ -94,8 +94,19 @@ function setup_vendor() {
VENDOR_RADIO_STATE=0
fi
export BINARIES_LOCATION="$ANDROID_ROOT"/prebuilts/extract-tools/${HOST}-x86/bin
for version in 0_8 0_9; do
export PATCHELF_${version}="$BINARIES_LOCATION"/patchelf-"${version}"
done
if [ -z "$PATCHELF_VERSION" ]; then
export PATCHELF_VERSION=0_9
fi
if [ -z "$PATCHELF" ]; then
export PATCHELF="$ANDROID_ROOT"/prebuilts/extract-tools/${HOST}-x86/bin/patchelf
local patchelf_variable="PATCHELF_${PATCHELF_VERSION}"
export PATCHELF=${!patchelf_variable}
fi
}