sdm710-common: Add shim for missing symbol in lib-imsvideocodec.so

Commit 992496bd2e ("Allow creating child surfaces from
BlastBufferQueue") added 3rd parameter to Surface::Surface
constructor that causes an unresolved symbol in existing blobs.

Provide a shim library with implementation of older Surface
constructor for lib-imsvidcodec.so that references the mentioned
symbol. Class constructor is a function with thiscall calling
convention so to preserve ABI we have to provide a C-function with
pointer as first parameter (that is hidden in C++) and return that
pointer from the function.

Resolves:
E ims_media_jni: Error loading library lib-imsvt.so: dlopen failed: cannot locate symbol "_ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEb" referenced by "/system/system_ext/lib64/lib-imsvideocodec.so"

Signed-off-by: Ivan Vecera <ivan@cera.cz>
Change-Id: I91abeabb07cac8553ee548e507a949e929590995
This commit is contained in:
Ivan Vecera
2022-07-18 19:32:13 +02:00
committed by Sebastiano Barezzi
parent 48943bc614
commit b2ffa9bc9d
4 changed files with 44 additions and 0 deletions

View File

@@ -21,6 +21,14 @@ if [ ! -f "${HELPER}" ]; then
fi
source "${HELPER}"
function blob_fixup() {
case "${1}" in
system_ext/lib64/lib-imsvideocodec.so)
"${PATCHELF}" --add-needed "lib-imsvtshim.so" "${2}"
;;
esac
}
# Default to sanitizing the vendor folder before extraction
CLEAN_VENDOR=true

15
libshims/Android.bp Normal file
View File

@@ -0,0 +1,15 @@
//
// Copyright (C) 2022 The LineageOS Project
//
// SPDX-License-Identifier: Apache-2.0
//
cc_library {
name: "lib-imsvtshim",
system_ext_specific: true,
srcs: ["lib-imsvtshim.cpp"],
shared_libs: [
"libgui",
"libutils",
],
}

View File

@@ -0,0 +1,20 @@
#include <gui/IGraphicBufferProducer.h>
using namespace android;
extern "C" {
// Surface::Surface(sp<const IGraphicBufferProducer>&, bool, const sp<IBinder>&)
void* _ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEbRKNS1_INS_7IBinderEEE(
void*, const sp<IGraphicBufferProducer>&, bool, const sp<IBinder>&);
// Surface::Surface(const sp<IGraphicBufferProducer>&, bool)
void* _ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEb(
void* _this, const sp<IGraphicBufferProducer>& bufferProducer,
bool controlledByApp)
{
return _ZN7android7SurfaceC1ERKNS_2spINS_22IGraphicBufferProducerEEEbRKNS1_INS_7IBinderEEE(
_this, bufferProducer, controlledByApp, nullptr);
}
}

View File

@@ -355,6 +355,7 @@ PRODUCT_SOONG_NAMESPACES += \
PRODUCT_PACKAGES += \
ims-ext-common \
ims_ext_common.xml \
lib-imsvtshim \
qti-telephony-hidl-wrapper \
qti_telephony_hidl_wrapper.xml \
qti-telephony-utils \