diff --git a/hybris/libhybris/0005-eglplatform_wayland-link-libEGL-at-runtime.patch b/hybris/libhybris/0005-eglplatform_wayland-link-libEGL-at-runtime.patch deleted file mode 100644 index bee5e5404..000000000 --- a/hybris/libhybris/0005-eglplatform_wayland-link-libEGL-at-runtime.patch +++ /dev/null @@ -1,90 +0,0 @@ -From 1f4d73a7c3ebfbbeaa91de51ef50c69676da730d Mon Sep 17 00:00:00 2001 -From: Alexey Min -Date: Sat, 31 Aug 2019 01:51:55 +0300 -Subject: [PATCH] eglplatform_wayland: link libEGL at runtime - -hybris_egl_display_get_mapping() function is implemented -in libhybris's libEGL.so. However, eglplatform_wayland.so -is not linked to libEGL directly, causing undefined symbol -errors during loading, if libEGL was not already loaded by -some other dependencies. Therefore, we should load libEGL -at runtime here and resolve this function dynamically. ---- - .../platforms/wayland/eglplatform_wayland.cpp | 40 ++++++++++++++++++- - 1 file changed, 39 insertions(+), 1 deletion(-) - -diff --git a/hybris/egl/platforms/wayland/eglplatform_wayland.cpp b/hybris/egl/platforms/wayland/eglplatform_wayland.cpp -index 191ae76..7668c32 100644 ---- a/hybris/egl/platforms/wayland/eglplatform_wayland.cpp -+++ b/hybris/egl/platforms/wayland/eglplatform_wayland.cpp -@@ -36,6 +36,7 @@ - #include - #include - #include -+#include - extern "C" { - #include - }; -@@ -61,6 +62,13 @@ static EGLSyncKHR (*_eglCreateSyncKHR)(EGLDisplay dpy, EGLenum type, const EGLin - static EGLBoolean (*_eglDestroySyncKHR)(EGLDisplay dpy, EGLSyncKHR sync) = NULL; - static EGLint (*_eglClientWaitSyncKHR)(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout) = NULL; - -+/* The following function is implemented in libhybris's libEGL.so. -+ * However, eglplatform_wayland.so is not linking to libEGL directly, -+ * causing undefined symbol errors during loading, if libEGL was not -+ * already loaded by some other dependencies. Therefore, we should try -+ * to load libEGL at runtime here and resolve this function dynamically */ -+typedef struct _EGLDisplay *(*PFNHYBRISEGLDISPLAYGETMAPPINGPROC)(EGLDisplay dpy); -+ - struct WaylandDisplay { - _EGLDisplay base; - -@@ -202,6 +210,36 @@ extern "C" int waylandws_post(EGLNativeWindowType win, void *buffer) - return ((WaylandNativeWindow *) eglwin->nativewindow)->postBuffer((ANativeWindowBuffer *) buffer); - } - -+/** -+ * Loads libhybris's libEGL at runtime to call hybris_egl_display_get_mapping() -+ */ -+static struct _EGLDisplay *_hybris_egl_display_get_mapping(EGLDisplay dpy) -+{ -+ static void *libEGL_handle = NULL; -+ static PFNHYBRISEGLDISPLAYGETMAPPINGPROC hybris_egl_display_get_mapping_fn = NULL; -+ -+ if (!libEGL_handle) { -+ dlerror(); // cleanup error buffer -+ libEGL_handle = dlopen("libEGL.so.1", RTLD_NOW | RTLD_GLOBAL); -+ if (!libEGL_handle) { -+ HYBRIS_ERROR("ERROR: Failed to dlopen libEGL! %s", dlerror()); -+ abort(); -+ } -+ } -+ -+ if (!hybris_egl_display_get_mapping_fn) { -+ dlerror(); // cleanup error buffer -+ hybris_egl_display_get_mapping_fn = (PFNHYBRISEGLDISPLAYGETMAPPINGPROC)dlsym( -+ libEGL_handle, "hybris_egl_display_get_mapping"); -+ if (!hybris_egl_display_get_mapping_fn) { -+ HYBRIS_ERROR("ERROR: Cannot resolve 'hybris_egl_display_get_mapping' in libEGL! %s", dlerror()); -+ abort(); -+ } -+ } -+ -+ return hybris_egl_display_get_mapping_fn(dpy); -+} -+ - extern "C" wl_buffer *waylandws_createWlBuffer(EGLDisplay dpy, EGLImageKHR image) - { - egl_image *img = reinterpret_cast(image); -@@ -211,7 +249,7 @@ extern "C" wl_buffer *waylandws_createWlBuffer(EGLDisplay dpy, EGLImageKHR image - return NULL; - } - if (img->target == EGL_WAYLAND_BUFFER_WL) { -- WaylandDisplay *wdpy = (WaylandDisplay *)hybris_egl_display_get_mapping(dpy); -+ WaylandDisplay *wdpy = (WaylandDisplay *)_hybris_egl_display_get_mapping(dpy); - server_wlegl_buffer *buf = server_wlegl_buffer_from((wl_resource *)img->egl_buffer); - WaylandNativeWindowBuffer wnb(buf->buf); - // The buffer will be managed by the app, so pass NULL as the queue so that --- -2.21.0 - diff --git a/hybris/libhybris/APKBUILD b/hybris/libhybris/APKBUILD index 875d600f9..4058f1320 100644 --- a/hybris/libhybris/APKBUILD +++ b/hybris/libhybris/APKBUILD @@ -1,6 +1,6 @@ pkgname=libhybris -pkgver=1.0_git20190508 -pkgrel=3 +pkgver=1.0_git20191001 +pkgrel=0 arch="x86 armhf armv7 aarch64" url="https://github.com/libhybris/libhybris" license="Apache" @@ -8,13 +8,12 @@ makedepends="autoconf automake libtool wayland-dev linux-headers bsd-compat-head libx11-dev libxcb-dev libxext-dev android-headers-7.1 android-headers-4.4" depends_dev="bsd-compat-headers android-headers-7.1" -_commit="8ddb15b53d6a63b1545bbf97d00ea93827bd68eb" +_commit="eaa6884ba95a1d5d0303119ffdc48952a098059b" source="$pkgname-$_commit.tar.gz::https://github.com/libhybris/libhybris/archive/$_commit.tar.gz 0001-Make-libhybris-compile-with-musl.patch 0002-tests-Regression-test-for-EGL-glibc-TLS-conflict.patch 0003-PATCH-v2-Implement-X11-EGL-platform-based-on-wayland.patch 0004-Build-test-hwcomposer-7-caf.patch - 0005-eglplatform_wayland-link-libEGL-at-runtime.patch " pkgdesc="libhybris allows to use bionic-based HW adaptations" @@ -168,9 +167,8 @@ dev() { ln -s ../hybris/EGL/eglhybris.h . } -sha512sums="681e8345ba56d5b9684ab3901c9cfdc6d4f48f55ef97611eef14d9471f08f1c0f60803298224df5110f2a3d08da145a61e38ea241585bc07e30cb48a893dc92b libhybris-8ddb15b53d6a63b1545bbf97d00ea93827bd68eb.tar.gz +sha512sums="598e4a788d38116437d24052b2153abd980d11fc8a277b5a0655ab96a6b8803388260e4621200f015570dcfa0ebb66fb68eeeb99948f1d9d4b9a04aa71d06540 libhybris-eaa6884ba95a1d5d0303119ffdc48952a098059b.tar.gz 9f7a324f18332e44f8789108e32f0587c268d10adaee0040c42d1bece7ab58e292d68243e7814f34f37b3b5dff590758269e531b4f2fd1991334eda4333f5854 0001-Make-libhybris-compile-with-musl.patch 1355a4403d1af8bdf75b9e4502cbfc093b9788224ce7c24a1f6a53dd7996d385d31a3362577a4293db6b6d0dd0ae4e88140b38c658ff0a288d9acfc2753859bb 0002-tests-Regression-test-for-EGL-glibc-TLS-conflict.patch db7bb0ffc04042b32d870db364df4d38d9769978f26d71f98dd2569b4cae7fb3839c7a0c421b465f931a57fcde38b8eca091b7ae0062e32a7e09b93a701397f3 0003-PATCH-v2-Implement-X11-EGL-platform-based-on-wayland.patch -eda57804fefa1d586e90fb2198c310f65e6dbc7e09b5d1dd7d15df4ab152c4c8915c212230a92c35ec8a013d3ec7a7b1d289653bedb46b7eb2850a477ccebe16 0004-Build-test-hwcomposer-7-caf.patch -39cfd9db2bcd77615de7370e0df861ce61a7025d1b39fd049d27f345643626bbe5253515a876f606fc86b678cb85f8634a9df663b5b32a90fa53b37136d25814 0005-eglplatform_wayland-link-libEGL-at-runtime.patch" +eda57804fefa1d586e90fb2198c310f65e6dbc7e09b5d1dd7d15df4ab152c4c8915c212230a92c35ec8a013d3ec7a7b1d289653bedb46b7eb2850a477ccebe16 0004-Build-test-hwcomposer-7-caf.patch"